From patchwork Wed Jun 17 21:53:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Scott Feldman X-Patchwork-Id: 485722 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 20EDF140328 for ; Thu, 18 Jun 2015 07:51:33 +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=WrgCI1ye; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757478AbbFQVv3 (ORCPT ); Wed, 17 Jun 2015 17:51:29 -0400 Received: from mail-pa0-f43.google.com ([209.85.220.43]:34959 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753197AbbFQVvY (ORCPT ); Wed, 17 Jun 2015 17:51:24 -0400 Received: by pacyx8 with SMTP id yx8so45482384pac.2 for ; Wed, 17 Jun 2015 14:51:24 -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=QSuaeL/rt3ppCWBnjHogH8dtEzoDQwmRWk6oh18dVEU=; b=WrgCI1ye9kb/IZZjX7obQPDv7ChtsXYtO0gOcW2MahVoEmSV8FjFL5eio/LeKmgDi5 +/mcIxk0K1QDJKDLQDbWD9jTBEQivty91jcso5aVp7T1r4D5xpKsa9vC+RvRBSYWAUWb AKrJkrQU2wi3a3eBu1A2oPpEmlxC2qpPZr1IraDXrdRGdZbRG35e02G2LDvm0wkoPMfb gJiIgW7b0i8RsF2ZWGj7mX5B8lGte1l/GdlkyFvE2KCtBLhot3nKMAVZzyRLdh9wriQV iXrjCD8DIZzACePm6NEopU1wHbbzymcK7Z3vQbx357lFkd7Qh0Ld8TVlAkvx+8Ky47yH IjEA== X-Received: by 10.68.135.73 with SMTP id pq9mr15034792pbb.46.1434577884487; Wed, 17 Jun 2015 14:51:24 -0700 (PDT) Received: from rocker1.rocker.net ([199.58.98.143]) by mx.google.com with ESMTPSA id gc5sm5697349pbb.53.2015.06.17.14.51.22 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Jun 2015 14:51:23 -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 v2 5/5] switchdev: update documentation for offload_fwd_mark Date: Wed, 17 Jun 2015 14:53:14 -0700 Message-Id: <1434577994-22409-6-git-send-email-sfeldma@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1434577994-22409-1-git-send-email-sfeldma@gmail.com> References: <1434577994-22409-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 | 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