diff mbox series

[net-next] net: axienet: Use napi_alloc_skb when refilling RX ring

Message ID 20220308211013.1530955-1-robert.hancock@calian.com (mailing list archive)
State Accepted
Commit 6c7e7da2e0f2141cdc491cd5b9d0b937c08939c9
Delegated to: Netdev Maintainers
Headers show
Series [net-next] net: axienet: Use napi_alloc_skb when refilling RX ring | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 2 this patch: 2
netdev/cc_maintainers success CCed 6 of 6 maintainers
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 2 this patch: 2
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

Robert Hancock March 8, 2022, 9:10 p.m. UTC
Use napi_alloc_skb to allocate memory when refilling the RX ring in
axienet_poll for more efficiency.

Signed-off-by: Robert Hancock <robert.hancock@calian.com>
---
 drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Radhey Shyam Pandey March 9, 2022, 8:17 a.m. UTC | #1
> -----Original Message-----
> From: Robert Hancock <robert.hancock@calian.com>
> Sent: Wednesday, March 9, 2022 2:40 AM
> To: netdev@vger.kernel.org
> Cc: Radhey Shyam Pandey <radheys@xilinx.com>; davem@davemloft.net;
> kuba@kernel.org; Michal Simek <michals@xilinx.com>; linux-arm-
> kernel@lists.infradead.org; jwiedmann.dev@gmail.com; Robert Hancock
> <robert.hancock@calian.com>
> Subject: [PATCH net-next] net: axienet: Use napi_alloc_skb when refilling RX
> ring
> 
> Use napi_alloc_skb to allocate memory when refilling the RX ring in
> axienet_poll for more efficiency.

Minor nit - Good to add some details on "more efficiency" (assume it's perf?)

> 
> Signed-off-by: Robert Hancock <robert.hancock@calian.com>
> ---
>  drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> index a51a8228e1b7..1da90ec553c5 100644
> --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> @@ -965,7 +965,7 @@ static int axienet_poll(struct napi_struct *napi, int
> budget)
>  			packets++;
>  		}
> 
> -		new_skb = netdev_alloc_skb_ip_align(lp->ndev, lp-
> >max_frm_size);
> +		new_skb = napi_alloc_skb(napi, lp->max_frm_size);
>  		if (!new_skb)
>  			break;
> 
> --
> 2.31.1
Robert Hancock March 9, 2022, 5:37 p.m. UTC | #2
On Wed, 2022-03-09 at 08:17 +0000, Radhey Shyam Pandey wrote:
> > -----Original Message-----
> > From: Robert Hancock <robert.hancock@calian.com>
> > Sent: Wednesday, March 9, 2022 2:40 AM
> > To: netdev@vger.kernel.org
> > Cc: Radhey Shyam Pandey <radheys@xilinx.com>; davem@davemloft.net;
> > kuba@kernel.org; Michal Simek <michals@xilinx.com>; linux-arm-
> > kernel@lists.infradead.org; jwiedmann.dev@gmail.com; Robert Hancock
> > <robert.hancock@calian.com>
> > Subject: [PATCH net-next] net: axienet: Use napi_alloc_skb when refilling
> > RX
> > ring
> > 
> > Use napi_alloc_skb to allocate memory when refilling the RX ring in
> > axienet_poll for more efficiency.
> 
> Minor nit - Good to add some details on "more efficiency" (assume it's perf?)

Yes, it's as described in the comments for napi_alloc_skb:

 *      Allocate a new sk_buff for use in NAPI receive.  This buffer will
 *      attempt to allocate the head from a special reserved region used
 *      only for NAPI Rx allocation.  By doing this we can save several
 *      CPU cycles by avoiding having to disable and re-enable IRQs.

I guess this could be mentioned in the commit description if desired?

> 
> > Signed-off-by: Robert Hancock <robert.hancock@calian.com>
> > ---
> >  drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> > b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> > index a51a8228e1b7..1da90ec553c5 100644
> > --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> > +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> > @@ -965,7 +965,7 @@ static int axienet_poll(struct napi_struct *napi, int
> > budget)
> >  			packets++;
> >  		}
> > 
> > -		new_skb = netdev_alloc_skb_ip_align(lp->ndev, lp-
> > > max_frm_size);
> > +		new_skb = napi_alloc_skb(napi, lp->max_frm_size);
> >  		if (!new_skb)
> >  			break;
> > 
> > --
> > 2.31.1
patchwork-bot+netdevbpf@kernel.org March 10, 2022, 5 a.m. UTC | #3
Hello:

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

On Tue,  8 Mar 2022 15:10:13 -0600 you wrote:
> Use napi_alloc_skb to allocate memory when refilling the RX ring in
> axienet_poll for more efficiency.
> 
> Signed-off-by: Robert Hancock <robert.hancock@calian.com>
> ---
>  drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Here is the summary with links:
  - [net-next] net: axienet: Use napi_alloc_skb when refilling RX ring
    https://git.kernel.org/netdev/net-next/c/6c7e7da2e0f2

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
index a51a8228e1b7..1da90ec553c5 100644
--- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
+++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
@@ -965,7 +965,7 @@  static int axienet_poll(struct napi_struct *napi, int budget)
 			packets++;
 		}
 
-		new_skb = netdev_alloc_skb_ip_align(lp->ndev, lp->max_frm_size);
+		new_skb = napi_alloc_skb(napi, lp->max_frm_size);
 		if (!new_skb)
 			break;