All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Hariprasad Kelam <hkelam@marvell.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	kuba@kernel.org, davem@davemloft.net, sgoutham@marvell.com,
	gakula@marvell.com, jerinj@marvell.com, lcherian@marvell.com,
	sbhatta@marvell.com, naveenm@marvell.com, edumazet@google.com,
	pabeni@redhat.com, andrew+netdev@lunn.ch, bbhushan2@marvell.com
Subject: Re: [net-next 1/2] octeontx2-af:  Mailbox handlers to fetch DMAC filter drop counter
Date: Mon, 19 Jan 2026 14:53:30 +0000	[thread overview]
Message-ID: <aW5FagLp_SCH-tqQ@horms.kernel.org> (raw)
In-Reply-To: <20260114065743.2162706-2-hkelam@marvell.com>

On Wed, Jan 14, 2026 at 12:27:42PM +0530, Hariprasad Kelam wrote:
> Both CGX/RPM mac blocks support DMAC filters. This patch
> adds mbox support to read the counter.
> 
> Signed-off-by: Hariprasad Kelam <hkelam@marvell.com>

...

> diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c
> index 3abd750a4bd7..aef0087174b7 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c
> +++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c
> @@ -1352,3 +1352,23 @@ void rvu_mac_reset(struct rvu *rvu, u16 pcifunc)
>  	if (mac_ops->mac_reset(cgxd, lmac, !is_vf(pcifunc)))
>  		dev_err(rvu->dev, "Failed to reset MAC\n");
>  }
> +
> +int rvu_mbox_handler_cgx_get_dmacflt_dropped_pktcnt(struct rvu *rvu,
> +						    struct msg_req *req,
> +						    struct cgx_dmac_filter_drop_cnt *rsp)
> +{
> +	int pf = rvu_get_pf(rvu->pdev, req->hdr.pcifunc);
> +	struct mac_ops *mac_ops;
> +	u8 cgx_id, lmac_id;
> +	void *cgxd;
> +
> +	rvu_get_cgx_lmac_id(rvu->pf2cgxlmac_map[pf], &cgx_id, &lmac_id);
> +	cgxd = rvu_cgx_pdata(cgx_id, rvu);
> +	mac_ops = get_mac_ops(cgxd);

Hi Hariprasad,

Claude Code with Review Prompts [1] flags that get_mac_ops may not
always return a valid ops structure. And that other handlers that
mac_ops guard against this using is_cgx_config_permitted().

I am wondering if that is appropriate here too.

[1] https://github.com/masoncl/review-prompts/

> +
> +	if (!mac_ops->get_dmacflt_dropped_pktcnt)
> +		return 0;
> +
> +	rsp->count =  mac_ops->get_dmacflt_dropped_pktcnt(cgxd, lmac_id);
> +	return 0;
> +}
> -- 
> 2.34.1
> 
> 

  reply	other threads:[~2026-01-19 14:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-14  6:57 [net-next 0/2] Octeontx2-pf: Add support for DMAC_FILTER trap Hariprasad Kelam
2026-01-14  6:57 ` [net-next 1/2] octeontx2-af: Mailbox handlers to fetch DMAC filter drop counter Hariprasad Kelam
2026-01-19 14:53   ` Simon Horman [this message]
2026-01-14  6:57 ` [net-next 2/2] Octeontx2-pf: Add support for DMAC_FILTER trap Hariprasad Kelam
2026-01-14 15:39   ` kernel test robot
2026-01-19 15:01   ` Simon Horman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aW5FagLp_SCH-tqQ@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=bbhushan2@marvell.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gakula@marvell.com \
    --cc=hkelam@marvell.com \
    --cc=jerinj@marvell.com \
    --cc=kuba@kernel.org \
    --cc=lcherian@marvell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=naveenm@marvell.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sbhatta@marvell.com \
    --cc=sgoutham@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.