From 636896a375ffbc62f0ef6c10d8102854021e3c4d Mon Sep 17 00:00:00 2001 From: KRITHI D SHETTY Date: Thu, 7 Sep 2023 10:47:59 +0530 Subject: [PATCH] net: prefetch skb while dequeuing from backlog list. Change-Id: I01f1fdadd643a8f2850587200b0133c4c5984f26 Signed-off-by: KRITHI D SHETTY --- net/core/dev.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/net/core/dev.c b/net/core/dev.c index ba9313456c85..d25d9f064fc1 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -6108,10 +6108,16 @@ static int process_backlog(struct napi_struct *napi, int quota) napi->weight = READ_ONCE(dev_rx_weight); while (again) { - struct sk_buff *skb; + struct sk_buff *skb, *next_skb; while ((skb = __skb_dequeue(&sd->process_queue))) { rcu_read_lock(); + + next_skb = skb_peek(&sd->process_queue); + if (likely(next_skb)) { + prefetch(next_skb->data); + } + __netif_receive_skb(skb); rcu_read_unlock(); input_queue_head_incr(sd); -- 2.34.1