Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp331558pxb; Mon, 16 Aug 2021 06:30:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwb8FXMwHddI/A7F0vf/nWobF02o8277pnzYjI97Y6JXr1wgcGILW9s2YMS96Vn33G8ZxvE X-Received: by 2002:a92:dd82:: with SMTP id g2mr12102480iln.279.1629120611460; Mon, 16 Aug 2021 06:30:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629120611; cv=none; d=google.com; s=arc-20160816; b=xvN2uwW+34D6HG6CAvSSbfhM8whkyQfi9G6qj0wJqrZP1POB7qQoStdIm5IpwxnMvA HzFxaV43vbXCIuN16nYoB2MkJ//SCtUXyHqwjC5qjp5LyDw1o7R+WjgO6ki94EhDuEK5 vNDPuUdaieoou3PE1ln55VGpkliufKRLkoBdZCPr83b9+3cmYSR0seLs4oyyReUhb4r+ Dpb07IMRMzmhBDSYAjRUQp9zQFO0ixFcC+065+b1YEwSAyWVOPgX3ohSuCr1iaCAZe5K foztEZW8NMEOozdpSTIz641Z1iR7jXDfPfgrpZZAdPSwOWVU3Iajbz6d+dr6+KBKfFac RIaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=xAxTkSmNf5fK0NU49SI97RZLAXirg8u5eYqlqS+7yQk=; b=jCI7fanNSqfa7FcGGOnXgHjGk1Hr+91lDJe9kSnQyQBHdz31eHeI/3gY9FaIGJQoSg I531TeVj0uLb0g2wd7/7jU6WYSE+J2/HyS9p4SAcf/JBk6SjR/dKZu/tA3qDGFaXdxag +thqgNX9YkSG+MGTUIVdQMsPETto7vfdK8HHJTnptdhHGKRrTtmynSnF06om6ZUhg2Qt BFyI8dPInU1/9UJX5I/tvt1lc7s3hlU2PtO3pD/FfameLjaTvFWY78o8hEEe1z0AyT1U UzhSL4KWRXmXNVhL1g0Wbrd0/omhI1Ab6eDvoUal3ycHaF5VslfEeR1P5rSvO+f85PYA ODYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ELlnzH6f; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v16si3408618jal.55.2021.08.16.06.29.59; Mon, 16 Aug 2021 06:30:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ELlnzH6f; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238918AbhHPN0Z (ORCPT + 99 others); Mon, 16 Aug 2021 09:26:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:39178 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239876AbhHPNQb (ORCPT ); Mon, 16 Aug 2021 09:16:31 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9717B632E5; Mon, 16 Aug 2021 13:13:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1629119584; bh=YcVE0Oy/cmWLgozty8WMzI/97SELMO6QwLwVTGuNg1M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ELlnzH6fGJjxB1W2MEWjFhkvab+T6WAflB0cOH07Emebfj9IFr+GULJKAGY46GW3O yxo+zvyjwisv1BLl53TB//g1PO/8yPFyaYNNABq5WrHX2KbzvFHydooOl5LUCpEshP Arsne3fGuaUZHN+LcKzuZC8MqBNBOP1i3TMCaP/0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Roi Dayan , Maor Dickman , Saeed Mahameed , Sasha Levin Subject: [PATCH 5.13 082/151] net/mlx5e: Avoid creating tunnel headers for local route Date: Mon, 16 Aug 2021 15:01:52 +0200 Message-Id: <20210816125446.779241357@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210816125444.082226187@linuxfoundation.org> References: <20210816125444.082226187@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Roi Dayan [ Upstream commit c623c95afa56bf4bf64e4f58742dc94616ef83db ] It could be local and remote are on the same machine and the route result will be a local route which will result in creating encap id with src/dst mac address of 0. Fixes: a54e20b4fcae ("net/mlx5e: Add basic TC tunnel set action for SRIOV offloads") Signed-off-by: Roi Dayan Reviewed-by: Maor Dickman Signed-off-by: Saeed Mahameed Signed-off-by: Sasha Levin --- drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c index 172e0474f2e6..3980a3905084 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c @@ -124,6 +124,11 @@ static int mlx5e_route_lookup_ipv4_get(struct mlx5e_priv *priv, if (IS_ERR(rt)) return PTR_ERR(rt); + if (rt->rt_type != RTN_UNICAST) { + ret = -ENETUNREACH; + goto err_rt_release; + } + if (mlx5_lag_is_multipath(mdev) && rt->rt_gw_family != AF_INET) { ret = -ENETUNREACH; goto err_rt_release; -- 2.30.2