netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 net-next] inet: fix a UFO regression
  2013-11-08  0:44               ` [PATCH net-next] inet: fix a UFO regression Eric Dumazet
@ 2013-11-08  2:32                 ` Eric Dumazet
  2013-11-08  7:08                   ` David Miller
  0 siblings, 1 reply; 8+ messages in thread
From: Eric Dumazet @ 2013-11-08  2:32 UTC (permalink / raw)
  To: Alexei Starovoitov; +Cc: David Miller, netdev, Hannes Frederic Sowa

From: Eric Dumazet <edumazet@google.com>

While testing virtio_net and skb_segment() changes, Hannes reported
that UFO was sending wrong frames.

It appears this was introduced by a recent commit :
8c3a897bfab1 ("inet: restore gso for vxlan")

The old condition to perform IP frag was :

tunnel = !!skb->encapsulation;
...
        if (!tunnel && proto == IPPROTO_UDP) {

So the new one should be :

udpfrag = !skb->encapsulation && proto == IPPROTO_UDP;
...
        if (udpfrag) {

Initialization of udpfrag must be done before call
to ops->callbacks.gso_segment(skb, features), as
skb_udp_tunnel_segment() clears skb->encapsulation

(We want udpfrag to be true for UFO, false for VXLAN)

With help from Alexei Starovoitov

Reported-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Alexei Starovoitov <ast@plumgrid.com>
---
v2: move the udpfrag init, as spotted by Alexei.

 net/ipv4/af_inet.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index 09d78d4a3cff..68af9aac91d0 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -1299,6 +1299,9 @@ static struct sk_buff *inet_gso_segment(struct sk_buff *skb,
 
 	segs = ERR_PTR(-EPROTONOSUPPORT);
 
+	/* Note : following gso_segment() might change skb->encapsulation */
+	udpfrag = !skb->encapsulation && proto == IPPROTO_UDP;
+
 	ops = rcu_dereference(inet_offloads[proto]);
 	if (likely(ops && ops->callbacks.gso_segment))
 		segs = ops->callbacks.gso_segment(skb, features);
@@ -1306,7 +1309,6 @@ static struct sk_buff *inet_gso_segment(struct sk_buff *skb,
 	if (IS_ERR_OR_NULL(segs))
 		goto out;
 
-	udpfrag = !!skb->encapsulation && proto == IPPROTO_UDP;
 	skb = segs;
 	do {
 		iph = (struct iphdr *)(skb_mac_header(skb) + nhoff);

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 net-next] inet: fix a UFO regression
@ 2013-11-08  5:44 Alexei Starovoitov
  2013-11-08  5:50 ` Eric Dumazet
  2013-11-08  6:41 ` Sridhar Samudrala
  0 siblings, 2 replies; 8+ messages in thread
From: Alexei Starovoitov @ 2013-11-08  5:44 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: David Miller, netdev, Hannes Frederic Sowa

On Thu, Nov 7, 2013 at 6:32 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> From: Eric Dumazet <edumazet@google.com>
>
> While testing virtio_net and skb_segment() changes, Hannes reported
> that UFO was sending wrong frames.
>
> It appears this was introduced by a recent commit :
> 8c3a897bfab1 ("inet: restore gso for vxlan")
>
> The old condition to perform IP frag was :
>
> tunnel = !!skb->encapsulation;
> ...
>         if (!tunnel && proto == IPPROTO_UDP) {
>
> So the new one should be :
>
> udpfrag = !skb->encapsulation && proto == IPPROTO_UDP;
> ...
>         if (udpfrag) {
>
> Initialization of udpfrag must be done before call
> to ops->callbacks.gso_segment(skb, features), as
> skb_udp_tunnel_segment() clears skb->encapsulation
>
> (We want udpfrag to be true for UFO, false for VXLAN)
>
> With help from Alexei Starovoitov
>
> Reported-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Alexei Starovoitov <ast@plumgrid.com>
> ---

vxlan looks good through namespaces with and without gso
and between physical machines via 10G nics

Tested-by: Alexei Starovoitov <ast@plumgrid.com>

Thanks Eric!

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 net-next] inet: fix a UFO regression
  2013-11-08  5:44 [PATCH v2 net-next] inet: fix a UFO regression Alexei Starovoitov
@ 2013-11-08  5:50 ` Eric Dumazet
  2013-11-08  6:41 ` Sridhar Samudrala
  1 sibling, 0 replies; 8+ messages in thread
From: Eric Dumazet @ 2013-11-08  5:50 UTC (permalink / raw)
  To: Alexei Starovoitov; +Cc: David Miller, netdev, Hannes Frederic Sowa

On Thu, 2013-11-07 at 21:44 -0800, Alexei Starovoitov wrote:

> vxlan looks good through namespaces with and without gso
> and between physical machines via 10G nics
> 
> Tested-by: Alexei Starovoitov <ast@plumgrid.com>
> 
> Thanks Eric!

And I tested the UFO part as well.

Thanks Alexei !

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 net-next] inet: fix a UFO regression
  2013-11-08  5:44 [PATCH v2 net-next] inet: fix a UFO regression Alexei Starovoitov
  2013-11-08  5:50 ` Eric Dumazet
