The mbox handler npc_install_flow returns ENOTSUPP for unsupported
flow keys. This patch modifies the return value to AF driver defined
error code for debugging purpose.

Signed-off-by: Naveen Mamindlapalli <nave...@marvell.com>
---
 drivers/net/ethernet/marvell/octeontx2/af/mbox.h       | 1 +
 drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c | 7 ++++---
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/marvell/octeontx2/af/mbox.h 
b/drivers/net/ethernet/marvell/octeontx2/af/mbox.h
index 1dca2ca115c7..46f919625464 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/mbox.h
+++ b/drivers/net/ethernet/marvell/octeontx2/af/mbox.h
@@ -605,6 +605,7 @@ enum nix_af_status {
        NIX_AF_INVAL_SSO_PF_FUNC    = -420,
        NIX_AF_ERR_TX_VTAG_NOSPC    = -421,
        NIX_AF_ERR_RX_VTAG_INUSE    = -422,
+       NIX_AF_ERR_NPC_KEY_NOT_SUPP = -423,
 };
 
 /* For NIX RX vtag action  */
diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c 
b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c
index a31b46d65cc5..d805a189a268 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c
@@ -597,7 +597,7 @@ static int npc_check_unsupported_flows(struct rvu *rvu, u64 
features, u8 intf)
                dev_info(rvu->dev, "Unsupported flow(s):\n");
                for_each_set_bit(bit, (unsigned long *)&unsupported, 64)
                        dev_info(rvu->dev, "%s ", npc_get_field_name(bit));
-               return -EOPNOTSUPP;
+               return NIX_AF_ERR_NPC_KEY_NOT_SUPP;
        }
 
        return 0;
@@ -1143,8 +1143,9 @@ int rvu_mbox_handler_npc_install_flow(struct rvu *rvu,
        if (!is_pffunc_af(req->hdr.pcifunc))
                req->chan_mask = 0xFFF;
 
-       if (npc_check_unsupported_flows(rvu, req->features, req->intf))
-               return -EOPNOTSUPP;
+       err = npc_check_unsupported_flows(rvu, req->features, req->intf);
+       if (err)
+               return err;
 
        if (npc_mcam_verify_channel(rvu, target, req->intf, req->channel))
                return -EINVAL;
-- 
2.16.5

Reply via email to