octeontx2-af: Modify the return code for unsupported flow keys

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 <naveenm@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Naveen Mamindlapalli 2021-03-17 19:05:38 +05:30 committed by David S. Miller
parent b6b0e3667e
commit 058fa3d915
2 changed files with 5 additions and 3 deletions

View File

@ -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 */

View File

@ -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;