Re: [PATCH net-next v2] octeontx2-af: Use LMAC_AF_ERR codes in CGX handlers

From: Simon Horman

Date: Mon Jul 27 2026 - 13:32:03 EST


On Wed, Jul 22, 2026 at 09:33:07AM +0530, nshettyj@xxxxxxxxxxx wrote:
> From: Hariprasad Kelam <hkelam@xxxxxxxxxxx>
>
> When a netdev that is not mapped to a MAC block (cgx/rpm) requests a
> MAC feature, the AF driver currently returns generic errors like -EPERM.
>
> Replace these generic error codes with driver-specific LMAC_AF_ERR_*
> error codes to provide better debugging information.
>
> Signed-off-by: Hariprasad Kelam <hkelam@xxxxxxxxxxx>
> Signed-off-by: Nitin Shetty J <nshettyj@xxxxxxxxxxx>

...

> @@ -1178,7 +1176,7 @@ int rvu_mbox_handler_cgx_set_fec_param(struct rvu *rvu,
> u8 cgx_id, lmac_id;
>
> if (!is_pf_cgxmapped(rvu, pf))
> - return -EPERM;
> + return LMAC_AF_ERR_PF_NOT_MAPPED;

Hi,

The AI-generated review of this patch [1] flags a number of pre-existing
issues. Which I think they can be considered in the context of possible
follow-up.

But it also flags that the change on the line above (and other similar
changes in this patch) will result in custom error values being propagated
to user-space. Which seems undesirable.

I think one possible solution is to convert the custom error codes
to standard ones before they are propagated to user-space.
But I'm unsure of the overall effect of that on this patch.


https://sashiko.dev/#/patchset/20260722040307.3393236-1-nshettyj%40marvell.com



>
> if (req->fec == OTX2_FEC_OFF)
> req->fec = OTX2_FEC_NONE;

...