Commit 058fa3d9 authored by Naveen Mamindlapalli's avatar Naveen Mamindlapalli Committed by David S. Miller
Browse files

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: default avatarNaveen Mamindlapalli <naveenm@marvell.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b6b0e366
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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  */
+4 −3
Original line number Diff line number Diff line
@@ -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;