* [RFC PATCH] lro: ip fragment checking
@ 2008-11-24 15:56 Jan-Bernd Themann
2008-11-24 16:51 ` Ben Hutchings
0 siblings, 1 reply; 3+ messages in thread
From: Jan-Bernd Themann @ 2008-11-24 15:56 UTC (permalink / raw)
To: netdev; +Cc: linux-kernel, tklein, Christoph Raisch, jb.billaud, hering2
Currently there is no checking in the LRO receive path whether
TCP packets are ip fragmented. We should not consider
those packets for aggregation.
I'm not sure if this checking is actually required. Does anyone
know if it is possible to get fragmented TCP packets without
the tcp stack changing the MSS size?
This patch introduces explicit checking. Any objections?
Regards,
Jan-Bernd
---
net/ipv4/inet_lro.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/net/ipv4/inet_lro.c b/net/ipv4/inet_lro.c
index cfd034a..1f9159d 100644
--- a/net/ipv4/inet_lro.c
+++ b/net/ipv4/inet_lro.c
@@ -64,6 +64,9 @@ static int lro_tcp_ip_check(struct iphdr *iph, struct tcphdr *tcph,
if (iph->ihl != IPH_LEN_WO_OPTIONS)
return -1;
+ if (iph->frag_off & IP_MF)
+ return -1;
+
if (tcph->cwr || tcph->ece || tcph->urg || !tcph->ack
|| tcph->rst || tcph->syn || tcph->fin)
return -1;
--
1.5.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [RFC PATCH] lro: ip fragment checking
2008-11-24 15:56 [RFC PATCH] lro: ip fragment checking Jan-Bernd Themann
@ 2008-11-24 16:51 ` Ben Hutchings
2008-11-24 21:04 ` Brandeburg, Jesse
0 siblings, 1 reply; 3+ messages in thread
From: Ben Hutchings @ 2008-11-24 16:51 UTC (permalink / raw)
To: Jan-Bernd Themann
Cc: netdev, linux-kernel, tklein, Christoph Raisch, jb.billaud,
hering2
On Mon, 2008-11-24 at 16:56 +0100, Jan-Bernd Themann wrote:
> Currently there is no checking in the LRO receive path whether
> TCP packets are ip fragmented. We should not consider
> those packets for aggregation.
> I'm not sure if this checking is actually required. Does anyone
> know if it is possible to get fragmented TCP packets without
> the tcp stack changing the MSS size?
> This patch introduces explicit checking. Any objections?
LRO depends on the hardware performing TCP checksum offload, and the TCP
checksum cannot be verified for IP fragments in isolation. So I think
drivers should not be passing fragments into inet_lro or should reject
them in its get_frag_header() or get_skb_header() method. Certainly sfc
doesn't pass fragments into inet_lro because they have not been
checksummed.
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [RFC PATCH] lro: ip fragment checking
2008-11-24 16:51 ` Ben Hutchings
@ 2008-11-24 21:04 ` Brandeburg, Jesse
0 siblings, 0 replies; 3+ messages in thread
From: Brandeburg, Jesse @ 2008-11-24 21:04 UTC (permalink / raw)
To: Ben Hutchings, Jan-Bernd Themann
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
tklein@de.ibm.com, Christoph Raisch, jb.billaud@gmail.com,
hering2@de.ibm.com
Ben Hutchings wrote:
> On Mon, 2008-11-24 at 16:56 +0100, Jan-Bernd Themann wrote:
>> Currently there is no checking in the LRO receive path whether
>> TCP packets are ip fragmented. We should not consider
>> those packets for aggregation.
>> I'm not sure if this checking is actually required. Does anyone
>> know if it is possible to get fragmented TCP packets without
>> the tcp stack changing the MSS size?
>> This patch introduces explicit checking. Any objections?
>
> LRO depends on the hardware performing TCP checksum offload, and the
> TCP checksum cannot be verified for IP fragments in isolation. So I
> think drivers should not be passing fragments into inet_lro or should
> reject them in its get_frag_header() or get_skb_header() method.
> Certainly sfc doesn't pass fragments into inet_lro because they have
> not been checksummed.
The fragments, definitely will not have checksums offloaded, but
what about the first packet in the chain? I haven't verified in
ixgbe or igb whether or not it could try and aggregate a packet
with MF set if it was the first fragment in a series of IP fragments.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-11-24 21:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-24 15:56 [RFC PATCH] lro: ip fragment checking Jan-Bernd Themann
2008-11-24 16:51 ` Ben Hutchings
2008-11-24 21:04 ` Brandeburg, Jesse
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).