netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Tom Herbert <therbert@google.com>
Cc: Or Gerlitz <gerlitz.or@gmail.com>,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>,
	Alexander Duyck <alexander.h.duyck@intel.com>,
	David Miller <davem@davemloft.net>,
	Linux Netdev List <netdev@vger.kernel.org>,
	Thomas Graf <tgraf@suug.ch>, Pravin Shelar <pshelar@nicira.com>,
	John Fastabend <john.r.fastabend@intel.com>,
	Andy Zhou <azhou@nicira.com>
Subject: Re: [PATCH] net: Add ndo_gso_check
Date: Tue, 30 Sep 2014 14:37:00 -0700	[thread overview]
Message-ID: <20140930143700.3dffac4d@urahara> (raw)
In-Reply-To: <CA+mtBx-sP6g9hXAYGfHKCPYkCtjgCFM0srueh1uhoNnC2ACr1g@mail.gmail.com>

On Tue, 30 Sep 2014 08:34:14 -0700
Tom Herbert <therbert@google.com> wrote:

> On Tue, Sep 30, 2014 at 7:30 AM, Or Gerlitz <gerlitz.or@gmail.com> wrote:
> > On Tue, Sep 30, 2014 at 12:38 AM, Tom Herbert <therbert@google.com> wrote:
> >> On Mon, Sep 29, 2014 at 2:10 PM, Or Gerlitz <gerlitz.or@gmail.com> wrote:
> >>> On Mon, Sep 29, 2014 at 11:53 PM, Tom Herbert <therbert@google.com> wrote:
> >>>> On Mon, Sep 29, 2014 at 12:59 PM, Or Gerlitz <gerlitz.or@gmail.com> wrote:
> >>>>> On Mon, Sep 29, 2014 at 6:50 AM, Tom Herbert <therbert@google.com> wrote:
> >>>>>> Add ndo_gso_check which a device can define to indicate whether is
> >>>>>> is capable of doing GSO on a packet. This funciton would be called from
> >>>>>> the stack to determine whether software GSO is needed to be done.
> >>>>>
> >>>>> please, no...
> >>>>>
> >>>>> We should strive to have a model/architecture under which the driver
> >>>>> can clearly advertize up something (bits, collection of bits,
> >>>>> whatever) which the stack can run through some dec-sion making code
> >>>>> and decide if to GSO yes/no, do it ala SW or ala HW. As life, this
> >>>>> model need not be perfect and can be biased towards being
> >>>>> simple/robust/conservative and developed incrementally.
> >
> >>>> Please make a specific proposal then.
> >
> > OK
> >
> >>> We 1st need to bring the system back into a consistent state, see my
> >>> band-aid proposal. BTW, this band-aid might turn to be the basis for
> >>> the longer term solution too. I admit that saying "no" is ten (100)
> >>> times harder vs. say "let's do it this way", but IMHO the fm10k call
> >>> chain I pointed on is what you are suggesting more-or-less and is no-no
> >
> >> I'd much rather have drivers do this, than inflict the stack with more
> >> complexity. As you describe "the driver can clearly advertise up
> >> something (bits, collection of bits, whatever) which the stack can run
> >> through some dec-sion making code and decide if to GSO yes/no"-- seems
> >> very complex to me. My proposed alternative is to just ask the driver
> >
> > I see the point you are trying to make, but
> >
> >> and they can implement whatever policy they want, stack should doesn't
> >> care about the specifics, just needs an answer. Neither does this
> >> necessarily mean that driver needs to inspect packet, for instance I
> >> suspect that just be looking at inner header lengths and skb->protocol
> >> being TEB would be standard check to match VXLAN.
> >
> > I'm not sure how exactly this (inner protocol being Ethernet and inner
> > header lengths)
> > is going to work to differentiate between VXLAN and NVGRE (or @ least
> > the GRE-ing done
> > by OVS on guest Ethernet frames).
> >
> GSO processing for VXLAN and NVGRE should be identical. They both have
> a four byte header that needs to be copied per packet and both only
> carry Ethernet frames.
> 
> >> In any case, if you can formulate your proposal in a patch that would
> >> be very helpful.
> >
> > Quick idea is the following:
> >
> > It's common that when someone along the stack (e,g OVS vxlan/gre datapath logic)
> > encapsulates a packet, they do know what sort of encapsulation they are doing.
> >
> > So the encapsulating entity can color the packet skb and the driver
> > would advertize
> > to what colors (UDP encap types) they can do GSO. When we come to a
> > point where the
> > stack has to decide if go for SW or HW GSO, they attempt to match the colors.
> >
> This would be equivalent to adding more protocol specific GSO feature
> bits. I still don't see how this will scale. The number of protocols
> that we might want to encapsulate over UDP is vast-- even before FOU
> adding possibility of encapsulating any IP protocol in UDP. And, as
> already pointed out, devices might have other arbitrary limitations
> such as length of inner headers that wouldn't easily be represented in
> features.
> 
> Also, this does not benefit the stack or drivers that already support
> generic SKB_GSO_UDP_TUNNEL mechanism.
> 
> Would any other driver maintainers like to chime in on this?

