aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp.c
diff options
context:
space:
mode:
authorHans Westgaard Ry <hans.westgaard.ry@oracle.com>2016-02-03 03:26:57 -0500
committerDavid S. Miller <davem@davemloft.net>2016-02-09 04:28:06 -0500
commit5f74f82ea34c0da80ea0b49192bb5ea06e063593 (patch)
treed0c5e30a637a99cb780e47193167c3a8aa655659 /net/ipv4/tcp.c
parent9cf7490360bf2c46a16b7525f899e4970c5fc144 (diff)
net:Add sysctl_max_skb_frags
Devices may have limits on the number of fragments in an skb they support. Current codebase uses a constant as maximum for number of fragments one skb can hold and use. When enabling scatter/gather and running traffic with many small messages the codebase uses the maximum number of fragments and may thereby violate the max for certain devices. The patch introduces a global variable as max number of fragments. Signed-off-by: Hans Westgaard Ry <hans.westgaard.ry@oracle.com> Reviewed-by: HÃ¥kon Bugge <haakon.bugge@oracle.com> Acked-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp.c')
-rw-r--r--net/ipv4/tcp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 19746b3fcbbe..0c36ef4a3f86 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -940,7 +940,7 @@ new_segment:
940 940
941 i = skb_shinfo(skb)->nr_frags; 941 i = skb_shinfo(skb)->nr_frags;
942 can_coalesce = skb_can_coalesce(skb, i, page, offset); 942 can_coalesce = skb_can_coalesce(skb, i, page, offset);
943 if (!can_coalesce && i >= MAX_SKB_FRAGS) { 943 if (!can_coalesce && i >= sysctl_max_skb_frags) {
944 tcp_mark_push(tp, skb); 944 tcp_mark_push(tp, skb);
945 goto new_segment; 945 goto new_segment;
946 } 946 }
@@ -1213,7 +1213,7 @@ new_segment:
1213 1213
1214 if (!skb_can_coalesce(skb, i, pfrag->page, 1214 if (!skb_can_coalesce(skb, i, pfrag->page,
1215 pfrag->offset)) { 1215 pfrag->offset)) {
1216 if (i == MAX_SKB_FRAGS || !sg) { 1216 if (i == sysctl_max_skb_frags || !sg) {
1217 tcp_mark_push(tp, skb); 1217 tcp_mark_push(tp, skb);
1218 goto new_segment; 1218 goto new_segment;
1219 } 1219 }