diff mbox series

[net-next,v2,1/2] net: renesas: rswitch: Use napi_gro_receive() in RX

Message ID 20230606085558.1708766-2-yoshihiro.shimoda.uh@renesas.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series net: renesas: rswitch: Improve perfromance of TX/RX | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
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 8 of 8 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

Yoshihiro Shimoda June 6, 2023, 8:55 a.m. UTC
This hardware can receive multiple frames so that using
napi_gro_receive() instead of netif_receive_skb() gets good
performance of RX.

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
---
 drivers/net/ethernet/renesas/rswitch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Fijalkowski, Maciej June 6, 2023, 5:50 p.m. UTC | #1
On Tue, Jun 06, 2023 at 05:55:57PM +0900, Yoshihiro Shimoda wrote:
> This hardware can receive multiple frames so that using
> napi_gro_receive() instead of netif_receive_skb() gets good
> performance of RX.
> 
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>

Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>

> ---
>  drivers/net/ethernet/renesas/rswitch.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/renesas/rswitch.c b/drivers/net/ethernet/renesas/rswitch.c
> index aace87139cea..7bb0a6d594a0 100644
> --- a/drivers/net/ethernet/renesas/rswitch.c
> +++ b/drivers/net/ethernet/renesas/rswitch.c
> @@ -729,7 +729,7 @@ static bool rswitch_rx(struct net_device *ndev, int *quota)
>  		}
>  		skb_put(skb, pkt_len);
>  		skb->protocol = eth_type_trans(skb, ndev);
> -		netif_receive_skb(skb);
> +		napi_gro_receive(&rdev->napi, skb);

Some other optmization which you could do later on is to improve
rswitch_next_queue_index() as it is used on a per packet basis.

>  		rdev->ndev->stats.rx_packets++;
>  		rdev->ndev->stats.rx_bytes += pkt_len;
>  
> -- 
> 2.25.1
> 
>
Yoshihiro Shimoda June 7, 2023, 1 a.m. UTC | #2
Hello Maciej,

> From: Maciej Fijalkowski, Sent: Wednesday, June 7, 2023 2:51 AM
> 
> On Tue, Jun 06, 2023 at 05:55:57PM +0900, Yoshihiro Shimoda wrote:
> > This hardware can receive multiple frames so that using
> > napi_gro_receive() instead of netif_receive_skb() gets good
> > performance of RX.
> >
> > Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> 
> Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>

Thank you for your review!

> > ---
> >  drivers/net/ethernet/renesas/rswitch.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/ethernet/renesas/rswitch.c b/drivers/net/ethernet/renesas/rswitch.c
> > index aace87139cea..7bb0a6d594a0 100644
> > --- a/drivers/net/ethernet/renesas/rswitch.c
> > +++ b/drivers/net/ethernet/renesas/rswitch.c
> > @@ -729,7 +729,7 @@ static bool rswitch_rx(struct net_device *ndev, int *quota)
> >  		}
> >  		skb_put(skb, pkt_len);
> >  		skb->protocol = eth_type_trans(skb, ndev);
> > -		netif_receive_skb(skb);
> > +		napi_gro_receive(&rdev->napi, skb);
> 
> Some other optmization which you could do later on is to improve
> rswitch_next_queue_index() as it is used on a per packet basis.

Thank you for your suggestion! I'll try this later.

Best regards,
Yoshihiro Shimoda

> >  		rdev->ndev->stats.rx_packets++;
> >  		rdev->ndev->stats.rx_bytes += pkt_len;
> >
> > --
> > 2.25.1
> >
> >
diff mbox series

Patch

diff --git a/drivers/net/ethernet/renesas/rswitch.c b/drivers/net/ethernet/renesas/rswitch.c
index aace87139cea..7bb0a6d594a0 100644
--- a/drivers/net/ethernet/renesas/rswitch.c
+++ b/drivers/net/ethernet/renesas/rswitch.c
@@ -729,7 +729,7 @@  static bool rswitch_rx(struct net_device *ndev, int *quota)
 		}
 		skb_put(skb, pkt_len);
 		skb->protocol = eth_type_trans(skb, ndev);
-		netif_receive_skb(skb);
+		napi_gro_receive(&rdev->napi, skb);
 		rdev->ndev->stats.rx_packets++;
 		rdev->ndev->stats.rx_bytes += pkt_len;