I prefer the simplistic "yes I can do GSO" flag and let the
driver do software GSO for the cases where it detects "no never mind
that, I can't' do GSO on a Q-in-Q VLAN with NVGRE".

Software GSO at driver level is sometimes better anyway because it means driver can
enqueue a burst of packets into Tx ring.

  reply	other threads:[~2014-09-30 21:38 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-29  3:50 [PATCH] net: Add ndo_gso_check Tom Herbert
2014-09-29 19:59 ` Or Gerlitz
2014-09-29 20:12   ` David Miller
2014-09-29 20:53   ` Tom Herbert
2014-09-29 21:10     ` Or Gerlitz
2014-09-29 21:38       ` Tom Herbert
2014-09-30 14:30         ` Or Gerlitz
2014-09-30 15:34           ` Tom Herbert
2014-09-30 21:37             ` Stephen Hemminger [this message]
2014-09-30 22:11               ` Eric Dumazet
2014-10-01  0:05               ` Tom Herbert
2014-10-01  0:18                 ` Eric Dumazet
2014-10-01  6:12                   ` Eric Dumazet
2014-10-01 20:58             ` Or Gerlitz
2014-10-01 21:12               ` Jesse Gross
2014-10-01 23:06               ` Tom Herbert
2014-10-05 14:04                 ` Or Gerlitz
2014-10-05 18:49                   ` Tom Herbert
2014-10-05 19:13                     ` Or Gerlitz
2014-10-06 17:59                       ` Tom Herbert
2014-10-06 20:22                         ` Or Gerlitz
2014-10-06 21:28                           ` Tom Herbert
2014-10-07 11:07                             ` Or Gerlitz
2015-01-15 18:18                             ` Or Gerlitz
2014-10-06 22:33                         ` Jesse Gross
2014-10-07  0:17                           ` Tom Herbert
2014-10-09  0:30                             ` Jesse Gross
2014-10-09  1:46                               ` Tom Herbert
2014-10-06 21:51                     ` Jesse Gross
2014-09-29 20:13 ` Jesse Gross
2014-09-29 20:47   ` Tom Herbert
2014-09-30  0:33     ` Jesse Gross
2014-09-30  1:59       ` Tom Herbert
2014-10-07 18:13 ` Tom Herbert
2014-10-07 20:15   ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2014-10-07 16:50 Alexei Starovoitov
2014-10-07 17:05 ` David Miller
2014-10-07 17:18   ` Alexei Starovoitov
2014-10-07 18:47     ` David Miller
2014-10-07 20:28       ` Alexei Starovoitov
2014-10-07 20:32         ` David Miller
2014-10-07 20:43           ` Alexei Starovoitov
2014-10-07 20:48             ` David Miller
2014-10-07 21:41               ` Thomas Graf
2014-10-07 17:23 ` Eric Dumazet
2014-10-07 18:15   ` Alexei Starovoitov
2014-10-07 18:50     ` Eric Dumazet
2014-10-07 18:51     ` David Miller
2014-10-07 19:10       ` Tom Herbert
2014-10-07 22:05 Alexei Starovoitov
2014-10-07 23:43 ` Tom Herbert

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=20140930143700.3dffac4d@urahara \
    --to=stephen@networkplumber.org \
    --cc=alexander.h.duyck@intel.com \
    --cc=azhou@nicira.com \
    --cc=davem@davemloft.net \
    --cc=gerlitz.or@gmail.com \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=john.r.fastabend@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pshelar@nicira.com \
    --cc=tgraf@suug.ch \
    --cc=therbert@google.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).