bmips: batch process rx path

Use netif_receive_skb_list() to batch process rx skb. This improves
cache efficiency.

Signed-off-by: Sieng Piaw Liew <liew.s.piaw@gmail.com>
This commit is contained in:
Sieng Piaw Liew 2022-06-29 16:11:38 +08:00 committed by Álvaro Fernández Rojas
parent 6276dad6ca
commit 686050b2b2

View File

@ -334,8 +334,11 @@ static int bcm6368_enetsw_receive_queue(struct net_device *dev, int budget)
{ {
struct bcm6368_enetsw *priv = netdev_priv(dev); struct bcm6368_enetsw *priv = netdev_priv(dev);
struct device *kdev = &priv->pdev->dev; struct device *kdev = &priv->pdev->dev;
struct list_head rx_list;
int processed = 0; int processed = 0;
INIT_LIST_HEAD(&rx_list);
/* don't scan ring further than number of refilled /* don't scan ring further than number of refilled
* descriptor */ * descriptor */
if (budget > priv->rx_desc_count) if (budget > priv->rx_desc_count)
@ -418,9 +421,10 @@ static int bcm6368_enetsw_receive_queue(struct net_device *dev, int budget)
skb->protocol = eth_type_trans(skb, dev); skb->protocol = eth_type_trans(skb, dev);
dev->stats.rx_packets++; dev->stats.rx_packets++;
dev->stats.rx_bytes += len; dev->stats.rx_bytes += len;
netif_receive_skb(skb); list_add_tail(&skb->list, &rx_list);
} while (processed < budget); } while (processed < budget);
netif_receive_skb_list(&rx_list);
priv->rx_desc_count -= processed; priv->rx_desc_count -= processed;
if (processed || !priv->rx_desc_count) { if (processed || !priv->rx_desc_count) {