Received: by 10.223.164.202 with SMTP id h10csp265699wrb; Thu, 30 Nov 2017 09:59:34 -0800 (PST) X-Google-Smtp-Source: AGs4zMbQrOIKv4y/v7x6gdkROqpQTQcXN3fdBi06gwo3IJ/Dlqc8N62Mr9yvDPCWOF7elxrCRh8h X-Received: by 10.84.192.131 with SMTP id c3mr3501297pld.435.1512064774289; Thu, 30 Nov 2017 09:59:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512064774; cv=none; d=google.com; s=arc-20160816; b=Ym9K3ryaDH4akBOKsI0YfRBUSXfxTDROFofj+TQyE/zQKlR1j+SBcfigul5ngBiocl Uw3BlzbhKTh6T7zfSqBP4Tb8H7YqlLg/A3HW3nEWX8yUMoJc9oF1k7J8pszYn3T+WYAj Zf9qIxb97Z79hG3lE7POY2dL/sD2WmzyyB6/Emb7tV0SrdD7v/jIgoMhfGks46ptEs7C p5mW+jIaTyrRcgtrxtzeiGY3pJN83J4f1uHz7on3gYD6QMa4Uts1J+Ztr3zIYDTEPOeo JsR81hpm5wRUqd7TE/DtLLEsu9GpzXgORIkRa6tlITMVMTe0Tc6cH+HBU7AfLW1A4fDv dg5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=SJsC26wq12S7Xmz/IUBdojxCFM+cman9H6KE2F6e+Xg=; b=d5h8GXIPNR3/wyADc6D8+FTZv46IQGXLbun/rqFUo+ewz3WMH4msHfmqc2mLve+Uf/ Uytvb6424c6yR4lCNlYpNK35hhrsgN1JVXN4dbJWL0uz7K3vyKC4aNKqjYe50ZNnnrXd 4cQFTgRQppplI303vN5HLDGIX+B5HUMz6KCeEtbe5yPfqEz+NELZV1fM4EoHOTYo7KJj 1hAf7fpGtuiYr3r6mfhwcIShRwF85Qyd/bw6xZ0F2l7qLnnWZTS9K1Fs5jkIGtkwNgYt BEWTy3atT/Wg+kpeGhMISRGRXO/Nfs0lWGxlpiLXqJPrpJjIJHRuW0m+ajq5l+rbZ2mz sdGQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c72si3619168pfe.65.2017.11.30.09.59.20; Thu, 30 Nov 2017 09:59:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753997AbdK3R44 (ORCPT + 99 others); Thu, 30 Nov 2017 12:56:56 -0500 Received: from mail.savoirfairelinux.com ([208.88.110.44]:58242 "EHLO mail.savoirfairelinux.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753863AbdK3R4x (ORCPT ); Thu, 30 Nov 2017 12:56:53 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 269119C31B1; Thu, 30 Nov 2017 12:56:53 -0500 (EST) Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id LqeQ43sybj4N; Thu, 30 Nov 2017 12:56:52 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.savoirfairelinux.com (Postfix) with ESMTP id 8C50A9C31AE; Thu, 30 Nov 2017 12:56:52 -0500 (EST) X-Virus-Scanned: amavisd-new at mail.savoirfairelinux.com Received: from mail.savoirfairelinux.com ([127.0.0.1]) by localhost (mail.savoirfairelinux.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id kQjziarTRqYD; Thu, 30 Nov 2017 12:56:52 -0500 (EST) Received: from weeman.mtl.sfl (unknown [192.168.49.104]) by mail.savoirfairelinux.com (Postfix) with ESMTPSA id 5B2269C28F7; Thu, 30 Nov 2017 12:56:52 -0500 (EST) From: Vivien Didelot To: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel@savoirfairelinux.com, "David S. Miller" , Florian Fainelli , Andrew Lunn , Vivien Didelot Subject: [PATCH net-next 0/2] net: dsa: cross-chip FDB support Date: Thu, 30 Nov 2017 12:56:41 -0500 Message-Id: <20171130175643.14022-1-vivien.didelot@savoirfairelinux.com> X-Mailer: git-send-email 2.15.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org DSA can have interconnected switches. For instance, the ZII Dev Rev B board described in arch/arm/boot/dts/vf610-zii-dev-rev-b.dts has a switch fabric composed of 3 switch devices like this: lan4 lan6 CPU (eth1) | lan5 | lan7 | | | | | [0 1 2 3 4 6 5]---[6 0 1 2 3 4 5]---[9 0 1 2 3 4 5 6 7 8] | | | | | | | lan0 | lan2 lan3 lan8 | optical4 lan1 optical3 One current issue with DSA is cross-chip FDB. If we add a static MAC address on lan3, only its parent switch 1 (the one in the middle) will be programmed. That is not correct in a cross-chip environment, because the DSA ports connecting to switch 1 of adjacent switch 0 (on the left) and switch 2 (on the right) must be programmed too. Without this patchset, a dump of the hardware FDB of switches 0, 1 and 2 after programming a MAC address on lan3 looks like this (*): # bridge fdb add 11:22:33:44:55:66 dev lan3 # cat /sys/kernel/debug/mv88e6xxx/sw*/atu/0 | grep -v FID 0 ff:ff:ff:ff:ff:ff MC_STATIC n 0 1 2 3 4 5 6 0 11:22:33:44:55:66 MC_STATIC_MGMT_PO n 0 - - - - - - 0 ff:ff:ff:ff:ff:ff MC_STATIC n 0 1 2 3 4 5 6 0 ff:ff:ff:ff:ff:ff MC_STATIC n 0 1 2 3 4 5 6 7 8 9 With this patchset applied, adjacent DSA ports get programmed too: # bridge fdb add 11:22:33:44:55:66 dev lan3 # cat /sys/kernel/debug/mv88e6xxx/sw*/atu/0 | grep -v FID 0 11:22:33:44:55:66 MC_STATIC_MGMT_PO n - - - - - 5 - 0 ff:ff:ff:ff:ff:ff MC_STATIC n 0 1 2 3 4 5 6 0 11:22:33:44:55:66 MC_STATIC_MGMT_PO n 0 - - - - - - 0 ff:ff:ff:ff:ff:ff MC_STATIC n 0 1 2 3 4 5 6 0 11:22:33:44:55:66 MC_STATIC_MGMT_PO n - - - - - - - - - 9 0 ff:ff:ff:ff:ff:ff MC_STATIC n 0 1 2 3 4 5 6 7 8 9 In order to do that, the first commit introduces a dsa_towards_port() helper which returns the local port of a switch which must be used to reach an arbitrary switch port (local or from an adjacent switch.) The second patch uses this helper to configure the port reaching the target port for every switches of the fabric. (*) a patch for squashed debugfs interface which applies on top of this patchset is available here: https://github.com/vivien/linux/commit/f8e6ba34c68a72d3bf42f4dea79abacb2e61a3cc.patch Vivien Didelot (2): net: dsa: introduce dsa_towards_port helper net: dsa: support cross-chip FDB operations include/net/dsa.h | 23 +++++++++++++---------- net/dsa/switch.c | 14 ++++---------- 2 files changed, 17 insertions(+), 20 deletions(-) -- 2.15.0 From 1585791397022383755@xxx Sun Dec 03 19:15:26 +0000 2017 X-GM-THRID: 1585791397022383755 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread