lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d8de399a-c063-4078-b0f9-068747f27183@intel.com>
Date: Wed, 25 Oct 2023 10:47:05 +0200
From: Wojciech Drewek <wojciech.drewek@...el.com>
To: Louis Peens <louis.peens@...igine.com>, David Miller
	<davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni
	<pabeni@...hat.com>
CC: Fei Qin <fei.qin@...igine.com>, <netdev@...r.kernel.org>,
	<oss-drivers@...igine.com>
Subject: Re: [PATCH net-next] nfp: using napi_build_skb() to replace
 build_skb()



On 25.10.2023 09:41, Louis Peens wrote:
> From: Fei Qin <fei.qin@...igine.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@...igine.com>
> Signed-off-by: Louis Peens <louis.peens@...igine.com>
> ---
>  drivers/net/ethernet/netronome/nfp/nfd3/dp.c | 4 ++--
>  drivers/net/ethernet/netronome/nfp/nfdk/dp.c | 4 ++--
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ethernet/netronome/nfp/nfd3/dp.c b/drivers/net/ethernet/netronome/nfp/nfd3/dp.c
> index 0cc026b0aefd..68bdeede6472 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;
> @@ -1363,7 +1363,7 @@ nfp_ctrl_rx_one(struct nfp_net *nn, struct nfp_net_dp *dp,

Hi Louis,
I'm not an expert regarding NAPI but I think napi_build_skb should be used in napi context.
>From what I see nfp_ctrl_rx_one is used after calling nfp_nfdk_ctrl_poll which is scheduled
using tasklet_setup, not using napi_schedule.
Am I right?

>  		return true;
>  	}
>  
> -	skb = build_skb(rxbuf->frag, dp->fl_bufsz);
> +	skb = napi_build_skb(rxbuf->frag, dp->fl_bufsz);
>  	if (unlikely(!skb)) {
>  		nfp_nfd3_rx_drop(dp, r_vec, rx_ring, rxbuf, NULL);
>  		return true;
> diff --git a/drivers/net/ethernet/netronome/nfp/nfdk/dp.c b/drivers/net/ethernet/netronome/nfp/nfdk/dp.c
> index 33b6d74adb4b..e68888d1a5c2 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;
> @@ -1525,7 +1525,7 @@ nfp_ctrl_rx_one(struct nfp_net *nn, struct nfp_net_dp *dp,
>  		return true;
>  	}
>  
> -	skb = build_skb(rxbuf->frag, dp->fl_bufsz);
> +	skb = napi_build_skb(rxbuf->frag, dp->fl_bufsz);
>  	if (unlikely(!skb)) {
>  		nfp_nfdk_rx_drop(dp, r_vec, rx_ring, rxbuf, NULL);
>  		return true;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