linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Meghana Malladi <m-malladi@ti.com>
Cc: <namcao@linutronix.de>, <jacob.e.keller@intel.com>,
	<sdf@fomichev.me>, <john.fastabend@gmail.com>, <hawk@kernel.org>,
	<daniel@iogearbox.net>, <ast@kernel.org>, <pabeni@redhat.com>,
	<edumazet@google.com>, <davem@davemloft.net>,
	<andrew+netdev@lunn.ch>, <bpf@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>, <srk@ti.com>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	Roger Quadros <rogerq@kernel.org>, <danishanwar@ti.com>
Subject: Re: [PATCH net] net: ti: icssg-prueth: Fix skb handling for XDP_PASS
Date: Wed, 23 Jul 2025 17:19:47 -0700	[thread overview]
Message-ID: <20250723171947.76995990@kernel.org> (raw)
In-Reply-To: <20250721124918.3347679-1-m-malladi@ti.com>

On Mon, 21 Jul 2025 18:19:18 +0530 Meghana Malladi wrote:
> diff --git a/drivers/net/ethernet/ti/icssg/icssg_common.c b/drivers/net/ethernet/ti/icssg/icssg_common.c
> index 12f25cec6255..a0e7def33e8e 100644
> --- a/drivers/net/ethernet/ti/icssg/icssg_common.c
> +++ b/drivers/net/ethernet/ti/icssg/icssg_common.c
> @@ -757,15 +757,12 @@ static int emac_rx_packet(struct prueth_emac *emac, u32 flow_id, u32 *xdp_state)
>  		xdp_prepare_buff(&xdp, pa, PRUETH_HEADROOM, pkt_len, false);
>  
>  		*xdp_state = emac_run_xdp(emac, &xdp, page, &pkt_len);
> -		if (*xdp_state == ICSSG_XDP_PASS)
> -			skb = xdp_build_skb_from_buff(&xdp);
> -		else
> +		if (*xdp_state != ICSSG_XDP_PASS)
>  			goto requeue;
> -	} else {
> -		/* prepare skb and send to n/w stack */
> -		skb = napi_build_skb(pa, PAGE_SIZE);
>  	}
>  
> +	/* prepare skb and send to n/w stack */
> +	skb = napi_build_skb(pa, PAGE_SIZE);
>  	if (!skb) {
>  		ndev->stats.rx_dropped++;
>  		page_pool_recycle_direct(pool, page);

I'm not sure this is correct. We seem to hardcode headroom to
PRUETH_HEADROOM lower in this function. If XDP adds or removes
network headers and then returns XDP_PASS we'll look for the packet 
at the wrong offset.

We just merged some XDP tests, could you try running 
tools/testing/selftests/drivers/net/xdp.py ? 
Some general instructions can be found here:
https://github.com/linux-netdev/nipa/wiki/Running-driver-tests

Not sure how stable the test is for all NICs but I think the 
 xdp.test_xdp_native_adjst_head_grow_data
test case will exercise what I'm suspecting will fail.


  parent reply	other threads:[~2025-07-24  0:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-21 12:49 [PATCH net] net: ti: icssg-prueth: Fix skb handling for XDP_PASS Meghana Malladi
2025-07-21 22:02 ` Jacob Keller
2025-07-24  0:19 ` Jakub Kicinski [this message]
2025-07-30 15:14   ` Meghana Malladi

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=20250723171947.76995990@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=danishanwar@ti.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hawk@kernel.org \
    --cc=jacob.e.keller@intel.com \
    --cc=john.fastabend@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m-malladi@ti.com \
    --cc=namcao@linutronix.de \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rogerq@kernel.org \
    --cc=sdf@fomichev.me \
    --cc=srk@ti.com \
    --cc=vigneshr@ti.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).