From patchwork Wed Jan 23 14:32:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 1029986 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=mellanox.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=Mellanox.com header.i=@Mellanox.com header.b="pK68e0rF"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 43l78F4BTgz9s4s for ; Thu, 24 Jan 2019 01:34:05 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727001AbfAWOeE (ORCPT ); Wed, 23 Jan 2019 09:34:04 -0500 Received: from mail-eopbgr00083.outbound.protection.outlook.com ([40.107.0.83]:49032 "EHLO EUR02-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726435AbfAWOdE (ORCPT ); Wed, 23 Jan 2019 09:33:04 -0500 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=OfcYLNYTEqzuK+nCjTyFH25D/kNHCYTgo0Drx0HR9vE=; b=pK68e0rFz/hczJG+nCVeEtvqf/Go4D75YVc+a9T40WM1eEtcop+dgjfbxHg6BInuVwb/DArlFhA4d645vsBiFF3NSqjq7nQR5rRqt70UsaIHfV0pU6wzpbBdL3PZGckjB1CVfZEH1QYBjasnXmGyBH0PB8XomdI4/O6ReUaTJE8= Received: from DB7PR05MB4940.eurprd05.prod.outlook.com (20.176.235.152) by DB7PR05MB5721.eurprd05.prod.outlook.com (20.178.105.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1537.26; Wed, 23 Jan 2019 14:32:59 +0000 Received: from DB7PR05MB4940.eurprd05.prod.outlook.com ([fe80::6161:97fd:d315:7b07]) by DB7PR05MB4940.eurprd05.prod.outlook.com ([fe80::6161:97fd:d315:7b07%5]) with mapi id 15.20.1537.031; Wed, 23 Jan 2019 14:32:59 +0000 From: Ido Schimmel To: "netdev@vger.kernel.org" CC: "davem@davemloft.net" , Jiri Pirko , Petr Machata , mlxsw , Ido Schimmel Subject: [PATCH net-next 4/4] mlxsw: spectrum_nve: Enable VXLAN on Spectrum-2 Thread-Topic: [PATCH net-next 4/4] mlxsw: spectrum_nve: Enable VXLAN on Spectrum-2 Thread-Index: AQHUsyiJI8gsTpE5EE2Vha1oBsbbfQ== Date: Wed, 23 Jan 2019 14:32:59 +0000 Message-ID: <20190123143217.17735-5-idosch@mellanox.com> References: <20190123143217.17735-1-idosch@mellanox.com> In-Reply-To: <20190123143217.17735-1-idosch@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6P193CA0009.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:3e::22) To DB7PR05MB4940.eurprd05.prod.outlook.com (2603:10a6:10:1e::24) authentication-results: spf=none (sender IP is ) smtp.mailfrom=idosch@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.20.1 x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB7PR05MB5721; 6:dV9ErCxT6m8g9mqRH31WcuIr9xeRCObKIgAVovNDEDx5VvCr6MrKvO2Z9Dg2Vzy8DLdOMNR0ApH08TSBT+/3Ir8Xhm64jA0VUhh+vnhmhdXpR9cGMRgSoUG31WMNvqrKv2qjOSbtkJJB9+SBLASTnLl6iQEcldVtUPxXMuNgpXs4jSjezba414/qu4Nr7IjWlHM3eJidzXJg73Zj638r1OCTRNFlqWK0LbSTyAVJWI/KUJRPWnXJVROs+x0PI61ZDbqwINXUVu/IOCz00urIEI+w6SMuDGxHgZJpoC7N1+hXwuRxcNlAsMTKWi0Vt5TGrgOIGks/aEFc+s9ujeuNAJGqq9P/4Kx99BdEvTHRJlqFJm+T918cf86OPntUVb0ufjeAjIND0Tj2KR5D+V3V28UB3B+01iKEePO5axKp9CZvxbQJn8QWXEZhaL+3d/VSiIu3ciZXORrdr4qZhIXGkA==; 5:jGyuCXg6LyzxLahyXhAxew7EDYh96mP8vSpdMRUgb63wTOwOfCa3KUYZ+p/PjVHXuEWGuxdde2JmgatpakxW+4duy5OK8xhcl7uT0Ep2NYMi1+BY0tuMgzJY1pcQnKVj/1Zf3a2WXDtsz94NWp1jtwiYmVRfpFUYTc4meGtbRj78bnyXHlD6rMezXYPoxBD1sy2P7Tk3di0ktmHrBu83/g==; 7:djRvhr8LAwW3acgO3ZxQjouGkymSayoS1p+KBDbo8LNr4RbedsNqL80YapvdDLVcHs7mDmavo6JfPQf6lQ447oy41JMT1fT2opyUPiOiwLWzABAh6qFkoNfLWfGBFw15kFI/Dxdp/RZpmuMWDO2u7g== x-ms-office365-filtering-correlation-id: 8d42956a-1dcd-4282-e84e-08d6813fabda x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600110)(711020)(4605077)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:DB7PR05MB5721; x-ms-traffictypediagnostic: DB7PR05MB5721: x-microsoft-antispam-prvs: x-forefront-prvs: 0926B0E013 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(346002)(396003)(376002)(39860400002)(136003)(189003)(199004)(53936002)(6512007)(1076003)(8936002)(50226002)(6486002)(8676002)(1730700003)(68736007)(81156014)(97736004)(6506007)(5640700003)(14454004)(386003)(305945005)(7736002)(2906002)(54906003)(81166006)(25786009)(256004)(76176011)(6436002)(186003)(86362001)(102836004)(66066001)(11346002)(6916009)(446003)(2351001)(4326008)(99286004)(316002)(71200400001)(71190400001)(486006)(106356001)(105586002)(2616005)(476003)(26005)(52116002)(36756003)(2501003)(478600001)(6116002)(3846002)(107886003); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR05MB5721; H:DB7PR05MB4940.eurprd05.prod.outlook.com; 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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: KDFUMg9+HGKFrOrXlulPmCq4BXt26+/9xo8mo46RUA24uCqhCAtDJQLbAetu2U0hEUqtHvHW34rVDGMrsGQszNcHgRhoZipa9MN7CKF+bg5bcmDY+vnRZ8EA+SSjMRY6QCzagF3hUcXr1qXiwPZzt1u3MidtGgFtuQ8A20pCYpCV6vDWjmgiaQIHMqItK80FR7YHx6xy19KMWb7Gdyip81pk3FpXXDyVp9qolH/bxIwGAK6OvmRsnOF91CbvHr4m2UciJVgJtRbubA2cmjHqHGMylD4hSChAR/OAUyyztK7nTwp9OGzwGppCpHP30OCzcJCsb2SiEkLwofnl7Hh0dVMNXbT2ByKwefS7nEytzwEbGyRIpz4/HBqW1sVEx5SssZSJ2RjB1POvFP50/3bxj8VRuY7loV+o1JxAj6lNLr8= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8d42956a-1dcd-4282-e84e-08d6813fabda X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Jan 2019 14:32:57.7551 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR05MB5721 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Enable VXLAN on Spectrum-2 as previous patches added the required functionality. Note that for now Spectrum-1 and Spectrum-2 use the same function to determine whether the VXLAN configuration is valid or not. In the future, when the driver will be extended to support features not present in Spectrum-1, two different functions will be needed. Signed-off-by: Ido Schimmel Reviewed-by: Petr Machata --- .../mellanox/mlxsw/spectrum_nve_vxlan.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c index 91b3c71bf031..93ccd9fc2266 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_nve_vxlan.c @@ -21,9 +21,9 @@ #define MLXSW_SP_NVE_VXLAN_SUPPORTED_FLAGS (VXLAN_F_UDP_ZERO_CSUM_TX | \ VXLAN_F_LEARN) -static bool mlxsw_sp1_nve_vxlan_can_offload(const struct mlxsw_sp_nve *nve, - const struct net_device *dev, - struct netlink_ext_ack *extack) +static bool mlxsw_sp_nve_vxlan_can_offload(const struct mlxsw_sp_nve *nve, + const struct net_device *dev, + struct netlink_ext_ack *extack) { struct vxlan_dev *vxlan = netdev_priv(dev); struct vxlan_config *cfg = &vxlan->cfg; @@ -240,7 +240,7 @@ mlxsw_sp_nve_vxlan_clear_offload(const struct net_device *nve_dev, __be32 vni) const struct mlxsw_sp_nve_ops mlxsw_sp1_nve_vxlan_ops = { .type = MLXSW_SP_NVE_TYPE_VXLAN, - .can_offload = mlxsw_sp1_nve_vxlan_can_offload, + .can_offload = mlxsw_sp_nve_vxlan_can_offload, .nve_config = mlxsw_sp_nve_vxlan_config, .init = mlxsw_sp1_nve_vxlan_init, .fini = mlxsw_sp1_nve_vxlan_fini, @@ -248,13 +248,6 @@ const struct mlxsw_sp_nve_ops mlxsw_sp1_nve_vxlan_ops = { .fdb_clear_offload = mlxsw_sp_nve_vxlan_clear_offload, }; -static bool mlxsw_sp2_nve_vxlan_can_offload(const struct mlxsw_sp_nve *nve, - const struct net_device *dev, - struct netlink_ext_ack *extack) -{ - return false; -} - static bool mlxsw_sp2_nve_vxlan_learning_set(struct mlxsw_sp *mlxsw_sp, bool learning_en) { @@ -374,7 +367,7 @@ static void mlxsw_sp2_nve_vxlan_fini(struct mlxsw_sp_nve *nve) const struct mlxsw_sp_nve_ops mlxsw_sp2_nve_vxlan_ops = { .type = MLXSW_SP_NVE_TYPE_VXLAN, - .can_offload = mlxsw_sp2_nve_vxlan_can_offload, + .can_offload = mlxsw_sp_nve_vxlan_can_offload, .nve_config = mlxsw_sp_nve_vxlan_config, .init = mlxsw_sp2_nve_vxlan_init, .fini = mlxsw_sp2_nve_vxlan_fini,