@ 2013-11-08  6:41 ` Sridhar Samudrala
  2013-11-08 12:18   ` Eric Dumazet
  1 sibling, 1 reply; 8+ messages in thread
From: Sridhar Samudrala @ 2013-11-08  6:41 UTC (permalink / raw)
  To: Alexei Starovoitov, Eric Dumazet
  Cc: David Miller, netdev, Hannes Frederic Sowa

On 11/7/2013 9:44 PM, Alexei Starovoitov wrote:
> On Thu, Nov 7, 2013 at 6:32 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
>> From: Eric Dumazet <edumazet@google.com>
>>
>> While testing virtio_net and skb_segment() changes, Hannes reported
>> that UFO was sending wrong frames.
>>
>> It appears this was introduced by a recent commit :
>> 8c3a897bfab1 ("inet: restore gso for vxlan")
>>
>> The old condition to perform IP frag was :
>>
>> tunnel = !!skb->encapsulation;
>> ...
>>          if (!tunnel && proto == IPPROTO_UDP) {
>>
>> So the new one should be :
>>
>> udpfrag = !skb->encapsulation && proto == IPPROTO_UDP;
>> ...
>>          if (udpfrag) {
>>
>> Initialization of udpfrag must be done before call
>> to ops->callbacks.gso_segment(skb, features), as
>> skb_udp_tunnel_segment() clears skb->encapsulation
>>
>> (We want udpfrag to be true for UFO, false for VXLAN)
>>
>> With help from Alexei Starovoitov
>>
>> Reported-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
>> Signed-off-by: Eric Dumazet <edumazet@google.com>
>> Cc: Alexei Starovoitov <ast@plumgrid.com>
>> ---
> vxlan looks good through namespaces with and without gso
> and between physical machines via 10G nics

Does this fix also help vxlan performance between 2 VMs on 2 different 
physical m/cs across 10G NIC?
What is the throughput you are seeing via 10G nics?
With linux 3.12, i am only seeing around 2Gbps (iperf TCP_STREAM with 
16K messages)  between 2 VMs when using vxlan across a 10G nic.
Is this due to the overhead of software GSO and not doing GRO at the 
receiver?

Thanks
Sridhar
>
> Tested-by: Alexei Starovoitov <ast@plumgrid.com>
>
> Thanks Eric!
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 net-next] inet: fix a UFO regression
  2013-11-08  2:32                 ` [PATCH v2 " Eric Dumazet
@ 2013-11-08  7:08                   ` David Miller
  0 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2013-11-08  7:08 UTC (permalink / raw)
  To: eric.dumazet; +Cc: ast, netdev, hannes

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Thu, 07 Nov 2013 18:32:06 -0800

> From: Eric Dumazet <edumazet@google.com>
> 
> While testing virtio_net and skb_segment() changes, Hannes reported
> that UFO was sending wrong frames.
> 
> It appears this was introduced by a recent commit :
> 8c3a897bfab1 ("inet: restore gso for vxlan")
> 
> The old condition to perform IP frag was :
> 
> tunnel = !!skb->encapsulation;
> ...
>         if (!tunnel && proto == IPPROTO_UDP) {
> 
> So the new one should be :
> 
> udpfrag = !skb->encapsulation && proto == IPPROTO_UDP;
> ...
>         if (udpfrag) {
> 
> Initialization of udpfrag must be done before call
> to ops->callbacks.gso_segment(skb, features), as
> skb_udp_tunnel_segment() clears skb->encapsulation
> 
> (We want udpfrag to be true for UFO, false for VXLAN)
> 
> With help from Alexei Starovoitov
> 
> Reported-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
> Signed-off-by: Eric Dumazet <edumazet@google.com>

Applied, thanks a lot Eric.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 net-next] inet: fix a UFO regression
  2013-11-08  6:41 ` Sridhar Samudrala
@ 2013-11-08 12:18   ` Eric Dumazet
  2013-11-08 20:20     ` Sridhar Samudrala
  0 siblings, 1 reply; 8+ messages in thread
From: Eric Dumazet @ 2013-11-08 12:18 UTC (permalink / raw)
  To: Sridhar Samudrala
  Cc: Alexei Starovoitov, David Miller, netdev, Hannes Frederic Sowa

On Thu, 2013-11-07 at 22:41 -0800, Sridhar Samudrala wrote:

> Does this fix also help vxlan performance between 2 VMs on 2 different 
> physical m/cs across 10G NIC?
> What is the throughput you are seeing via 10G nics?
> With linux 3.12, i am only seeing around 2Gbps (iperf TCP_STREAM with 
> 16K messages)  between 2 VMs when using vxlan across a 10G nic.
> Is this due to the overhead of software GSO and not doing GRO at the 
> receiver?

What NIC is used at sender, what NIC is used at receiver ?

If you use GRE instead of VXLAN, do you get any difference in speed ?

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 net-next] inet: fix a UFO regression
  2013-11-08 12:18   ` Eric Dumazet
@ 2013-11-08 20:20     ` Sridhar Samudrala
  2013-11-08 20:57       ` Eric Dumazet
  0 siblings, 1 reply; 8+ messages in thread
From: Sridhar Samudrala @ 2013-11-08 20:20 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Alexei Starovoitov, David Miller, netdev, Hannes Frederic Sowa

On 11/8/2013 4:18 AM, Eric Dumazet wrote:
> On Thu, 2013-11-07 at 22:41 -0800, Sridhar Samudrala wrote:
>
>> Does this fix also help vxlan performance between 2 VMs on 2 different
>> physical m/cs across 10G NIC?
>> What is the throughput you are seeing via 10G nics?
>> With linux 3.12, i am only seeing around 2Gbps (iperf TCP_STREAM with
>> 16K messages)  between 2 VMs when using vxlan across a 10G nic.
>> Is this due to the overhead of software GSO and not doing GRO at the
>> receiver?
> What NIC is used at sender, what NIC is used at receiver ?
I am seeing almost similar results with both Emulex and Intel 10Gb NICs 
at both sender and receiver.
>
> If you use GRE instead of VXLAN, do you get any difference in speed ?
With GRE, i am seeing slightly better results. 3.2Gb/s compared to 
1.8Gb/s with vxlan.


Thanks
Sridhar

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2 net-next] inet: fix a UFO regression
  2013-11-08 20:20     ` Sridhar Samudrala
@ 2013-11-08 20:57       ` Eric Dumazet
  0 siblings, 0 replies; 8+ messages in thread
From: Eric Dumazet @ 2013-11-08 20:57 UTC (permalink / raw)
  To: Sridhar Samudrala
  Cc: Alexei Starovoitov, David Miller, netdev, Hannes Frederic Sowa

On Fri, 2013-11-08 at 12:20 -0800, Sridhar Samudrala wrote:

> I am seeing almost similar results with both Emulex and Intel 10Gb NICs 
> at both sender and receiver.
> >
> > If you use GRE instead of VXLAN, do you get any difference in speed ?
> With GRE, i am seeing slightly better results. 3.2Gb/s compared to 
> 1.8Gb/s with vxlan.

Thanks, it seems to point a bottleneck at receiver, as we have GRO
support for GRE, but not yet for VXLAN.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-11-08 20:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-08  5:44 [PATCH v2 net-next] inet: fix a UFO regression Alexei Starovoitov
2013-11-08  5:50 ` Eric Dumazet
2013-11-08  6:41 ` Sridhar Samudrala
2013-11-08 12:18   ` Eric Dumazet
2013-11-08 20:20     ` Sridhar Samudrala
2013-11-08 20:57       ` Eric Dumazet
  -- strict thread matches above, loose matches on Subject: below --
2013-10-25  1:59 vxlan gso is broken by stackable gso_segment() Alexei Starovoitov
2013-10-25  4:06 ` Eric Dumazet
2013-10-25  9:09   ` Eric Dumazet
2013-10-25 22:18     ` David Miller
2013-10-25 22:41       ` Alexei Starovoitov
2013-10-28  1:18         ` [PATCH net-next] inet: restore gso for vxlan Eric Dumazet
2013-11-07 22:33           ` Eric Dumazet
2013-11-07 23:27             ` Alexei Starovoitov
2013-11-08  0:44               ` [PATCH net-next] inet: fix a UFO regression Eric Dumazet
2013-11-08  2:32                 ` [PATCH v2 " Eric Dumazet
2013-11-08  7:08                   ` David Miller

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).