netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: sfeldma@gmail.com
Cc: netdev@vger.kernel.org, jiri@resnulli.us,
	simon.horman@netronome.com, roopa@cumulusnetworks.com,
	ronen.arad@intel.com, john.r.fastabend@intel.com, andrew@lunn.ch,
	f.fainelli@gmail.com, linux@roeck-us.net, davidch@broadcom.com,
	stephen@networkplumber.org
Subject: Re: [RFC PATCH net-next 0/4] switchdev: avoid duplicate packet forwarding
Date: Mon, 15 Jun 2015 16:25:51 -0700 (PDT)	[thread overview]
Message-ID: <20150615.162551.805611215439524288.davem@davemloft.net> (raw)
In-Reply-To: <1434218670-43821-1-git-send-email-sfeldma@gmail.com>

From: sfeldma@gmail.com
Date: Sat, 13 Jun 2015 11:04:26 -0700

> The switchdev port driver must do two things:
> 
> 1) Generate a fwd_mark for each switch port, using some unique key of the
>    switch device (and optionally port).  This is a one-time operation done
>    when port's netdev is setup.
> 
> 2) On packet ingress from port, mark the skb with the ingress port's
>    fwd_mark.  If the device supports it, it's useful to only mark skbs
>    which were already forwarded by the device.  If the device does not
>    support such indication, all skbs can be marked, even if they're
>    local dst.
> 
> Two new 32-bit fields are added to struct sk_buff and struct netdevice to
> hold the fwd_mark.  I've wrapped these with CONFIG_NET_SWITCHDEV for now. I
> tried using skb->mark for this purpose, but ebtables can overwrite the
> skb->mark before the bridge gets it, so that will not work.
> 
> In general, this fwd_mark can be used for any case where a packet is
> forwarded by the device and a copy is sent to the CPU, to avoid the kernel
> re-forwarding the packet.  sFlow is another use-case that comes to mind,
> but I haven't explored the details.

Generally I'm against adding new fields fo sk_buff but I'm trying to be
open minded. :-)

About the per-device fwd_mark, if the key attribute is uniqueness,
let's just do it right and use something like lib/idr.c to generate
truly unique indices at probe time for all devices using this
facility.  I like that better than having them be unique by a happy
accident.

  parent reply	other threads:[~2015-06-15 23:25 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-13 18:04 [RFC PATCH net-next 0/4] switchdev: avoid duplicate packet forwarding sfeldma
2015-06-13 18:04 ` [RFC PATCH net-next 1/4] net: don't reforward packets already forwarded by offload device sfeldma
2015-06-14  6:51   ` Jiri Pirko
2015-06-15 14:21   ` roopa
2015-06-13 18:04 ` [RFC PATCH net-next 2/4] switchdev: add fwd_mark generator helper sfeldma
2015-06-14  6:56   ` Jiri Pirko
2015-06-14 17:50     ` Scott Feldman
2015-06-15  5:46       ` Jiri Pirko
2015-06-15 13:52         ` Scott Feldman
2015-06-15 14:09           ` Sergei Shtylyov
2015-06-15 15:17   ` roopa
2015-06-13 18:04 ` [RFC PATCH net-next 3/4] rocker: add fwd_mark support sfeldma
2015-06-14  7:02   ` Jiri Pirko
2015-06-14 18:00     ` Scott Feldman
2015-06-15  5:49       ` Jiri Pirko
2015-06-13 18:04 ` [RFC PATCH net-next 4/4] switchdev: update documentation for fwd_mark sfeldma
2015-06-15 13:54 ` [RFC PATCH net-next 0/4] switchdev: avoid duplicate packet forwarding roopa
2015-06-15 14:23 ` roopa
2015-06-15 23:25 ` David Miller [this message]
2015-06-16  6:04   ` Jiri Pirko
2015-06-16 16:47     ` Scott Feldman
2015-06-16 21:11       ` Jiri Pirko
2015-06-16 23:53         ` Scott Feldman
2015-06-17  6:30           ` Jiri Pirko
2015-06-17  7:02             ` Scott Feldman
2015-06-17 10:23         ` Jamal Hadi Salim

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=20150615.162551.805611215439524288.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=andrew@lunn.ch \
    --cc=davidch@broadcom.com \
    --cc=f.fainelli@gmail.com \
    --cc=jiri@resnulli.us \
    --cc=john.r.fastabend@intel.com \
    --cc=linux@roeck-us.net \
    --cc=netdev@vger.kernel.org \
    --cc=ronen.arad@intel.com \
    --cc=roopa@cumulusnetworks.com \
    --cc=sfeldma@gmail.com \
    --cc=simon.horman@netronome.com \
    --cc=stephen@networkplumber.org \
    /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).