Message ID | 902ef3b817280b600af552d2c2cb468c2dae3944.1529931885.git.petrm@mellanox.com (mailing list archive) |
---|---|
State | Accepted |
Delegated to: | Ido Schimmel |
Headers | show
Return-Path: <linux-mlxsw-bounces+patchwork-linux-mlxsw=patchwork.kernel.org@lists.ozlabs.org> 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 7FA8E603B5 for <patchwork-linux-mlxsw@patchwork.kernel.org>; Mon, 25 Jun 2018 13:30:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 755EC2807B for <patchwork-linux-mlxsw@patchwork.kernel.org>; Mon, 25 Jun 2018 13:30:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 741CA28173; Mon, 25 Jun 2018 13:30:27 +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.0 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, MAILING_LIST_MULTI, RDNS_NONE, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from lists.ozlabs.org (unknown [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 D03992807B for <patchwork-linux-mlxsw@patchwork.kernel.org>; Mon, 25 Jun 2018 13:30:26 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 41Dqmb6X82zF14s for <patchwork-linux-mlxsw@patchwork.kernel.org>; Mon, 25 Jun 2018 23:30:23 +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="VfWSLkXF"; 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=104.47.1.60; helo=eur01-ve1-obe.outbound.protection.outlook.com; envelope-from=petrm@mellanox.com; receiver=<UNKNOWN>) 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="VfWSLkXF"; dkim-atps=neutral Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0060.outbound.protection.outlook.com [104.47.1.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 41DqmN64PszDrq6 for <linux-mlxsw@lists.ozlabs.org>; Mon, 25 Jun 2018 23:30:12 +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:X-MS-Exchange-SenderADCheck; bh=W4Lo9AM4DtpJhHavkfw4pdLHbrgQglAhnpsnxcYZ9l8=; b=VfWSLkXFMtrnDuQhaOG+1GI0e2hh4/Y8HUdYhMXwtEz8yfg8uIZBQpUrO2dej8K2/k1zMu6DGETmEjKqaKJqYKyTuYKykAUSSF03oYpHO96g3tAhw+4C9PraTjPlh3QB29cHHeBEyVVqylhtBBXRBFCh+Gs8MSU0zJ8zPUpFQ2Q= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=petrm@mellanox.com; Received: from t540p (78.45.160.211) by AM0PR05MB4179.eurprd05.prod.outlook.com (2603:10a6:208:57::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.884.20; Mon, 25 Jun 2018 13:30:05 +0000 From: Petr Machata <petrm@mellanox.com> To: <linux-internal@mellanox.com> Subject: [PATCH net-next mlxsw 2/2] mlxsw: spectrum_span: Change LAG lower selection In-Reply-To: <cover.1529931885.git.petrm@mellanox.com> References: <cover.1529931885.git.petrm@mellanox.com> Message-Id: <902ef3b817280b600af552d2c2cb468c2dae3944.1529931885.git.petrm@mellanox.com> Date: Mon, 25 Jun 2018 15:29:59 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 X-Originating-IP: [78.45.160.211] X-ClientProxiedBy: LO2P265CA0075.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:8::15) To AM0PR05MB4179.eurprd05.prod.outlook.com (2603:10a6:208:57::28) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e4089c19-3329-40d1-647b-08d5da9fc336 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600026)(711020)(48565401081)(2017052603328)(7153060)(7193020); SRVR:AM0PR05MB4179; X-Microsoft-Exchange-Diagnostics: 1; AM0PR05MB4179; 3:wCM8beg97DCwGYJMWDzghS0UZDzw55zNT7rPNh60BPS6FS8oDmHpJxXCATmJ/A7ykuUGIldmMjhqdWToAwAWkmPvD+7z9IT9Lwx0gkWHbqX7SQNrcCP9PPiOOLLR/inRfbNauwqmT8/JNAoRUN89omW++lnemKFkhQjz1ivu9B8CO6KPyFzdYBvGWmzw2EMeJzq/Ng4EFJM/dtmt2Y/bYDhXrsVGvM9dc13McytAlMoB48yfSsWb84myUAzWMz1b; 25:ls/j5EEddjL38+uWnzP/HhBI0MZQ9eZEi/IOWtiP2sYwrzI35jOV74DlDMQaAbOZ5X/Pt4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Z2jO/3vRxzKqSjbjOSQgyCF5BJXPsu; 4:3bOdpE8Xw533bhndUcZw45JJ5LzfZ3MLhIMouCE7dDdlpQjsKwB8K0axUJLnbU/UWkjtBF9YlInlpFC4+tG5JJO7VdqSfnx37QkWNNFLU3x8Z062JudFs0o95gKFA25NjBGYC+QfKk2xm0edPIgzD1Tg7RWbWJCUUP/FTxpcOc22X8Wf49gTe5uy2MYtQM+wGoxytGYiDnXq7hrtHfBJ3lvgsNKKj1uqXwdrD31loNmj5WtcXuFvYCj68SnVbCqTcFZ9m3FWGiMT/iqBLTmlhg== X-Microsoft-Antispam-PRVS: <AM0PR05MB417997DDA1EBC48E3570889EDB4A0@AM0PR05MB4179.eurprd05.prod.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(3231254)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(20161123558120)(20161123562045)(6072148)(201708071742011)(7699016); SRVR:AM0PR05MB4179; BCL:0; PCL:0; RULEID:; SRVR:AM0PR05MB4179; X-Forefront-PRVS: 0714841678 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(39860400002)(346002)(396003)(366004)(376002)(39380400002)(189003)(199004)(58126008)(8676002)(105586002)(97736004)(478600001)(316002)(16586007)(37006003)(2906002)(118296001)(68736007)(2351001)(25786009)(48376002)(47776003)(6486002)(50466002)(305945005)(81156014)(81166006)(8936002)(36756003)(956004)(7736002)(66066001)(53936002)(16526019)(106356001)(186003)(26005)(76176011)(6862004)(59450400001)(6116002)(3846002)(6666003)(6636002)(386003)(11346002)(5660300001)(6496006)(51416003)(476003)(2616005)(446003)(86362001)(52116002)(486006); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR05MB4179; 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; AM0PR05MB4179; 23:evgTtUy06A4oUgFjsjF5NdgWROPGEBQFORcxyRgjt?= =?us-ascii?Q?LFEVHlPV1ekbG7nznkgM67TL/Z701jSwBQ9EE9AmfY62cJNrLTbDGOoswMTZ?= =?us-ascii?Q?LotgehuplxR900b+GLZ1wrqGZ6skI9TtScN4W8wotqBt7OBP6Bzm90RGvnlU?= =?us-ascii?Q?eKqk+HKze7xOo/l35GrKnguPO3QJIzLj9IraRjtDT6v76s4D93JyZz9HWHtj?= =?us-ascii?Q?7n+GiIaeHGEApagi9dwLGxls6dT2P21E8p5gKyj/tHOv572IQbv7L5eavKxy?= =?us-ascii?Q?s4mfwgpreYVg1S4Nr9Nyh2Fo7nR8qP8voNRii22RFiepd5tZ4EWl5FVxCFZs?= =?us-ascii?Q?UftWPOoXeBGSRunExLUQAmSNajQfU7DRbTbn9qilEAfhioDnIugpKIolA0z0?= =?us-ascii?Q?Pw8kPInowl49Z0DelNLpQpw1lZlM/J+FVcRVxR8Eid0ciWc/NVTaLtsbHdc8?= =?us-ascii?Q?HKDKx0PEnaggCD6E1zesTAL9zymejLam9kGaRiCV7xtEVoSDqk3lTWBjAoO9?= =?us-ascii?Q?KX2nsQThfuSpewhUa6zYPC6eJy2U4CA02nDZTsWZpUeGDDMmuVFTUnxe4dNH?= =?us-ascii?Q?IqmXpUuG/rsHY/XKfZhkjen5rqrMhpo8GAVgj2WkR12h/8hkPxSl9bMQbxOs?= =?us-ascii?Q?Fb/aWRZonloxsNz6D9veHi+kA4qRIHjQLOtH864VOPMBLmnlR6vjDtMLMGj6?= =?us-ascii?Q?EIMqyCWbkw9gyep7VmaeZdX90RXBrCI5Vxik2BZzDYY1l+VmAdD1+kNXHqQJ?= =?us-ascii?Q?4//AWOjdrv6N24QaSGiwBqcegz1223MUwJJApCi4WOsButrXGqUK0djFvqgA?= =?us-ascii?Q?PRIxY+EUv9Ms7vZk8guqgk1OkVPxaV3rWDySBRCtl6hovh2Q5OdeVK4tX3oR?= =?us-ascii?Q?eJWetmo18GTIAikvzslU1OvDQsThEBZF1NP4mv4BJkPvoha4TU/+CDHsod1A?= =?us-ascii?Q?1dSfCYsOfbVjVVdly6SzvLu7bqQhC6D0IsFsNrm9udz7OuG9RMdFBx6gG8f9?= =?us-ascii?Q?tQg8RDOkteNc2Gga3+JO9NrSkzmQjkplQXgDNSy6/djhi/f7ES1qJeDryJcK?= =?us-ascii?Q?499DTV+MCEYwP2kvd1eixG51CiYA6J6/koIwA9LE2ESCP13DMRobrbftygXY?= =?us-ascii?Q?Wweke3ImggEuBIfKxBb4bQzfw9kbx4Jj2qtzpnk6tbvFlWN1vbSMlHG/J+fD?= =?us-ascii?Q?yp233drawBKEDCVtlopzjfmRMN9K/y8FzQYehTFQOaVEf3XZpl+idWPYuu/g?= =?us-ascii?Q?VfE5MaGR1d4M0oqa6w=3D?= X-Microsoft-Antispam-Message-Info: eX63CAQ/jiIB4lAprloLpnlMXxJpfGsYF2ujfPd9dCftGodLlGT23F+S4tRkx9RLJSi9SWRkC++0fJeYhHQi0gr03mCJrcLyPHkNsYFcgpMW6PqxNe3uqWuYgn2M47PVJW8Mk4hcVBsoSaxHKKeO9LZqcOsmQNSEOiDA0naFg5vy3pWCTQodumRbEhtsYYmlcXe5Zixw1j4wVgslRF7Njyg7sbQQyrcXjjfKewcdW6vTRxqDSap0AvAuTLRWhrMUnzO/gvHmfsKF3qfG+7VjCIcFlQc3vYId+lO9pthCN5Y9u/Wg9EyDMMqlRd6rmiNOlfQyVr3vrkI8NCcGdRS1ILvm5Tac6O+lVi07gZyWrWc= X-Microsoft-Exchange-Diagnostics: 1; AM0PR05MB4179; 6:5HqzFeSHHxbTH3W3d77lyl3R46QIjHZOht0m5ufZvqsf8fqp2W3yHyq/i3T2YstGAWNvFqKYMWNe4RHbzNc/rm8R3qbILDI8fK3Hs0IREcT4h/ZLyVOLT6/HBYG0QUyJmbCV5uWuPrgW8tcY1zni6ir61QXQ9rZ4IzxM05BtMLO33HYVzS8kVZcF8IQLZbU1LVGAeOvcgtpIFKyKbKcguN6WeNX2Ck/Caqj//Zqh1hN+840UjTca8SkELE6tIAaW6KPK8NwStN5TeO8m7Vtlxbm4rj4K6FXncf7ylvpBUuG6tfQssijG2sFhxuM157/p4MPSepNnI1V0x2gffg/yWyqGave4PC9NLcasLFszrbbUHfq1Pk1JUmbvxy3qxvzXfz6KjL4OhkX0pnzjKjOKPZlg5lci1Bo4KK+2tn9iF7WNxgMVlUF/DtDSMQT0qhWPaKhhZ3/eTv/e73i4ODAL9Q==; 5:wXJetFeGPrCG/BZKSEjK58SMKlmLYqHSodaA+ja3GV+sDPbhi5jtEcYOZGIWmwFZJD9tXIv/1zhB0hsEYD0BB2jzus3veTQUJ3ycmLTNZaoGibqEzJ9xCHSsYZu49Ec0mA0jsh/qGYkRUGS8gW+E7EzLnaSOkK9hFA+k1uHV4Ig=; 24:iQ1hbEHeQlTC89VP6svRuB/df1v9NJyIYUg00Ub2QyvdwjfhZrp14d8M9v88FjJ4HdtR7QKMPgs83L7XrqgajkCWkJHurG/oxbhUiv3OJMY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM0PR05MB4179; 7:AoXsnh2n+yYNbWnxqmqYLA/l9VRMSEe2s7jFvmY3tyECYX4SFgR0dhK7u9DsmWb5D3yYi6ew0hxIGjg6w4/wTUsIargZKc04n01jAL7dLuvpWxkl7lWPlWRFMSnISJMqvOGgcNE8Qze10yKetdZ3wF7GXYCsUAbHKQhS2vpK5oCndYULcFOrGjerYR+KeSQakG6ZTheYXlq+skHvnAXK0hpqy+8cjhWnNLQzbMI1yisavGXOC5Lbya/oKU6Ht8cR X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jun 2018 13:30:05.0382 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e4089c19-3329-40d1-647b-08d5da9fc336 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB4179 X-BeenThere: linux-mlxsw@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: mlxsw driver development <linux-mlxsw.lists.ozlabs.org> List-Unsubscribe: <https://lists.ozlabs.org/options/linux-mlxsw>, <mailto:linux-mlxsw-request@lists.ozlabs.org?subject=unsubscribe> List-Archive: <http://lists.ozlabs.org/pipermail/linux-mlxsw/> List-Post: <mailto:linux-mlxsw@lists.ozlabs.org> List-Help: <mailto:linux-mlxsw-request@lists.ozlabs.org?subject=help> List-Subscribe: <https://lists.ozlabs.org/listinfo/linux-mlxsw>, <mailto:linux-mlxsw-request@lists.ozlabs.org?subject=subscribe> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: linux-mlxsw-bounces+patchwork-linux-mlxsw=patchwork.kernel.org@lists.ozlabs.org X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c index 3d187d88cc7c..e42d640cddab 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c @@ -36,6 +36,7 @@ #include <linux/list.h> #include <net/arp.h> #include <net/gre.h> +#include <net/lag.h> #include <net/ndisc.h> #include <net/ip6_tunnel.h> @@ -254,7 +255,9 @@ mlxsw_sp_span_entry_lag(struct net_device *lag_dev) struct list_head *iter; netdev_for_each_lower_dev(lag_dev, dev, iter) - if ((dev->flags & IFF_UP) && mlxsw_sp_port_dev_check(dev)) + if (netif_carrier_ok(dev) && + net_lag_port_dev_txable(dev) && + mlxsw_sp_port_dev_check(dev)) return dev; return NULL;
When offloading mirror-to-gretap, mlxsw needs to preroute the path that the encapsulated packet will take. That path may include a LAG device above a front panel port. So far, mlxsw resolved the path to the first up front panel slave of the LAG interface, but that only reflects administrative state of the port. It neglects to consider whether the port actually has a carrier, and what the LACP state is. So instead of checking upness of the device, check carrier state and txability. Signed-off-by: Petr Machata <petrm@mellanox.com> --- drivers/net/ethernet/mellanox/mlxsw/spectrum_span.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)