]> www.infradead.org Git - users/jedix/linux-maple.git/commit
tcp: add tcp_min_snd_mss sysctl
authorEric Dumazet <edumazet@google.com>
Sat, 8 Jun 2019 00:23:41 +0000 (17:23 -0700)
committerJack Vogel <jack.vogel@oracle.com>
Sun, 9 Jun 2019 00:02:41 +0000 (17:02 -0700)
commit4a6fe7d0af4f150dccc9f8c84a93ef023f9575b5
tree90202c3ca65b2b88c053dd85de8a4fa81e68ca97
parent9277dc0626bd6e888025f8b1be013710cb7d63d7
tcp: add tcp_min_snd_mss sysctl

Some TCP peers announce a very small MSS option in their SYN and/or
SYN/ACK messages.

This forces the stack to send packets with a very high network/cpu
overhead.

Linux has enforced a minimal value of 48. Since this value includes
the size of TCP options, and that the options can consume up to 40
bytes, this means that each segment can include only 8 bytes of payload.

In some cases, it can be useful to increase the minimal value
to a saner value.

We still let the default to 48 (TCP_MIN_SND_MSS), for compatibility
reasons.

Note that TCP_MAXSEG socket option enforces a minimal value
of (TCP_MIN_MSS). David Miller increased this minimal value
in commit c39508d6f118 ("tcp: Make TCP_MAXSEG minimum more correct.")
from 64 to 88.

We might in the future merge TCP_MIN_SND_MSS and TCP_MIN_MSS.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Suggested-by: Jonathan Looney <jtl@netflix.com>
Cc: Neal Cardwell <ncardwell@google.com>
Cc: Yuchung Cheng <ycheng@google.com>
Cc: Tyler Hicks <tyhicks@canonical.com>
Cc: Bruce Curtis <brucec@netflix.com>
Orabug: 29884306
Reviewed-by: Joao Martins <joao.m.martins@oracle.com>
Signed-off-by: Rao Shoaib <rao.shoaib@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
[For backport we had to wrap sysctl_tcp_min_snd_mss from struct netns_ipv4
in the __GENKSYMS__ gunk. There is a nice 4 byte hole in it, so we fit it
within that structure. The kernel is the one responsible for creating the
structure so no danger of third-party drivers handing us a shorter structure.

Pahole is OK too:

struct linux_xfrm_mib {
  long unsigned int          mibs[29];             /*     0   232 */
@@ -9096,16 +9096,14 @@
  /* --- cacheline 6 boundary (384 bytes) --- */
  struct ping_group_range    ping_group_range;     /*   384    16 */
  atomic_t                   dev_addr_genid;       /*   400     4 */
-
- /* XXX 4 bytes hole, try to pack */
-
+ int                        sysctl_tcp_min_snd_mss; /*   404     4 */
  long unsigned int *        sysctl_local_reserved_ports; /*   408     8 */
  struct list_head           mr_tables;            /*   416    16 */
  struct fib_rules_ops *     mr_rules_ops;         /*   432     8 */
  atomic_t                   rt_genid;             /*   440     4 */

- /* size: 448, cachelines: 7, members: 50 */
- /* sum members: 390, holes: 5, sum holes: 54 */
+ /* size: 448, cachelines: 7, members: 51 */
+ /* sum members: 394, holes: 4, sum holes: 50 */
  /* padding: 4 */
  /* paddings: 1, sum paddings: 12 */
 };
]
Documentation/networking/ip-sysctl.txt
include/net/netns/ipv4.h
net/ipv4/sysctl_net_ipv4.c
net/ipv4/tcp_ipv4.c
net/ipv4/tcp_output.c