All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: sfeldma@gmail.com
To: netdev@vger.kernel.org
Cc: 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: [RFC PATCH net-next v2 5/5] switchdev: update documentation for offload_fwd_mark
Date: Wed, 17 Jun 2015 14:53:14 -0700	[thread overview]
Message-ID: <1434577994-22409-6-git-send-email-sfeldma@gmail.com> (raw)
In-Reply-To: <1434577994-22409-1-git-send-email-sfeldma@gmail.com>

From: Scott Feldman <sfeldma@gmail.com>

Signed-off-by: Scott Feldman <sfeldma@gmail.com>
---
 Documentation/networking/switchdev.txt |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/Documentation/networking/switchdev.txt b/Documentation/networking/switchdev.txt
index c5d7ade..b864e47 100644
--- a/Documentation/networking/switchdev.txt
+++ b/Documentation/networking/switchdev.txt
@@ -279,8 +279,18 @@ and unknown unicast packets to all ports in domain, if allowed by port's
 current STP state.  The switch driver, knowing which ports are within which
 vlan L2 domain, can program the switch device for flooding.  The packet should
 also be sent to the port netdev for processing by the bridge driver.  The
-bridge should not reflood the packet to the same ports the device flooded.
-XXX: the mechanism to avoid duplicate flood packets is being discuseed.
+bridge should not reflood the packet to the same ports the device flooded,
+otherwise there will be duplicate packets on the wire.
+
+To avoid duplicate packets, the device/driver can mark a packet as already
+forwarded using skb->offload_fwd_mark.  The same mark is set on the device
+ports in the domain using dev->offload_fwd_mark.  If the skb->offload_fwd_mark
+is non-zero and matches the forwarding egress port's dev->skb_mark, the kernel
+will drop the skb right before transmit on the egress port, with the
+understanding that the device already forwarded the packet on same egress port.
+The driver can use switchdev_port_fwd_mark_set() to set a globally unique mark
+for port's dev->offload_fwd_mark, based on the port's parent ID (switch ID) and
+a group ifindex.
 
 It is possible for the switch device to not handle flooding and push the
 packets up to the bridge driver for flooding.  This is not ideal as the number
-- 
1.7.10.4

      parent reply	other threads:[~2015-06-17 21:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-17 21:53 [RFC PATCH net-next v2 0/5] switchdev: avoid duplicate packet forwarding sfeldma
2015-06-17 21:53 ` [RFC PATCH net-next v2 1/5] net: don't reforward packets already forwarded by offload device sfeldma
2015-06-17 21:53 ` [RFC PATCH net-next v2 2/5] net: add phys ID compare helper to test if two IDs are the same sfeldma
2015-06-18 14:11   ` Sergei Shtylyov
2015-06-17 21:53 ` [RFC PATCH net-next v2 3/5] switchdev: add offload_fwd_mark generator helper sfeldma
2015-06-17 21:53 ` [RFC PATCH net-next v2 4/5] rocker: add offload_fwd_mark support sfeldma
2015-06-17 21:53 ` sfeldma [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=1434577994-22409-6-git-send-email-sfeldma@gmail.com \
    --to=sfeldma@gmail.com \
    --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=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 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.