diff mbox series

[net-next] net: veth: rely on napi_build_skb in veth_convert_skb_to_xdp_buff

Message ID 0f822c0b72f8b71555c11745cb8fb33399d02de9.1683578488.git.lorenzo@kernel.org (mailing list archive)
State Accepted
Commit 9d142ed484a3d517e779fc3c16028a720762643f
Delegated to: Netdev Maintainers
Headers show
Series [net-next] net: veth: rely on napi_build_skb in veth_convert_skb_to_xdp_buff | 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: 8 this patch: 8
netdev/cc_maintainers success CCed 10 of 10 maintainers
netdev/build_clang success Errors and warnings before: 8 this patch: 8
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: 8 this patch: 8
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Lorenzo Bianconi May 8, 2023, 8:45 p.m. UTC
Since veth_convert_skb_to_xdp_buff routine runs in veth_poll() NAPI,
rely on napi_build_skb() instead of build_skb() to reduce skb allocation
cost.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 drivers/net/veth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Yunsheng Lin May 9, 2023, 1:01 a.m. UTC | #1
On 2023/5/9 4:45, Lorenzo Bianconi wrote:
> Since veth_convert_skb_to_xdp_buff routine runs in veth_poll() NAPI,
> rely on napi_build_skb() instead of build_skb() to reduce skb allocation
> cost.

LGTM.
Reviewed-by: Yunsheng Lin <linyunsheng@huawei.com>

> 
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> ---
>  drivers/net/veth.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/veth.c b/drivers/net/veth.c
> index dce9f9d63e04..3ae496011640 100644
> --- a/drivers/net/veth.c
> +++ b/drivers/net/veth.c
> @@ -747,7 +747,7 @@ static int veth_convert_skb_to_xdp_buff(struct veth_rq *rq,
>  		if (!page)
>  			goto drop;
>  
> -		nskb = build_skb(page_address(page), PAGE_SIZE);
> +		nskb = napi_build_skb(page_address(page), PAGE_SIZE);
>  		if (!nskb) {
>  			page_pool_put_full_page(rq->page_pool, page, true);
>  			goto drop;
>
patchwork-bot+netdevbpf@kernel.org May 10, 2023, 5:20 a.m. UTC | #2
Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Mon,  8 May 2023 22:45:23 +0200 you wrote:
> Since veth_convert_skb_to_xdp_buff routine runs in veth_poll() NAPI,
> rely on napi_build_skb() instead of build_skb() to reduce skb allocation
> cost.
> 
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> ---
>  drivers/net/veth.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Here is the summary with links:
  - [net-next] net: veth: rely on napi_build_skb in veth_convert_skb_to_xdp_buff
    https://git.kernel.org/netdev/net-next/c/9d142ed484a3

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index dce9f9d63e04..3ae496011640 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -747,7 +747,7 @@  static int veth_convert_skb_to_xdp_buff(struct veth_rq *rq,
 		if (!page)
 			goto drop;
 
-		nskb = build_skb(page_address(page), PAGE_SIZE);
+		nskb = napi_build_skb(page_address(page), PAGE_SIZE);
 		if (!nskb) {
 			page_pool_put_full_page(rq->page_pool, page, true);
 			goto drop;