diff options
author | Alexander Duyck <aduyck@mirantis.com> | 2016-04-26 18:29:08 -0600 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-08-26 15:05:01 -0700 |
commit | 90e8c6a0cc9e3bc4b1740bc5a8a91e3887e284dd (patch) | |
tree | a65fdccdab50206e7976e277fb6d0adc20c93fed /net/core/dev.c | |
parent | e97b6a0e0217f7c072fdad6c50673cd7a64348e1 (diff) |
ipv4/GRO: Make GRO conform to RFC 6864
RFC 6864 states that the IPv4 ID field MUST NOT be used for purposes other
than fragmentation and reassembly. Currently we are looking at this field
as a way of identifying what frames can be aggregated and which cannot for
GRO. While this is valid for frames that do not have DF set, it is invalid
to do so if the bit is set.
In addition we were generating IPv4 ID collisions when 2 or more flows were
interleaved over the same tunnel. To prevent that we store the result of
all IP ID checks via a "|=" instead of overwriting previous values.
With this patch we support two different approaches for the IP ID field.
The first is a non-incrementing IP ID with DF bit set. In such a case we
simply won't write to the flush_id field in the GRO context block. The
other option is the legacy option in which the IP ID must increment by 1
for every packet we aggregate.
In the case of the non-incrementing IP ID we will end up losing the data
that the IP ID is fixed. However as per RFC 6864 we should be able to
write any value into the IP ID when the DF bit is set so this should cause
minimal harm.
v2: Updated patch so that we now only support one of two options. Either
the IP ID is fixed with DF bit set, or the IP ID is incrementing. That
allows us to support the fixed ID case as occurs with IPv6 to IPv4
header translation and what is likely already out there for some
devices with tunnel headers.
CRs-Fixed: 1017614
Change-Id: I01065135889697dd8512ced09b8e1939e0fb645b
Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
Patch-mainline: netdev @ April 4, 2016, 4:31 p.m
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
Diffstat (limited to 'net/core/dev.c')
-rw-r--r-- | net/core/dev.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 95b832edc303..ffd178b5f381 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -4142,6 +4142,7 @@ static void gro_list_prepare(struct napi_struct *napi, struct sk_buff *skb) unsigned long diffs; NAPI_GRO_CB(p)->flush = 0; + NAPI_GRO_CB(p)->flush_id = 0; if (hash != skb_get_hash_raw(p)) { NAPI_GRO_CB(p)->same_flow = 0; |