Skip to content

Commit 9bacd25

Browse files
edumazetdavem330
authored andcommitted
tcp: cache line align MAX_TCP_HEADER
TCP stack is dumb in how it cooks its output packets. Depending on MAX_HEADER value, we might chose a bad ending point for the headers. If we align the end of TCP headers to cache line boundary, we make sure to always use the smallest number of cache lines, which always help. Signed-off-by: Eric Dumazet <[email protected]> Cc: Soheil Hassas Yeganeh <[email protected]> Acked-by: Soheil Hassas Yeganeh <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 56e639e commit 9bacd25

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/net/tcp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ extern struct inet_hashinfo tcp_hashinfo;
5151
extern struct percpu_counter tcp_orphan_count;
5252
void tcp_time_wait(struct sock *sk, int state, int timeo);
5353

54-
#define MAX_TCP_HEADER (128 + MAX_HEADER)
54+
#define MAX_TCP_HEADER L1_CACHE_ALIGN(128 + MAX_HEADER)
5555
#define MAX_TCP_OPTION_SPACE 40
5656
#define TCP_MIN_SND_MSS 48
5757
#define TCP_MIN_GSO_SIZE (TCP_MIN_SND_MSS - MAX_TCP_OPTION_SPACE)

0 commit comments

Comments
 (0)