From patchwork Sat Jun 13 18:04:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Scott Feldman X-Patchwork-Id: 483908 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 403C51401F0 for ; Sun, 14 Jun 2015 04:02:58 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=dVcauh/B; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753632AbbFMSCy (ORCPT ); Sat, 13 Jun 2015 14:02:54 -0400 Received: from mail-ig0-f182.google.com ([209.85.213.182]:38242 "EHLO mail-ig0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753176AbbFMSCn (ORCPT ); Sat, 13 Jun 2015 14:02:43 -0400 Received: by igblz2 with SMTP id lz2so28136575igb.1 for ; Sat, 13 Jun 2015 11:02:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=BHuhKJSgMvbxOmWVBLjzY2f9fCgzIgYQ/vVwpffLPqU=; b=dVcauh/BozNpavMJ/6fACTkAT7qm1iqfZ4ZyrFsJo3X1hDnuAIRFAhOqLN0K0SVO15 3ILYy9iAdskGUAQ7zC023kx5JN552IGRaK+C71GigvoNnQXVVbWFOVLf133DzSQa9cAi 8zrHfLLrC1jsUiotio6RqMhJLxqsflWldyTj8iZ8rvsdXR5etbEquyw/0ewSwD1/FkQ2 v95QBAu1sKKF/gxrw56JnmBg/P067U5ne3p6b8w2GbpDx6Zj6V/xdzNK/6EblSA60HtX DgEFcyhmqrhM5+86pw/8H2JgCzcotFHca2hF8NS/xiCLnZH8VRiuwcSwD1tc1cUZtvBZ ZAeQ== X-Received: by 10.107.33.9 with SMTP id h9mr25464895ioh.1.1434218563003; Sat, 13 Jun 2015 11:02:43 -0700 (PDT) Received: from rocker1.rocker.net ([199.58.98.143]) by mx.google.com with ESMTPSA id t7sm3777377ign.8.2015.06.13.11.02.41 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 13 Jun 2015 11:02:42 -0700 (PDT) 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 4/4] switchdev: update documentation for fwd_mark Date: Sat, 13 Jun 2015 11:04:30 -0700 Message-Id: <1434218670-43821-5-git-send-email-sfeldma@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1434218670-43821-1-git-send-email-sfeldma@gmail.com> References: <1434218670-43821-1-git-send-email-sfeldma@gmail.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Scott Feldman Signed-off-by: Scott Feldman --- Documentation/networking/switchdev.txt | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Documentation/networking/switchdev.txt b/Documentation/networking/switchdev.txt index da82cd7..d6a8695 100644 --- a/Documentation/networking/switchdev.txt +++ b/Documentation/networking/switchdev.txt @@ -286,8 +286,17 @@ 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->fwd_mark. The same mark is set on the device ports in the +domain using dev->fwd_mark. If the skb->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_mark_get() to get a globally unique mark for egress port(s)' +dev->fwd_mark, based on a driver/device-supplied key. 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