diff mbox series

[net-next,v2] nfp: using napi_build_skb() to replace build_skb()

Message ID 20231026080058.22810-1-louis.peens@corigine.com (mailing list archive)
State Accepted
Commit 1a86a77a2328ad7405bd25b8f4c470445e966622
Delegated to: Netdev Maintainers
Headers show
Series [net-next,v2] nfp: using napi_build_skb() to replace build_skb() | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1363 this patch: 1363
netdev/cc_maintainers warning 5 maintainers not CCed: yinjun.zhang@corigine.com horms@kernel.org edumazet@google.com leon@kernel.org huanhuan.wang@corigine.com
netdev/build_clang success Errors and warnings before: 1388 this patch: 1388
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 1388 this patch: 1388
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 16 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Louis Peens Oct. 26, 2023, 8 a.m. UTC
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(-)

Comments

Wojciech Drewek Oct. 26, 2023, 8:55 a.m. UTC | #1
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;
patchwork-bot+netdevbpf@kernel.org Oct. 27, 2023, 10 p.m. UTC | #2
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!
diff mbox series

Patch

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;