From: Arnd Bergmann <arnd@arndb.de>
To: Sridhar Samudrala <sri@us.ibm.com>
Cc: David Miller <davem@davemloft.net>,
Herbert Xu <herbert@gondor.apana.org.au>,
netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next-2.6] macvtap: Add GSO/csum offload support
Date: Thu, 18 Feb 2010 21:47:57 +0100 [thread overview]
Message-ID: <201002182147.57516.arnd@arndb.de> (raw)
In-Reply-To: <1266523423.15681.24.camel@w-sridhar.beaverton.ibm.com>
On Thursday 18 February 2010, Sridhar Samudrala wrote:
> >
> > macvtap is different from tun/tap here, because the data direction is the
> > opposite: reading from a macvtap chardev corresponds to receive, while
> > writing to it is a transmit in the network stack. In the tap driver, we
> > just set the GSO flags of the netdev and dev_queue_xmit will do the right
> > thing when forwarding data to the tap, but for macvtap, incoming frames
> > never go through dev_queue_xmit (they go through netif_rx), so if the
> > external device passes us GSO frames, we just pass them on unmodified
> > to the guest, even if that guest does not understand GSO.
>
> If a guest is connected to a macvtap device attached to an underlying physical
> device with GRO enabled, it is possible to receive large SKBs and we don't handle
> them correctly. The current workaround is to disable GRO on the physical device.
Ok.
> > In particular, when we have two guests using macvtap in bridge mode,
> > we don't even go through the network stack and just pass down the
> > SKB we got from the other side if the destination MAC address matches.
> > That means that a sender using virtio-net with GSO will send garbage
> > to another guest using a hardware emulated NIC that cannot receive
> > GSO (GRO?) frames.
>
> Yes. I think we need to do something similar to dev_gso_segment() in
> macvtap_forward() if skb_is_gso() and IFF_VNET_HDR is not set in
> q->flags.
I think it needs to be more fine-grained than that, and take into account
the specific offload capabilities of the receiving guest that were
negotiated in TUNSETOFFLOAD, but other than that, this looks fine.
Regarding TUNSETOFFLOAD, the part I don't get is what the negotiation
really means for TX and RX respectively. Is it safe to assume that what
gets set is the common subset of features between guest and host for
RX *and* TX, or is it just one of them?
> > I hope you have an idea how to do this right or can convince me that
> > everything is ok, otherwise we'd have to defer this patch.
>
> I would prefer getting this patch in as it helps peformance when both
> the guest and the physical device support offloads and also we have
> workaround for other situations. In the meantime, I will start looking
> into addressing this specific case in macvtap_forward().
Ok, fair enough.
For the forwarding between ports, simply refusing TUNSETOFFLOAD for
any bridge mode ports should be fine and still let us use offloading
for vepa mode.
Arnd
prev parent reply other threads:[~2010-02-18 20:48 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-12 22:27 [PATCH net-next-2.6] macvtap: Add GSO/csum offload support Sridhar Samudrala
2010-02-13 6:58 ` Sridhar Samudrala
2010-02-13 17:34 ` Arnd Bergmann
2010-02-13 20:55 ` Sridhar Samudrala
2010-02-14 19:13 ` Arnd Bergmann
2010-02-15 0:21 ` Herbert Xu
2010-02-15 9:19 ` Arnd Bergmann
2010-02-15 17:05 ` Sridhar Samudrala
2010-02-18 16:10 ` Arnd Bergmann
2010-02-18 20:03 ` Sridhar Samudrala
2010-02-18 20:47 ` Arnd Bergmann [this message]
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=201002182147.57516.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=netdev@vger.kernel.org \
--cc=sri@us.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.