[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YzQD35IZUA3LUJZX@oden.dyn.berto.se>
Date: Wed, 28 Sep 2022 10:20:47 +0200
From: Niklas Söderlund
<niklas.soderlund@...igine.com>
To: Shang XiaoJing <shangxiaojing@...wei.com>
Cc: simon.horman@...igine.com, kuba@...nel.org, davem@...emloft.net,
edumazet@...gle.com, pabeni@...hat.com, ast@...nel.org,
daniel@...earbox.net, hawk@...nel.org, john.fastabend@...il.com,
oss-drivers@...igine.com, netdev@...r.kernel.org
Subject: Re: [PATCH -next v2] nfp: Use skb_put_data() instead of
skb_put/memcpy pair
Hi Shang,
Thanks for your work.
On 2022-09-27 22:18:35 +0800, Shang XiaoJing wrote:
> Use skb_put_data() instead of skb_put() and memcpy(), which is clear.
>
> Signed-off-by: Shang XiaoJing <shangxiaojing@...wei.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@...igine.com>
> ---
> changes in v2:
> - no change
> ---
> drivers/net/ethernet/netronome/nfp/nfd3/xsk.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/netronome/nfp/nfd3/xsk.c b/drivers/net/ethernet/netronome/nfp/nfd3/xsk.c
> index 65e243168765..5d9db8c2a5b4 100644
> --- a/drivers/net/ethernet/netronome/nfp/nfd3/xsk.c
> +++ b/drivers/net/ethernet/netronome/nfp/nfd3/xsk.c
> @@ -84,7 +84,7 @@ static void nfp_nfd3_xsk_rx_skb(struct nfp_net_rx_ring *rx_ring,
> nfp_net_xsk_rx_drop(r_vec, xrxbuf);
> return;
> }
> - memcpy(skb_put(skb, pkt_len), xrxbuf->xdp->data, pkt_len);
> + skb_put_data(skb, xrxbuf->xdp->data, pkt_len);
>
> skb->mark = meta->mark;
> skb_set_hash(skb, meta->hash, meta->hash_type);
> --
> 2.17.1
>
--
Kind Regards,
Niklas Söderlund
Powered by blists - more mailing lists