lkml.org 
[lkml]   [2021]   [Oct]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH net] net: gro: flush the real oldest skb
Date
From: Jason Xing <xingwanli@kuaishou.com>

Prior to this patch, when the count of skbs of one flow is larger than
MAX_GRO_SKBS, gro_flush_oldest() flushes the tail of the list. However,
as we can see in the merge part of skb_gro_receive(), the tail of the
list is the newest, head oldest.

Here, we need to fetch the real oldest one and then process it to lower
the latency.

Fix: 07d78363dc ("net: Convert NAPI gro list into a small hash table.")
Signed-off-by: Jason Xing <xingwanli@kuaishou.com>
---
net/core/dev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index 7ee9fec..d52ebdb 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -6012,7 +6012,7 @@ static void gro_flush_oldest(struct napi_struct *napi, struct list_head *head)
{
struct sk_buff *oldest;

- oldest = list_last_entry(head, struct sk_buff, list);
+ oldest = list_first_entry(head, struct sk_buff, list);

/* We are called with head length >= MAX_GRO_SKBS, so this is
* impossible.
--
1.8.3.1
\
 
 \ /
  Last update: 2021-10-27 10:50    [W:0.592 / U:0.264 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site