From patchwork Sun Jan 20 06:50:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 1028099 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="E9ZBkkBp"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 43j51W2ScMz9sBn for ; Sun, 20 Jan 2019 17:51:11 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730176AbfATGvK (ORCPT ); Sun, 20 Jan 2019 01:51:10 -0500 Received: from mail-eopbgr30066.outbound.protection.outlook.com ([40.107.3.66]:64432 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726775AbfATGvE (ORCPT ); Sun, 20 Jan 2019 01:51: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=LhVdXZRWivjk70wb2jTqSCIz8BtjAJDGwUBTMvZeLIQ=; b=E9ZBkkBpZ6oHEovGH2Da6Y4AvBwAZSRQrv5jeaU5FKN37/IjGosOAPIGfWptdh4fIGGoDnMdBSwSq2pWmlhp9qtp1TmVNeZMlPzl4ibmbFGKcGLNqCgJoq11+2Prg4kLhhXuCJJCYejFic5H/YqEDW145jhEyXZkIgseAhuOvbU= Received: from AM6PR05MB6056.eurprd05.prod.outlook.com (20.179.2.148) by AM6PR05MB4408.eurprd05.prod.outlook.com (52.135.162.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1537.26; Sun, 20 Jan 2019 06:50:51 +0000 Received: from AM6PR05MB6056.eurprd05.prod.outlook.com ([fe80::3411:612a:f48b:a5e2]) by AM6PR05MB6056.eurprd05.prod.outlook.com ([fe80::3411:612a:f48b:a5e2%5]) with mapi id 15.20.1537.031; Sun, 20 Jan 2019 06:50:51 +0000 From: Ido Schimmel To: "netdev@vger.kernel.org" CC: "davem@davemloft.net" , Jiri Pirko , Nir Dotan , mlxsw , Ido Schimmel Subject: [PATCH net-next 10/18] mlxsw: spectrum_router: Update tunnel decap properties Thread-Topic: [PATCH net-next 10/18] mlxsw: spectrum_router: Update tunnel decap properties Thread-Index: AQHUsIx7sqKliNIxk0ePqahn1d8aNQ== Date: Sun, 20 Jan 2019 06:50:50 +0000 Message-ID: <20190120065007.21352-11-idosch@mellanox.com> References: <20190120065007.21352-1-idosch@mellanox.com> In-Reply-To: <20190120065007.21352-1-idosch@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6P192CA0103.EURP192.PROD.OUTLOOK.COM (2603:10a6:209:8d::44) To AM6PR05MB6056.eurprd05.prod.outlook.com (2603:10a6:20b:ab::20) 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; AM6PR05MB4408; 6:Xhfyfa/0zIARyo/HVjn+JgmlFVLdHUVCajiN/kLI6cldqinPsXx6UC9h9LXUqPgZDN6hJIC51okgtF5W2aSmc9yme+WW89ihHkgN0sCF6SHrJsohbkzyytNAfpnzSLQqT/EdNyAwvOhHY0zZsbxlZbYx3knhqqCL+SkvtsdO1qqo06f0L13nnYGvv1XizIe4cKCmUYKc2X/8QhgpF8fQJUUDQnxpzfYx3PfdO/gmG/LM+xk78DAVrikCqN5+xd18insvGz+pN4N+S0UpB/Wq+FCRegOcR3ccYpUAYkCJq5quEoGp2BSW7N/nltFCMrSxSMH8zvD7q/Kft0rRRIc9Da30he8poiYfsX3d5DJrnrU2JLkhwcYh3mrHJMZ7QFi2Ev3c/lKroGcG+G52m3m/A9v2mnv9IYEv5nxMZ7OVOkwtQKFmRwJsiMGp6wsAEZnrjjywdelVZYXC+63bn5hx/g==; 5:n0H1HvJ1WUxTT9Q2zdkjq34tyVdIMVFe15B+sR07OCet1Lsmd7WQb8AUf5uc9nPWb0blGduVw/0JFkXixQ1RqEklPeHh1p6WbGOY4c3rDSvnGBJkpCjuDpsNAdSUif3q46cok8hjEP0LsDMYPKhNBlBio3UR0sNFJcqVCzmdMBMDitMZbh+Fu/oetLpdnxenjib4hzNIzqQqpCpWiFS1WA==; 7:uB3ol7GF4EYfVONpAJxFbcIelGpJKfOn+SYTQc58gSjo6N2pq/u7ZKjyYoqmB/2ZBN3IxRJ5mKqxu3HnROIJh3EuIQ7Z48fDGj0/r/QDxuuNnserXnn9W4hEAqn7jy8OxTJRPJgeW205Avr8shE13w== x-ms-office365-filtering-correlation-id: 5b381292-0df7-4e57-73ae-08d67ea39d4b x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600109)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:AM6PR05MB4408; x-ms-traffictypediagnostic: AM6PR05MB4408: x-microsoft-antispam-prvs: x-forefront-prvs: 0923977CCA x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(39850400004)(376002)(366004)(136003)(346002)(199004)(189003)(8936002)(66066001)(2351001)(106356001)(105586002)(7736002)(81166006)(1730700003)(81156014)(305945005)(8676002)(316002)(54906003)(6116002)(6512007)(3846002)(99286004)(14454004)(478600001)(1076003)(66574012)(486006)(53936002)(4326008)(107886003)(71190400001)(256004)(25786009)(71200400001)(68736007)(102836004)(36756003)(186003)(26005)(6916009)(476003)(2616005)(50226002)(11346002)(446003)(6486002)(6436002)(5640700003)(386003)(6506007)(2906002)(52116002)(76176011)(2501003)(97736004)(86362001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR05MB4408; H:AM6PR05MB6056.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX: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: dDEljHBmTsKjW1S8Ocm1SExqtQtrZDMih/vqeumTIQh4/8gqNOw+nXSObpYD4uRjtq9MjprN5aQkkHM01KDstA+LYZjlW2ZDdJcjI0KmUH56BFiaTtA9DnsM2DD/KQftyTlh/I9n89l76l/RmlTZalBOWP8j7fraUW3buQJIRzOpbPgiOzJewRpU9VGeGYF+8C5pkQHcYn9kOgdQZZtmyAcnoMOEUJ5sxdSwEhU5m6g4GqVd3dMSM7rMsuaVAbX3MJ0uiXp5kmfkY0d+XbHj65+8wG6uxTKww7AHrfd53TzZ+wYBiyxSzE7GAT/Cy1bWvl6K51gBH/0f7mUR2vY4Nsh++xtYNHm6zhsVz+zsFETCrT8iz9asnUNtQqXNhgzRqca292Scv60KajL4k2xDsiZwN/xLSteU1kJHwtBYh9c= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5b381292-0df7-4e57-73ae-08d67ea39d4b X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jan 2019 06:50:49.8084 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB4408 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Nir Dotan Spectrum-2 requires to specify the egress RIF when setting tunnel decap properties. Add a method for accessing the underlay RIF index and then use it when setting decap properties. Signed-off-by: Nir Dotan Reviewed-by: Petr Machata Signed-off-by: Ido Schimmel --- drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c | 2 ++ drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 5 +++++ drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h | 1 + 3 files changed, 8 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c index 00db26c96bf5..6400cd644b7a 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c @@ -145,6 +145,7 @@ mlxsw_sp_ipip_fib_entry_op_gre4_rtdp(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_ipip_entry *ipip_entry) { u16 rif_index = mlxsw_sp_ipip_lb_rif_index(ipip_entry->ol_lb); + u16 ul_rif_id = mlxsw_sp_ipip_lb_ul_rif_id(ipip_entry->ol_lb); char rtdp_pl[MLXSW_REG_RTDP_LEN]; struct ip_tunnel_parm parms; unsigned int type_check; @@ -157,6 +158,7 @@ mlxsw_sp_ipip_fib_entry_op_gre4_rtdp(struct mlxsw_sp *mlxsw_sp, ikey = mlxsw_sp_ipip_parms4_ikey(parms); mlxsw_reg_rtdp_pack(rtdp_pl, MLXSW_REG_RTDP_TYPE_IPIP, tunnel_index); + mlxsw_reg_rtdp_egress_router_interface_set(rtdp_pl, ul_rif_id); type_check = has_ikey ? MLXSW_REG_RTDP_IPIP_TYPE_CHECK_ALLOW_GRE_KEY : diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c index 4316afc2c043..bee9aeb0a07e 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c @@ -6263,6 +6263,11 @@ u16 mlxsw_sp_ipip_lb_ul_vr_id(const struct mlxsw_sp_rif_ipip_lb *lb_rif) return ul_vr->id; } +u16 mlxsw_sp_ipip_lb_ul_rif_id(const struct mlxsw_sp_rif_ipip_lb *lb_rif) +{ + return lb_rif->ul_rif_id; +} + int mlxsw_sp_rif_dev_ifindex(const struct mlxsw_sp_rif *rif) { return rif->dev->ifindex; diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h index 3dbafdeaab2b..cc1de91e8217 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h @@ -29,6 +29,7 @@ struct mlxsw_sp_rif *mlxsw_sp_rif_by_index(const struct mlxsw_sp *mlxsw_sp, u16 mlxsw_sp_rif_index(const struct mlxsw_sp_rif *rif); u16 mlxsw_sp_ipip_lb_rif_index(const struct mlxsw_sp_rif_ipip_lb *rif); u16 mlxsw_sp_ipip_lb_ul_vr_id(const struct mlxsw_sp_rif_ipip_lb *rif); +u16 mlxsw_sp_ipip_lb_ul_rif_id(const struct mlxsw_sp_rif_ipip_lb *lb_rif); u32 mlxsw_sp_ipip_dev_ul_tb_id(const struct net_device *ol_dev); int mlxsw_sp_rif_dev_ifindex(const struct mlxsw_sp_rif *rif); const struct net_device *mlxsw_sp_rif_dev(const struct mlxsw_sp_rif *rif);