From patchwork Tue Apr 24 23:09:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Machata X-Patchwork-Id: 10361191 X-Patchwork-Delegate: idosch@idosch.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6A7C4601BE for ; Tue, 24 Apr 2018 23:09:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5784E28D53 for ; Tue, 24 Apr 2018 23:09:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4AF6B28E86; Tue, 24 Apr 2018 23:09:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, MAILING_LIST_MULTI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 44D9328D53 for ; Tue, 24 Apr 2018 23:09:28 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 40VzYL4vRFzF24R for ; Wed, 25 Apr 2018 09:09:26 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=mellanox.com Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=Mellanox.com header.i=@Mellanox.com header.b="mnGZtdsr"; dkim-atps=neutral X-Original-To: linux-mlxsw@lists.ozlabs.org Delivered-To: linux-mlxsw@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=mellanox.com (client-ip=2a01:111:f400:fe0a::61b; helo=eur03-db5-obe.outbound.protection.outlook.com; envelope-from=petrm@mellanox.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=mellanox.com Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=Mellanox.com header.i=@Mellanox.com header.b="mnGZtdsr"; dkim-atps=neutral Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-db5eur03on061b.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0a::61b]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 40VzYD4GFzzF24w for ; Wed, 25 Apr 2018 09:09:20 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=H8rkFHJFZGY8C0P16SbYqoZqpjY8AJ51RbtMQO47lSs=; b=mnGZtdsrDdftSZJadH5dEV5nFfTnVMWgHbyQrmtFCZ0J6hqD27+UGc8EH/sRDiRIyFX01L7erRcQnoljkHmjRATGRynWrRfD3KyL1z6fa2D06YZzhgB50Kb3V5+//cs7zCt5Bsx/IE80Y3vch5VBerJaD/a5Z+HvzCqn+dA2YsY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=petrm@mellanox.com; Received: from t540p (89.177.127.115) by AM6PR05MB4183.eurprd05.prod.outlook.com (2603:10a6:209:40::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.696.14; Tue, 24 Apr 2018 23:09:12 +0000 From: Petr Machata To: Subject: [PATCH net-next mlxsw v2 5/7] mlxsw: spectrum: Pass switchdev VLAN object to SPAN respin In-Reply-To: References: Message-Id: <7aaa2f34b9bdd939df7a374e3e616eac6c918682.1524610426.git.petrm@mellanox.com> Date: Wed, 25 Apr 2018 01:09:07 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 X-Originating-IP: [89.177.127.115] X-ClientProxiedBy: DB6PR1001CA0035.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:4:55::21) To AM6PR05MB4183.eurprd05.prod.outlook.com (2603:10a6:209:40::28) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(2017052603328)(7153060)(7193020); SRVR:AM6PR05MB4183; X-Microsoft-Exchange-Diagnostics: 1; AM6PR05MB4183; 3:SDiCVPxyMKgglDhuNtuG6wm77TQhwfAMWiezVL66tehQbR+LJ76qbpoGwsc8beX/k6buRTX5OIxwbXRUa1/ElsfB31R+B3ER27V9AQgE9F4UKsZO0JgRuib3SKkOHasHZCFwUcGOqWl4JEtdhuVvhvoeZkog4keM1FxtGW77hs579PlrfmJt//8G1cIUo7HU+nh1U/Qm+WVZbqfChzZBGCNSuYmHU906Lo3aS4Jwilz5oXfKlBv6BelBjb3iYtjt; 25:U8L5ovzOR+4FtpjrpkluYCgSd9NSBW8LOb6rHvldo9X/WIxKFT4VAWuUG+lxZeOOOxARSJrfF27livS0KpvMdAmc336zUMafHdzxBjWqB/mT6BfbuIwO/QYoCj2fiNUpsR0JZDZTlpS7EBSI+mGYbas/lTqNFfb0wUrAWAs7b3iLra4at+FvJsPbLR7W2QGEDHAfKJ7PWTSVl1Q7R15AtV1aZTd0G6JKse24lYX2mp8U061OvyoE/Ga188jfEvF9iICgcOffCp+pYfTOl95VOOu2kxNJoay1O38WVnghwJjV26JCmKbpBeqez7/GreNSSa7AkwlJ7V3BefIuIOnv7w==; 31:IDa1qrAJar413TLv5t34ZClIbevnLWPo8iPc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PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(3002001)(93006095)(93001095)(3231232)(944501410)(52105095)(6055026)(6041310)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(6072148)(201708071742011); SRVR:AM6PR05MB4183; BCL:0; PCL:0; RULEID:; SRVR:AM6PR05MB4183; X-Forefront-PRVS: 0652EA5565 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(376002)(39380400002)(396003)(346002)(366004)(189003)(199004)(2351001)(16526019)(25786009)(3846002)(53936002)(118296001)(486006)(6116002)(478600001)(97736004)(446003)(66066001)(476003)(956004)(11346002)(2616005)(6486002)(76176011)(6916009)(4326008)(59450400001)(6666003)(105586002)(48376002)(47776003)(50466002)(81166006)(106356001)(8676002)(316002)(16586007)(8936002)(58126008)(26005)(81156014)(5660300001)(107886003)(386003)(52116002)(7736002)(6496006)(51416003)(86362001)(305945005)(2906002)(68736007)(36756003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR05MB4183; H:t540p; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM6PR05MB4183; 23:WIrgYbNUXGwlCdwaVfLuuXTCM4jCNbRo3ksy+vuIH?= =?us-ascii?Q?bdz8zSFcVrSTY660pt3AoyjcwTDhEuouOrv/9s6f2TpRi70CW5WV3IAglJtj?= =?us-ascii?Q?c1MBy/0K/0VMot3xNUCgrTvCvfXYNkzbUopNhiQpLGrFv3T2NqAR3mCJ0rw5?= =?us-ascii?Q?n8Gfct98FhtW+99fVeC10pwnQHz31tuNMNur3y/lI3w+qBe4HfgTvRMMFA1u?= =?us-ascii?Q?I+tPkoAB0481w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NnbBF?= =?us-ascii?Q?2SBRdq1NpD5FDYCGGrV2SWu8t5p/c/apMgyzkgDxQyuPL01neC5vlyWc5kvh?= =?us-ascii?Q?d2aeBt39QwDb4JhSVVKg4f/fcaLqqkpVyk1ikRxca3klpDtFYFakQeuIw=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Antispam-Message-Info: IytripVdhD01PRXYRkBD7GkHA47PFoDU4j8P1EiaA0sEA3Zl4NCdSNsbbJzBbm0UJ8/9PdZPwneR6xruMtv5z55UanVHaooPntdanWRGpouJ/bDOFT1riJ+flhlUKxZEdLPQwY2QtjHdnQ3YkfO0KhjQWOjtD18d9HIns2jUGbymXmBMGJWCTA0tUKbFyoJg X-Microsoft-Exchange-Diagnostics: 1; AM6PR05MB4183; 6:71k4UpxgwqvBqdBPSK1mnuqhJs7w874BNluhUm4ganSI9AOdkjXuyMutAhBPW79cpk6NLhsB8owEi2lTCnwXFBz4USCNMOz1/hljP19O2XJ7P+Lgb6VxJx2HlnVoB7SrZ4DiWsQQ1lYlp3A0rxfrzrPmJ56cAB5eSePQamaf++fkPNVBIkOfZ2laCES4RtalkOTuQURutMLtj0lTXcDZjoDv5Ayt0BdQx1FFfAaw6jV/ImHP6yzioKsT40MaRgNxaQyzaZyDY+fPiT6dknbzN97ZnL94sq6OyWU/SKLEPlLp6Yq4elT5szqxFSYIxFQmzxYIO5U2cY0vGtO8HKkoZppbYH2x2rl9j7nIPB5Sx9F72eOlJKIAxv6rgDX7uMtcBbmCv0ynW5MVtZMEeesezAiCs63isMTVdKybCg6KlVODwXpP7h/y3VwXCCyuUOvmpIop3fnnxEjqfdg2WK8O3g==; 5:qYgaVhyuq45d9n+h+/pH3na4S0pMV9HOBjAiU7TOLqquNsUB83UWakMhrqsTCgb/OYDFqpTFUgJHgM9FXXC1KMomcjirM6KB+t/Wu3xHTjUgpT8RIFYIUfXqluDWJrvK5XpE842xUUaIe1HNpxl58yQath6KZziuhUzmkoYL/1M=; 24:40XKelz3l0ogFzeIC/z6wocL6aSccjDa9o4vs2Rx5TkBJTpgDxey/t99ClIznAtP138LIHK+lpTQ9kCxYJ8EVym2csiOWWC8EsI1mGFcAEw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM6PR05MB4183; 7:nooq7YAxkWhIiMzW+7h6taXPBJC/PO02xbkvaq66T7vAYFCIAfjspYL431DDwYND/rsKc1c+P5/TtXQp4PnHUE0TMUGMVBE8QrP3cP5C7vfu3EEpwFpNG5cifNZivEGFa4T9QDt75ZD+LdAsPfj8OeeNj6EsGnREQdyEF+DmT8tol6MSbq71J8P/oR0T71NvJelVYN6TytM16YSaPm7HFugcmlB+oRUJKBHQhXIwfhtKTex+uIArKsNVzu8/43gr X-MS-Office365-Filtering-Correlation-Id: d3368b56-26b3-4d9b-15f2-08d5aa3864d3 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Apr 2018 23:09:12.5801 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d3368b56-26b3-4d9b-15f2-08d5aa3864d3 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB4183 X-BeenThere: linux-mlxsw@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: mlxsw driver development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-internal@mellanox.com Errors-To: linux-mlxsw-bounces+patchwork-linux-mlxsw=patchwork.kernel.org@lists.ozlabs.org Sender: "Linux-mlxsw" X-Virus-Scanned: ClamAV using ClamSMTP Because switchdev events are emitted before the changes are applied to the bridge, mlxsw_sp_span_entry_ops.parms() callback wouldn't see the updated value of VLAN flags when respinning due to change in those flags. Thus add a parameter of type struct switchdev_obj_port_vlan to mlxsw_sp_span_respin() and propagate to the parms callback. Pass NULL from all current callers. Signed-off-by: Petr Machata --- Notes: Changes from v1 to v2: - New patch. drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 2 +- .../net/ethernet/mellanox/mlxsw/spectrum_router.c | 6 ++--- .../net/ethernet/mellanox/mlxsw/spectrum_span.c | 28 +++++++++++++--------- .../net/ethernet/mellanox/mlxsw/spectrum_span.h | 5 +++- 4 files changed, 25 insertions(+), 16 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c index 94132f6..96569c1 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c @@ -4640,7 +4640,7 @@ static int mlxsw_sp_netdevice_event(struct notifier_block *nb, if (span_entry) mlxsw_sp_span_entry_invalidate(mlxsw_sp, span_entry); } - mlxsw_sp_span_respin(mlxsw_sp); + mlxsw_sp_span_respin(mlxsw_sp, NULL); if (mlxsw_sp_netdev_is_ipip_ol(mlxsw_sp, dev)) err = mlxsw_sp_netdevice_ipip_ol_event(mlxsw_sp, dev, diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c index 8e4edb6..8cb5c94 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c @@ -2397,7 +2397,7 @@ static void mlxsw_sp_router_neigh_event_work(struct work_struct *work) read_unlock_bh(&n->lock); rtnl_lock(); - mlxsw_sp_span_respin(mlxsw_sp); + mlxsw_sp_span_respin(mlxsw_sp, NULL); entry_connected = nud_state & NUD_VALID && !dead; neigh_entry = mlxsw_sp_neigh_entry_lookup(mlxsw_sp, n); @@ -5677,7 +5677,7 @@ static void mlxsw_sp_router_fib4_event_work(struct work_struct *work) /* Protect internal structures from changes */ rtnl_lock(); - mlxsw_sp_span_respin(mlxsw_sp); + mlxsw_sp_span_respin(mlxsw_sp, NULL); switch (fib_work->event) { case FIB_EVENT_ENTRY_REPLACE: /* fall through */ @@ -5721,7 +5721,7 @@ static void mlxsw_sp_router_fib6_event_work(struct work_struct *work) int err; rtnl_lock(); - mlxsw_sp_span_respin(mlxsw_sp); + mlxsw_sp_span_respin(mlxsw_sp, NULL); switch (fib_work->event) { case FIB_EVENT_ENTRY_REPLACE: /* fall through */ diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c index 65a7770..ac22776 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c @@ -81,6 +81,7 @@ void mlxsw_sp_span_fini(struct mlxsw_sp *mlxsw_sp) static int mlxsw_sp_span_entry_phys_parms(const struct net_device *to_dev, + const struct switchdev_obj_port_vlan *vlan, struct mlxsw_sp_span_parms *sparmsp) { sparmsp->dest_port = netdev_priv(to_dev); @@ -169,12 +170,13 @@ mlxsw_sp_span_entry_unoffloadable(struct mlxsw_sp_span_parms *sparmsp) static __maybe_unused int mlxsw_sp_span_entry_tunnel_parms_common(struct net_device *l3edev, - union mlxsw_sp_l3addr saddr, - union mlxsw_sp_l3addr daddr, - union mlxsw_sp_l3addr gw, - __u8 ttl, - struct neigh_table *tbl, - struct mlxsw_sp_span_parms *sparmsp) + union mlxsw_sp_l3addr saddr, + union mlxsw_sp_l3addr daddr, + union mlxsw_sp_l3addr gw, + __u8 ttl, + struct neigh_table *tbl, + const struct switchdev_obj_port_vlan *vlan, + struct mlxsw_sp_span_parms *sparmsp) { unsigned char dmac[ETH_ALEN]; @@ -230,6 +232,7 @@ mlxsw_sp_span_gretap4_route(const struct net_device *to_dev, static int mlxsw_sp_span_entry_gretap4_parms(const struct net_device *to_dev, + const struct switchdev_obj_port_vlan *vlan, struct mlxsw_sp_span_parms *sparmsp) { struct ip_tunnel_parm tparm = mlxsw_sp_ipip_netdev_parms4(to_dev); @@ -252,7 +255,7 @@ mlxsw_sp_span_entry_gretap4_parms(const struct net_device *to_dev, l3edev = mlxsw_sp_span_gretap4_route(to_dev, &saddr.addr4, &gw.addr4); return mlxsw_sp_span_entry_tunnel_parms_common(l3edev, saddr, daddr, gw, tparm.iph.ttl, - &arp_tbl, sparmsp); + &arp_tbl, vlan, sparmsp); } static int @@ -330,6 +333,7 @@ mlxsw_sp_span_gretap6_route(const struct net_device *to_dev, static int mlxsw_sp_span_entry_gretap6_parms(const struct net_device *to_dev, + const struct switchdev_obj_port_vlan *vlan, struct mlxsw_sp_span_parms *sparmsp) { struct __ip6_tnl_parm tparm = mlxsw_sp_ipip_netdev_parms6(to_dev); @@ -352,7 +356,7 @@ mlxsw_sp_span_entry_gretap6_parms(const struct net_device *to_dev, l3edev = mlxsw_sp_span_gretap6_route(to_dev, &saddr.addr6, &gw.addr6); return mlxsw_sp_span_entry_tunnel_parms_common(l3edev, saddr, daddr, gw, tparm.hop_limit, - &nd_tbl, sparmsp); + &nd_tbl, vlan, sparmsp); } static int @@ -407,6 +411,7 @@ struct mlxsw_sp_span_entry_ops *const mlxsw_sp_span_entry_types[] = { static int mlxsw_sp_span_entry_nop_parms(const struct net_device *to_dev, + const struct switchdev_obj_port_vlan *vlan, struct mlxsw_sp_span_parms *sparmsp) { return mlxsw_sp_span_entry_unoffloadable(sparmsp); @@ -760,7 +765,7 @@ int mlxsw_sp_span_mirror_add(struct mlxsw_sp_port *from, return -EOPNOTSUPP; } - err = ops->parms(to_dev, &sparms); + err = ops->parms(to_dev, NULL, &sparms); if (err) return err; @@ -799,7 +804,8 @@ void mlxsw_sp_span_mirror_del(struct mlxsw_sp_port *from, int span_id, mlxsw_sp_span_inspected_port_del(from, span_entry, type, bind); } -void mlxsw_sp_span_respin(struct mlxsw_sp *mlxsw_sp) +void mlxsw_sp_span_respin(struct mlxsw_sp *mlxsw_sp, + const struct switchdev_obj_port_vlan *vlan) { int i; int err; @@ -812,7 +818,7 @@ void mlxsw_sp_span_respin(struct mlxsw_sp *mlxsw_sp) if (!curr->ref_count) continue; - err = curr->ops->parms(curr->to_dev, &sparms); + err = curr->ops->parms(curr->to_dev, vlan, &sparms); if (err) continue; diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.h index 4b87ec2..9a7806e 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.h +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.h @@ -36,6 +36,7 @@ #include #include +#include #include "spectrum_router.h" @@ -79,6 +80,7 @@ struct mlxsw_sp_span_entry { struct mlxsw_sp_span_entry_ops { bool (*can_handle)(const struct net_device *to_dev); int (*parms)(const struct net_device *to_dev, + const struct switchdev_obj_port_vlan *vlan, struct mlxsw_sp_span_parms *sparmsp); int (*configure)(struct mlxsw_sp_span_entry *span_entry, struct mlxsw_sp_span_parms sparms); @@ -87,7 +89,8 @@ struct mlxsw_sp_span_entry_ops { int mlxsw_sp_span_init(struct mlxsw_sp *mlxsw_sp); void mlxsw_sp_span_fini(struct mlxsw_sp *mlxsw_sp); -void mlxsw_sp_span_respin(struct mlxsw_sp *mlxsw_sp); +void mlxsw_sp_span_respin(struct mlxsw_sp *mlxsw_sp, + const struct switchdev_obj_port_vlan *vlan); int mlxsw_sp_span_mirror_add(struct mlxsw_sp_port *from, const struct net_device *to_dev,