Received: by 10.223.164.202 with SMTP id h10csp263746wrb; Thu, 30 Nov 2017 09:57:39 -0800 (PST) X-Google-Smtp-Source: AGs4zMZjSDeeFxTMG/JWD5p8lYSQkwFSWgA4uaJE5IY6mesFDnKmgBlb01Hlx4oL94Jo2AvjvRPc X-Received: by 10.101.101.216 with SMTP id y24mr3264324pgv.236.1512064659343; Thu, 30 Nov 2017 09:57:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512064659; cv=none; d=google.com; s=arc-20160816; b=U0pQjTYnyOzQP5Ynt4qg8Pu1bWjd1mzRo3dlug/jRtvBpL2ceokQEywQHW7E+wQ7VL apm71+pblBU3MgpIcLwLv0GfuqtqHZ4FRNvI+Y2EEa4D7ULY1KNwgEpfC3ErtQWRrid7 Pos8yN0aJqD7Tx8skCcsb2XhbSh+yh8Hxn0QTIGkQq+q79/GSDrZxZychDrwSg/UqiWD rg1U85QISc62XHL9Lb25rsUZBPQpwEs/mlj4ewmxjlZwxnGmhkG6tXo9ASuI6067FH0k xI3KpK92A273vQudMjwSKPFGXlUoQypwvAuoOF2YUW8/qCXwaK9yu8IsoifuXZn5oWFL xqOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=FaV2yagYISJR3yc2iy11YWtAtLi0R7CzCK+/peRaSOU=; b=WwmhCpQy0aIuh8mXxsGkNbk0EqiBIwapOHU/sPz8x8I56083i3EQqgvBkRa8do3p1S dBVJO6L6SlbZIgDjCEvU75m6tGZUiqIEKiRCkQOCIsRawSZhvHJS7/wEafC50VmHJ2xP hP4U/dxj1xssJwDp4gYwx21bfw46K5qL3EItNA+FF5GIdFY2yw9XV45EHfeJcb8qmrfJ m2qPjz2HE2Sw9HpfOzGAka/t7PRMp2IOVUVzn5vKaPCXR6A50QEA3QNLrEGDSXsKjoBy UliaBae/zjwqxuPHf0HUsAJOl2eHiKdvL58PIYPI7dtZJbVraWJ6HTk/98OQwuqHrSWA Kdyg== 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 r10si3559659pli.600.2017.11.30.09.57.26; Thu, 30 Nov 2017 09:57:39 -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 S1754026AbdK3R46 (ORCPT + 99 others); Thu, 30 Nov 2017 12:56:58 -0500 Received: from mail.savoirfairelinux.com ([208.88.110.44]:58260 "EHLO mail.savoirfairelinux.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753904AbdK3R4x (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 56B279C31AE; 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 9Wd-RJQUeKRV; 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 A813E9C28F7; 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 b766qQkNOr3H; 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 72C449C31A7; 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 2/2] net: dsa: support cross-chip FDB operations Date: Thu, 30 Nov 2017 12:56:43 -0500 Message-Id: <20171130175643.14022-3-vivien.didelot@savoirfairelinux.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171130175643.14022-1-vivien.didelot@savoirfairelinux.com> References: <20171130175643.14022-1-vivien.didelot@savoirfairelinux.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When a MAC address is added to or removed from a switch port in the fabric, the target switch must program its port and adjacent switches must program their local DSA port used to reach the target switch. For this purpose, use the dsa_towards_port() helper to identify the local switch port which must be programmed. Signed-off-by: Vivien Didelot --- net/dsa/switch.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/net/dsa/switch.c b/net/dsa/switch.c index 29608d087a7c..de1dddc320ff 100644 --- a/net/dsa/switch.c +++ b/net/dsa/switch.c @@ -83,29 +83,23 @@ static int dsa_switch_bridge_leave(struct dsa_switch *ds, static int dsa_switch_fdb_add(struct dsa_switch *ds, struct dsa_notifier_fdb_info *info) { - /* Do not care yet about other switch chips of the fabric */ - if (ds->index != info->sw_index) - return 0; + int port = dsa_towards_port(ds, info->sw_index, info->port); if (!ds->ops->port_fdb_add) return -EOPNOTSUPP; - return ds->ops->port_fdb_add(ds, info->port, info->addr, - info->vid); + return ds->ops->port_fdb_add(ds, port, info->addr, info->vid); } static int dsa_switch_fdb_del(struct dsa_switch *ds, struct dsa_notifier_fdb_info *info) { - /* Do not care yet about other switch chips of the fabric */ - if (ds->index != info->sw_index) - return 0; + int port = dsa_towards_port(ds, info->sw_index, info->port); if (!ds->ops->port_fdb_del) return -EOPNOTSUPP; - return ds->ops->port_fdb_del(ds, info->port, info->addr, - info->vid); + return ds->ops->port_fdb_del(ds, port, info->addr, info->vid); } static int dsa_switch_mdb_add(struct dsa_switch *ds, -- 2.15.0 From 1585511111327166277@xxx Thu Nov 30 17:00:25 +0000 2017 X-GM-THRID: 1584302672956416146 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread