Patch "net: don't keep lonely packets forever in the gro hash" has been added to the 4.14-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    net: don't keep lonely packets forever in the gro hash

to the 4.14-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     net-don-t-keep-lonely-packets-forever-in-the-gro-has.patch
and it can be found in the queue-4.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 8ab29ebcaeacb849fef8b2fc4ac9b048af1e6cfc
Author: Paolo Abeni <pabeni@xxxxxxxxxx>
Date:   Wed Nov 21 18:21:35 2018 +0100

    net: don't keep lonely packets forever in the gro hash
    
    [ Upstream commit 605108acfe6233b72e2f803aa1cb59a2af3001ca ]
    
    Eric noted that with UDP GRO and NAPI timeout, we could keep a single
    UDP packet inside the GRO hash forever, if the related NAPI instance
    calls napi_gro_complete() at an higher frequency than the NAPI timeout.
    Willem noted that even TCP packets could be trapped there, till the
    next retransmission.
    This patch tries to address the issue, flushing the old packets -
    those with a NAPI_GRO_CB age before the current jiffy - before scheduling
    the NAPI timeout. The rationale is that such a timeout should be
    well below a jiffy and we are not flushing packets eligible for sane GRO.
    
    v1  -> v2:
     - clarified the commit message and comment
    
    RFC -> v1:
     - added 'Fixes tags', cleaned-up the wording.
    
    Reported-by: Eric Dumazet <eric.dumazet@xxxxxxxxx>
    Fixes: 3b47d30396ba ("net: gro: add a per device gro flush timer")
    Signed-off-by: Paolo Abeni <pabeni@xxxxxxxxxx>
    Acked-by: Willem de Bruijn <willemb@xxxxxxxxxx>
    Acked-by: Eric Dumazet <edumazet@xxxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <alexander.levin@xxxxxxxxxxxxx>

diff --git a/net/core/dev.c b/net/core/dev.c
index 93a1b07990b8d..90ec30d5b8514 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -5308,11 +5308,14 @@ bool napi_complete_done(struct napi_struct *n, int work_done)
 		if (work_done)
 			timeout = n->dev->gro_flush_timeout;
 
+		/* When the NAPI instance uses a timeout and keeps postponing
+		 * it, we need to bound somehow the time packets are kept in
+		 * the GRO layer
+		 */
+		napi_gro_flush(n, !!timeout);
 		if (timeout)
 			hrtimer_start(&n->timer, ns_to_ktime(timeout),
 				      HRTIMER_MODE_REL_PINNED);
-		else
-			napi_gro_flush(n, false);
 	}
 	if (unlikely(!list_empty(&n->poll_list))) {
 		/* If n->poll_list is not empty, we need to mask irqs */



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux