netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Ben Hutchings <bhutchings@solarflare.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
	alexander.h.duyck@intel.com, stephen.s.ko@intel.com,
	jeffrey.t.kirsher@intel.com, David Miller <davem@davemloft.net>,
	netdev@vger.kernel.org, sony.chacko@qlogic.com,
	mchan@broadcom.com, jitendra.kalsaria@qlogic.com,
	eilong@broadcom.com
Subject: Re: regression caused by 1d2024f61ec14bdb0c57a97a3fe73685abc2d198?
Date: Thu, 7 Feb 2013 00:26:54 +0200	[thread overview]
Message-ID: <20130206222654.GA6195@redhat.com> (raw)
In-Reply-To: <1360187747.2659.35.camel@bwh-desktop.uk.solarflarecom.com>

On Wed, Feb 06, 2013 at 09:55:47PM +0000, Ben Hutchings wrote:
> On Wed, 2013-02-06 at 23:45 +0200, Michael S. Tsirkin wrote:
> > On Wed, Feb 06, 2013 at 07:58:21PM +0000, Ben Hutchings wrote:
> > > On Wed, 2013-02-06 at 17:50 +0200, Michael S. Tsirkin wrote:
> > > > On Wed, Feb 06, 2013 at 05:07:39AM -0800, Eric Dumazet wrote:
> > > > > On Wed, 2013-02-06 at 13:43 +0200, Michael S. Tsirkin wrote:
> > > > > > It seems that starting with kernel 3.3 ixgbe sets gso_size for
> > > > > > incoming frames. It seems that this might result in gso_size
> > > > > > being set even when gso_type is 0.
> > > > > > This in turn leads to a crash at macvtap_skb_to_vnet_hdr
> > > > > > drivers/net/macvtap.c:628
> > > > > > which has this code:
> > > > > > 
> > > > > >        if (skb_is_gso(skb)) {
> > > > > >                 struct skb_shared_info *sinfo = skb_shinfo(skb);
> > > > > > 
> > > > > >                 /* This is a hint as to how much should be linear. */
> > > > > >                 vnet_hdr->hdr_len = skb_headlen(skb);
> > > > > >                 vnet_hdr->gso_size = sinfo->gso_size;
> > > > > >                 if (sinfo->gso_type & SKB_GSO_TCPV4)
> > > > > >                         vnet_hdr->gso_type = VIRTIO_NET_HDR_GSO_TCPV4;
> > > > > >                 else if (sinfo->gso_type & SKB_GSO_TCPV6)
> > > > > >                         vnet_hdr->gso_type = VIRTIO_NET_HDR_GSO_TCPV6;
> > > > > >                 else if (sinfo->gso_type & SKB_GSO_UDP)
> > > > > >                         vnet_hdr->gso_type = VIRTIO_NET_HDR_GSO_UDP;
> > > > > >                 else
> > > > > >                         BUG();
> > > > > >                 if (sinfo->gso_type & SKB_GSO_TCP_ECN)
> > > > > >                         vnet_hdr->gso_type |= VIRTIO_NET_HDR_GSO_ECN;
> > > > > >         } else
> > > > > >                 vnet_hdr->gso_type = VIRTIO_NET_HDR_GSO_NONE;
> > > > > > 
> > > > > > 
> > > > > > Since skb_is_gso tests gso_size.
> > > > > > 
> > > > > > What's the right way to handle this? Should skb_is_gso be
> > > > > > changed to test gso_type != 0?
> > > > > > 
> > > > > 
> > > > > Or fix ixgbe to set gso_type in ixgbe_get_headlen(), as it does all the
> > > > > dissection.
> > > > 
> > > > 
> > > > Hmm, ixgbe_get_headlen isn't run on linear skbs though.
> > > > 
> > > > Also, I'm not sure I understand when should drivers set gso size
> > > > for incoming messages and what is a reasonable value.
> > > > Commit log talks about improved performance for lossy connections,
> > > > in this case, isn't this something net core should set?
> > > [...]
> > > 
> > > It should be set to the segment size on the wire, so TCP gets a correct
> > > picture of packet loss.  The networking core has no idea what hardware/
> > > firmware LRO did.
> > > 
> > > I've previously raised this issue of macvlan vs LRO (which is the same
> > > issue we previously had with IP forwarding and with bridging):
> > >      http://thread.gmane.org/gmane.linux.network/221695
> > > 
> > > Ben.
> > 
> > I see, you proposed disabling LRO the moment a macvlan is attached.
> > If I understand correctly, the difference as compared to bridge is that
> > bridge normally consumes all incoming packets, macvlan is often used in
> > parallel with the underlying interface.
> 
> Not so different from IP forwarding, though, in that a single interface
> can both forward packets and deliver them locally.

Hmm, for ip forwarding we don't try do disable LRO on the device, do we?
What's the solution there?

> > BTW are there other issues with forwarding/bridging and LRO? If everyone
> > sets gso_type in packets it seems we can leave LRO set even with
> > bridging?
> 
> Some implementations of LRO violate the end-to-end principle by merging
> segments with varying lengths and TCP timestamps.  GRO is very careful
> to ensure that the original packets can be recovered from the skbs it
> produces.
> 
> Ben.
> 
> -- 
> Ben Hutchings, Staff Engineer, Solarflare
> Not speaking for my employer; that's the marketing department's job.
> They asked us to note that Solarflare product names are trademarked.

  reply	other threads:[~2013-02-06 22:22 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-06 11:43 regression caused by 1d2024f61ec14bdb0c57a97a3fe73685abc2d198? Michael S. Tsirkin
2013-02-06 13:07 ` Eric Dumazet
2013-02-06 15:50   ` Michael S. Tsirkin
2013-02-06 16:15     ` Eric Dumazet
2013-02-06 17:42       ` Michael S. Tsirkin
2013-02-06 17:42         ` Eric Dumazet
2013-02-06 17:50           ` Michael S. Tsirkin
2013-02-06 18:05           ` Michael S. Tsirkin
2013-02-06 18:09             ` Eric Dumazet
2013-02-07  3:03         ` Cong Wang
2013-02-06 16:23     ` Eric Dumazet
2013-02-06 19:58     ` Ben Hutchings
2013-02-06 21:45       ` Michael S. Tsirkin
2013-02-06 21:55         ` Ben Hutchings
2013-02-06 22:26           ` Michael S. Tsirkin [this message]
2013-02-06 23:29             ` Ben Hutchings

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130206222654.GA6195@redhat.com \
    --to=mst@redhat.com \
    --cc=alexander.h.duyck@intel.com \
    --cc=bhutchings@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=eilong@broadcom.com \
    --cc=eric.dumazet@gmail.com \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=jitendra.kalsaria@qlogic.com \
    --cc=mchan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    --cc=sony.chacko@qlogic.com \
    --cc=stephen.s.ko@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).