From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ido Schimmel Subject: [PATCH net 3/4] mlxsw: spectrum_router: Relax GRE decap matching check Date: Thu, 6 Dec 2018 17:44:52 +0000 Message-ID: <20181206174427.4952-4-idosch@mellanox.com> References: <20181206174427.4952-1-idosch@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Cc: "davem@davemloft.net" , Jiri Pirko , Nir Dotan , Petr Machata , Ido Schimmel To: "netdev@vger.kernel.org" Return-path: Received: from mail-eopbgr40059.outbound.protection.outlook.com ([40.107.4.59]:16160 "EHLO EUR03-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725948AbeLFRpM (ORCPT ); Thu, 6 Dec 2018 12:45:12 -0500 In-Reply-To: <20181206174427.4952-1-idosch@mellanox.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: From: Nir Dotan GRE decap offload is configured when local routes prefix correspond to the local address of one of the offloaded GRE tunnels. The matching check was found to be too strict, such that for a flat GRE configuration, in which the overlay and underlay traffic share the same non-default VRF, decap flow was not offloaded. Relax the check for decap flow offloading. A match occurs if the local address of the tunnel matches the local route address while both share the same VRF table. Fixes: 4607f6d26950 ("mlxsw: spectrum_router: Support IPv4 underlay decap") Signed-off-by: Nir Dotan Signed-off-by: Ido Schimmel --- drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/driver= s/net/ethernet/mellanox/mlxsw/spectrum_router.c index 9e9bb57134f2..6ebf99cc3154 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c @@ -1275,15 +1275,12 @@ mlxsw_sp_ipip_entry_matches_decap(struct mlxsw_sp *= mlxsw_sp, { u32 ul_tb_id =3D l3mdev_fib_table(ul_dev) ? : RT_TABLE_MAIN; enum mlxsw_sp_ipip_type ipipt =3D ipip_entry->ipipt; - struct net_device *ipip_ul_dev; =20 if (mlxsw_sp->router->ipip_ops_arr[ipipt]->ul_proto !=3D ul_proto) return false; =20 - ipip_ul_dev =3D __mlxsw_sp_ipip_netdev_ul_dev_get(ipip_entry->ol_dev); return mlxsw_sp_ipip_entry_saddr_matches(mlxsw_sp, ul_proto, ul_dip, - ul_tb_id, ipip_entry) && - (!ipip_ul_dev || ipip_ul_dev =3D=3D ul_dev); + ul_tb_id, ipip_entry); } =20 /* Given decap parameters, find the corresponding IPIP entry. */ --=20 2.19.1