From: Jakub Kicinski <kuba@kernel.org>
To: Julien Panis <jpanis@baylibre.com>
Cc: "David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Paolo Abeni" <pabeni@redhat.com>,
"Russell King" <linux@armlinux.org.uk>,
"Alexei Starovoitov" <ast@kernel.org>,
"Daniel Borkmann" <daniel@iogearbox.net>,
"Jesper Dangaard Brouer" <hawk@kernel.org>,
"John Fastabend" <john.fastabend@gmail.com>,
"Sumit Semwal" <sumit.semwal@linaro.org>,
"Christian König" <christian.koenig@amd.com>,
"Simon Horman" <horms@kernel.org>, "Andrew Lunn" <andrew@lunn.ch>,
"Ratheesh Kannoth" <rkannoth@marvell.com>,
"Naveen Mamindlapalli" <naveenm@marvell.com>,
danishanwar@ti.com, yuehaibing@huawei.com, rogerq@kernel.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
bpf@vger.kernel.org, linux-media@vger.kernel.org,
dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org
Subject: Re: [PATCH net-next v8 3/3] net: ethernet: ti: am65-cpsw: Add minimal XDP support
Date: Tue, 9 Apr 2024 17:49:28 -0700 [thread overview]
Message-ID: <20240409174928.58a7c3f0@kernel.org> (raw)
In-Reply-To: <20240223-am65-cpsw-xdp-basic-v8-3-f3421b58da09@baylibre.com>
On Mon, 08 Apr 2024 11:38:04 +0200 Julien Panis wrote:
> +static struct sk_buff *am65_cpsw_alloc_skb(struct am65_cpsw_rx_chn *rx_chn,
> + struct net_device *ndev,
> + unsigned int len,
> + int desc_idx,
> + bool allow_direct)
> +{
> + struct sk_buff *skb;
> + struct page *page;
> +
> + page = page_pool_dev_alloc_pages(rx_chn->page_pool);
> + if (unlikely(!page))
> + return NULL;
> +
> + len += AM65_CPSW_HEADROOM;
> +
> + skb = build_skb(page_address(page), len);
You shouldn't build the skb upfront any more. Give the page to the HW,
once HW sends you a completion - build the skbs. If build fails
(allocation failure) just give the page back to HW. If it succeeds,
however, you'll get a skb which is far more likely to be cache hot.
> + if (unlikely(!skb)) {
> + page_pool_put_full_page(rx_chn->page_pool, page, allow_direct);
> + rx_chn->pages[desc_idx] = NULL;
> + return NULL;
> + }
next prev parent reply other threads:[~2024-04-10 0:49 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-08 9:38 [PATCH net-next v8 0/3] Add minimal XDP support to TI AM65 CPSW Ethernet driver Julien Panis
2024-04-08 9:38 ` [PATCH net-next v8 1/3] net: ethernet: ti: Add accessors for struct k3_cppi_desc_pool members Julien Panis
2024-04-08 9:38 ` [PATCH net-next v8 2/3] net: ethernet: ti: Add desc_infos member to struct k3_cppi_desc_pool Julien Panis
2024-04-10 0:39 ` Jakub Kicinski
2024-04-10 8:36 ` Julien Panis
2024-04-10 13:24 ` Jakub Kicinski
2024-04-08 9:38 ` [PATCH net-next v8 3/3] net: ethernet: ti: am65-cpsw: Add minimal XDP support Julien Panis
2024-04-10 0:49 ` Jakub Kicinski [this message]
2024-04-10 14:02 ` Julien Panis
2024-04-10 15:02 ` Jakub Kicinski
2024-04-12 13:56 ` Julien Panis
2024-04-09 23:51 ` [PATCH net-next v8 0/3] Add minimal XDP support to TI AM65 CPSW Ethernet driver Jacob Keller
2024-04-12 14:01 ` Julien Panis
2024-04-12 23:38 ` Keller, Jacob E
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=20240409174928.58a7c3f0@kernel.org \
--to=kuba@kernel.org \
--cc=andrew@lunn.ch \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=christian.koenig@amd.com \
--cc=daniel@iogearbox.net \
--cc=danishanwar@ti.com \
--cc=davem@davemloft.net \
--cc=dri-devel@lists.freedesktop.org \
--cc=edumazet@google.com \
--cc=hawk@kernel.org \
--cc=horms@kernel.org \
--cc=john.fastabend@gmail.com \
--cc=jpanis@baylibre.com \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=naveenm@marvell.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rkannoth@marvell.com \
--cc=rogerq@kernel.org \
--cc=sumit.semwal@linaro.org \
--cc=yuehaibing@huawei.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.