bmips: use netdev_alloc_skb() for copybreak
authorSieng Piaw Liew <liew.s.piaw@gmail.com>
Wed, 22 Jun 2022 05:22:17 +0000 (13:22 +0800)
committerÁlvaro Fernández Rojas <noltari@gmail.com>
Sat, 4 Mar 2023 18:28:16 +0000 (19:28 +0100)
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@gmail.com>
target/linux/bmips/files/drivers/net/ethernet/broadcom/bcm6368-enetsw.c

index d9ecba518862f2190ddd322ffb3921cf9259fc9f..7ddbf8a10afc34538617ee3cb246b71fb9ba0b7a 100644 (file)
@@ -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++;