]> git.baikalelectronics.ru Git - kernel.git/commit
tcp: minimize false-positives on TCP/GRO check
authorMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Sat, 1 Apr 2017 14:00:21 +0000 (11:00 -0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 4 Apr 2017 01:43:41 +0000 (18:43 -0700)
commit179dcf048d25726ab56def1591f96b600b1da19c
tree4f7d58201c04e2aba14a1c3e2d529a826808fde7
parent8a0d8b9f99f5eeece22a07b28ac6088734c7b23d
tcp: minimize false-positives on TCP/GRO check

Markus Trippelsdorf reported that after commit 178ea94f74f0 ("tcp: warn
on bogus MSS and try to amend it") the kernel started logging the
warning for a NIC driver that doesn't even support GRO.

It was diagnosed that it was possibly caused on connections that were
using TCP Timestamps but some packets lacked the Timestamps option. As
we reduce rcv_mss when timestamps are used, the lack of them would cause
the packets to be bigger than expected, although this is a valid case.

As this warning is more as a hint, getting a clean-cut on the
threshold is probably not worth the execution time spent on it. This
patch thus alleviates the false-positives with 2 quick checks: by
accounting for the entire TCP option space and also checking against the
interface MTU if it's available.

These changes, specially the MTU one, might mask some real positives,
though if they are really happening, it's possible that sooner or later
it will be triggered anyway.

Reported-by: Markus Trippelsdorf <markus@trippelsdorf.de>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_input.c