From patchwork Thu Jul 16 08:04:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Scott Feldman X-Patchwork-Id: 496577 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 65277140285 for ; Thu, 16 Jul 2015 18:03:04 +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=jUwa1i7A; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754088AbbGPIC6 (ORCPT ); Thu, 16 Jul 2015 04:02:58 -0400 Received: from mail-pd0-f177.google.com ([209.85.192.177]:36834 "EHLO mail-pd0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754024AbbGPICs (ORCPT ); Thu, 16 Jul 2015 04:02:48 -0400 Received: by pdjr16 with SMTP id r16so40259104pdj.3 for ; Thu, 16 Jul 2015 01:02:48 -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=ztAc/ogUe+yOhKgZH2kObrlrxG6vvZoCoZ4K5o3jn/Y=; b=jUwa1i7AWck+nAKKH0UE0HXKj1FwoHVBemLFS3nuolY9eJR9FgVYi1zfgC/7q9Xk6m 7smZQEiKYIY5ECdDq573SSm/sfbxOm/+OFhZLdoq1Ulffu2+Qd8KOuk62gVfAlnfNVB/ MHPOJVZgjeb/BUl+75HcZiNxrwT2uzVeJypvpUMhQ2jFZ5ca8bNfxAUuJDG4GqxOKph7 MRKM3DkPgNkS0BdfXUQJoXiglq/FyV45LjNI8tc6P7Au+mLlCoP/u0sxkTkOJpnU9NDW rJbIB3/dYsXJPFCuo1xVongD6KCLC5HvD9Z+j9NVF6UeCj9ZEcZcxYF82ozBk/Kxo9Vg oygw== X-Received: by 10.70.88.80 with SMTP id be16mr15853212pdb.37.1437033768218; Thu, 16 Jul 2015 01:02:48 -0700 (PDT) Received: from rocker1.rocker.net ([199.58.98.143]) by smtp.gmail.com with ESMTPSA id f4sm6940496pdc.95.2015.07.16.01.02.47 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Jul 2015 01:02:47 -0700 (PDT) From: sfeldma@gmail.com To: netdev@vger.kernel.org Cc: jiri@resnulli.us, roopa@cumulusnetworks.com, simon.horman@netronome.com Subject: [PATCH net-next v2 5/5] switchdev: update documentation for offload_fwd_mark Date: Thu, 16 Jul 2015 01:04:57 -0700 Message-Id: <1437033897-8050-6-git-send-email-sfeldma@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1437033897-8050-1-git-send-email-sfeldma@gmail.com> References: <1437033897-8050-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 Acked-by: Jiri Pirko --- 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..9825f32 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 should 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