diff mbox series

[net] net: gro: flush the real oldest skb

Message ID 20211027084944.4508-1-kerneljasonxing@gmail.com (mailing list archive)
State Rejected
Delegated to: Netdev Maintainers
Headers show
Series [net] net: gro: flush the real oldest skb | expand

Checks

Context Check Description
netdev/cover_letter success Single patches do not need cover letters
netdev/fixes_present fail Series targets non-next tree, but doesn't contain any Fixes tags
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net
netdev/subject_prefix success Link
netdev/cc_maintainers success CCed 19 of 19 maintainers
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 6 this patch: 6
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success No Fixes tag
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 6 this patch: 6
netdev/header_inline success No static functions without inline keyword in header files

Commit Message

Jason Xing Oct. 27, 2021, 8:49 a.m. UTC
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(-)

Comments

Jason Xing Oct. 27, 2021, 1:59 p.m. UTC | #1
This patch has some problems. I got wrong with the @skb->list. Please ignore it.

Thanks,
Jason

On Wed, Oct 27, 2021 at 4:50 PM <kerneljasonxing@gmail.com> wrote:
>
> 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
>
diff mbox series

Patch

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.