* [PATCH net-next v2] nfp: using napi_build_skb() to replace build_skb()
@ 2023-10-26 8:00 Louis Peens
2023-10-26 8:55 ` Wojciech Drewek
2023-10-27 22:00 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Louis Peens @ 2023-10-26 8:00 UTC (permalink / raw)
To: David Miller, Jakub Kicinski, Paolo Abeni
Cc: Wojciech Drewek, Fei Qin, netdev, oss-drivers
From: Fei Qin <fei.qin@corigine.com>
The napi_build_skb() can reuse the skb in skb cache per CPU or
can allocate skbs in bulk, which helps improve the performance.
Signed-off-by: Fei Qin <fei.qin@corigine.com>
Signed-off-by: Louis Peens <louis.peens@corigine.com>
---
v1->v2:
Dropped the changes for the *_ctrl_* paths, as they were not within
napi context. Thanks Wojciech for pointing this out.
drivers/net/ethernet/netronome/nfp/nfd3/dp.c | 2 +-
drivers/net/ethernet/netronome/nfp/nfdk/dp.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/netronome/nfp/nfd3/dp.c b/drivers/net/ethernet/netronome/nfp/nfd3/dp.c
index 0cc026b0aefd..17381bfc15d7 100644
--- a/drivers/net/ethernet/netronome/nfp/nfd3/dp.c
+++ b/drivers/net/ethernet/netronome/nfp/nfd3/dp.c
@@ -1070,7 +1070,7 @@ static int nfp_nfd3_rx(struct nfp_net_rx_ring *rx_ring, int budget)
nfp_repr_inc_rx_stats(netdev, pkt_len);
}
- skb = build_skb(rxbuf->frag, true_bufsz);
+ skb = napi_build_skb(rxbuf->frag, true_bufsz);
if (unlikely(!skb)) {
nfp_nfd3_rx_drop(dp, r_vec, rx_ring, rxbuf, NULL);
continue;
diff --git a/drivers/net/ethernet/netronome/nfp/nfdk/dp.c b/drivers/net/ethernet/netronome/nfp/nfdk/dp.c
index 33b6d74adb4b..8d78c6faefa8 100644
--- a/drivers/net/ethernet/netronome/nfp/nfdk/dp.c
+++ b/drivers/net/ethernet/netronome/nfp/nfdk/dp.c
@@ -1189,7 +1189,7 @@ static int nfp_nfdk_rx(struct nfp_net_rx_ring *rx_ring, int budget)
nfp_repr_inc_rx_stats(netdev, pkt_len);
}
- skb = build_skb(rxbuf->frag, true_bufsz);
+ skb = napi_build_skb(rxbuf->frag, true_bufsz);
if (unlikely(!skb)) {
nfp_nfdk_rx_drop(dp, r_vec, rx_ring, rxbuf, NULL);
continue;
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next v2] nfp: using napi_build_skb() to replace build_skb()
2023-10-26 8:00 [PATCH net-next v2] nfp: using napi_build_skb() to replace build_skb() Louis Peens
@ 2023-10-26 8:55 ` Wojciech Drewek
2023-10-27 22:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Wojciech Drewek @ 2023-10-26 8:55 UTC (permalink / raw)
To: Louis Peens, David Miller, Jakub Kicinski, Paolo Abeni
Cc: Fei Qin, netdev, oss-drivers
On 26.10.2023 10:00, Louis Peens wrote:
> From: Fei Qin <fei.qin@corigine.com>
>
> The napi_build_skb() can reuse the skb in skb cache per CPU or
> can allocate skbs in bulk, which helps improve the performance.
>
> Signed-off-by: Fei Qin <fei.qin@corigine.com>
> Signed-off-by: Louis Peens <louis.peens@corigine.com>
> ---
> v1->v2:
> Dropped the changes for the *_ctrl_* paths, as they were not within
> napi context. Thanks Wojciech for pointing this out.
No problem :)
Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>
>
> drivers/net/ethernet/netronome/nfp/nfd3/dp.c | 2 +-
> drivers/net/ethernet/netronome/nfp/nfdk/dp.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/netronome/nfp/nfd3/dp.c b/drivers/net/ethernet/netronome/nfp/nfd3/dp.c
> index 0cc026b0aefd..17381bfc15d7 100644
> --- a/drivers/net/ethernet/netronome/nfp/nfd3/dp.c
> +++ b/drivers/net/ethernet/netronome/nfp/nfd3/dp.c
> @@ -1070,7 +1070,7 @@ static int nfp_nfd3_rx(struct nfp_net_rx_ring *rx_ring, int budget)
> nfp_repr_inc_rx_stats(netdev, pkt_len);
> }
>
> - skb = build_skb(rxbuf->frag, true_bufsz);
> + skb = napi_build_skb(rxbuf->frag, true_bufsz);
> if (unlikely(!skb)) {
> nfp_nfd3_rx_drop(dp, r_vec, rx_ring, rxbuf, NULL);
> continue;
> diff --git a/drivers/net/ethernet/netronome/nfp/nfdk/dp.c b/drivers/net/ethernet/netronome/nfp/nfdk/dp.c
> index 33b6d74adb4b..8d78c6faefa8 100644
> --- a/drivers/net/ethernet/netronome/nfp/nfdk/dp.c
> +++ b/drivers/net/ethernet/netronome/nfp/nfdk/dp.c
> @@ -1189,7 +1189,7 @@ static int nfp_nfdk_rx(struct nfp_net_rx_ring *rx_ring, int budget)
> nfp_repr_inc_rx_stats(netdev, pkt_len);
> }
>
> - skb = build_skb(rxbuf->frag, true_bufsz);
> + skb = napi_build_skb(rxbuf->frag, true_bufsz);
> if (unlikely(!skb)) {
> nfp_nfdk_rx_drop(dp, r_vec, rx_ring, rxbuf, NULL);
> continue;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next v2] nfp: using napi_build_skb() to replace build_skb()
2023-10-26 8:00 [PATCH net-next v2] nfp: using napi_build_skb() to replace build_skb() Louis Peens
2023-10-26 8:55 ` Wojciech Drewek
@ 2023-10-27 22:00 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-10-27 22:00 UTC (permalink / raw)
To: Louis Peens
Cc: davem, kuba, pabeni, wojciech.drewek, fei.qin, netdev, oss-drivers
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Thu, 26 Oct 2023 10:00:58 +0200 you wrote:
> From: Fei Qin <fei.qin@corigine.com>
>
> The napi_build_skb() can reuse the skb in skb cache per CPU or
> can allocate skbs in bulk, which helps improve the performance.
>
> Signed-off-by: Fei Qin <fei.qin@corigine.com>
> Signed-off-by: Louis Peens <louis.peens@corigine.com>
>
> [...]
Here is the summary with links:
- [net-next,v2] nfp: using napi_build_skb() to replace build_skb()
https://git.kernel.org/netdev/net-next/c/1a86a77a2328
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-10-27 22:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-26 8:00 [PATCH net-next v2] nfp: using napi_build_skb() to replace build_skb() Louis Peens
2023-10-26 8:55 ` Wojciech Drewek
2023-10-27 22:00 ` patchwork-bot+netdevbpf
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.