[openwrt/openwrt] bmips: use netdev_alloc_skb() for copybreak

LEDE Commits lede-commits at lists.infradead.org
Sat Mar 4 10:29:53 PST 2023


noltari pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/7178adadcca8216a651e10e1fefbd7ebec930c1b

commit 7178adadcca8216a651e10e1fefbd7ebec930c1b
Author: Sieng Piaw Liew <liew.s.piaw at gmail.com>
AuthorDate: Wed Jun 22 13:22:17 2022 +0800

    bmips: use netdev_alloc_skb() for copybreak
    
    bmips is using Broadcom B53 DSA driver which means the ethernet driver
    must compensate for 6 bytes tags from the internal switch.
    This means using NET_IP_ALIGN actually misaligns the skb, lowering
    performance significantly. Therefore napi_alloc_skb() which uses
    NET_IP_ALIGN is changed to netdev_alloc_skb().
    Performance in iperf3 is increased from ~47Mbps to 52Mbps.
    
    Signed-off-by: Sieng Piaw Liew <liew.s.piaw at gmail.com>
---
 target/linux/bmips/files/drivers/net/ethernet/broadcom/bcm6368-enetsw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/linux/bmips/files/drivers/net/ethernet/broadcom/bcm6368-enetsw.c b/target/linux/bmips/files/drivers/net/ethernet/broadcom/bcm6368-enetsw.c
index d9ecba5188..7ddbf8a10a 100644
--- a/target/linux/bmips/files/drivers/net/ethernet/broadcom/bcm6368-enetsw.c
+++ b/target/linux/bmips/files/drivers/net/ethernet/broadcom/bcm6368-enetsw.c
@@ -374,7 +374,7 @@ static int bcm6368_enetsw_receive_queue(struct net_device *dev, int budget)
 		if (len < priv->copybreak) {
 			struct sk_buff *nskb;
 
-			nskb = napi_alloc_skb(&priv->napi, len);
+			nskb = netdev_alloc_skb(dev, len);
 			if (!nskb) {
 				/* forget packet, just rearm desc */
 				dev->stats.rx_dropped++;




More information about the lede-commits mailing list