Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3624721pxb; Mon, 24 Jan 2022 13:47:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJxCWvKGOS03YQTqORCHyk/KbHQcK2ThmnZwJYu2cmAm4DwzXkeqXK6cI21Lsx+yln3zMTA8 X-Received: by 2002:a65:5b84:: with SMTP id i4mr13184784pgr.59.1643060789051; Mon, 24 Jan 2022 13:46:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643060789; cv=none; d=google.com; s=arc-20160816; b=KJTMR9cXU+BECZXihPU1ewyEFWcXv2j1REbep9aUJd3GS4altDlsWmyR44nSnOBK60 DTGRg/5z2z2OUvzH5cdSOvPjltFNE5Z5wWRzcVOUqwELagUcVxsSb/OTrAAUXEetays3 +SBNkP1Qv+EZz8etO+qHPdq/lni3Jyw/SX2dFi175l/i9ke4RxAxIMLNcTJ+Q403E8RE N//3wqYCXcG2uaroLAWfiO8kwV00vQdRYyGIyJJ3OBXrHh0DBpxOcsbfS5A5sp5bx5U/ 8v3SAnne1L/6RxNUe4spj54ssarx/1V9KB/bWgenKOn/p+njRrVRmyyWlEuVsADs0iKS MNnw== 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=Y/qRZ9Q6H8ftvRdGBvEq2rOtonMvonl6gLVdJolA0G0=; b=GBkMJcRfLA3FYmaDvXeIdz1R8EMWoHQxa80OXy8qGAT34DyiogGWgCMHfYeh5Kp/Js zY7GtZmWp9/UWJyCeppgiTJVgGZDBklrakLdoRAksRkwT8p1zAO24JHOyyZRVM/IzPCT 1UkqBrQnR8ZbDOODzEi8TOHUBfsjbtvrpArIe5ejUjhLtElRWc+SeinVaHkYwxJ/ljyT b0mc487YzutTuOWqnnShRhfpW4gFJKuDp2qsjL+qCTRd5VYYYIJChVl2NzyFa6cwGe3i Km2vt6QVyefHYz38Ni4R/TtMKiZgxn1HBGlW/eZvdEiz+/BEIN/nn9tPgJvAAt1cnxhE OEXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GDLO6lAd; 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 u1si14206049pge.729.2022.01.24.13.46.17; Mon, 24 Jan 2022 13:46:29 -0800 (PST) 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=GDLO6lAd; 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 S1452776AbiAXV0d (ORCPT + 99 others); Mon, 24 Jan 2022 16:26:33 -0500 Received: from dfw.source.kernel.org ([139.178.84.217]:42360 "EHLO dfw.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1391751AbiAXUsb (ORCPT ); Mon, 24 Jan 2022 15:48:31 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C3E1C60B03; Mon, 24 Jan 2022 20:48:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A061EC340E5; Mon, 24 Jan 2022 20:48:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643057310; bh=SDi7XQa+z8hhY9e0ahfyHw+jU0VjxJ7j6c3Gh+na9HI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GDLO6lAdqTcX4vxMENuGmQpx88pVFG/WUaqw0NEc16mpuTWhujkwQTDzAAkJLowK9 y1zlSfkAn/rxsXo8Z2jHYiSnh3H/s2GNGfejLPE3m1J3UchoH+Br6963GO3z3hECy/ gQW8tTYu55iO+/rGlsaylGV2GpLbzrF0Bc+CWPDY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Guillaume Nault , Jakub Kicinski Subject: [PATCH 5.15 771/846] mlx5: Dont accidentally set RTO_ONLINK before mlx5e_route_lookup_ipv4_get() Date: Mon, 24 Jan 2022 19:44:48 +0100 Message-Id: <20220124184127.561936108@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184100.867127425@linuxfoundation.org> References: <20220124184100.867127425@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: Guillaume Nault commit 48d67543e01d73292e0bb66d3f10fc422e79e031 upstream. Mask the ECN bits before calling mlx5e_route_lookup_ipv4_get(). The tunnel key might have the last ECN bit set. This interferes with the route lookup process as ip_route_output_key_hash() interpretes this bit specially (to restrict the route scope). Found by code inspection, compile tested only. Fixes: c7b9038d8af6 ("net/mlx5e: TC preparation refactoring for routing update event") Fixes: 9a941117fb76 ("net/mlx5e: Maximize ip tunnel key usage on the TC offloading path") Signed-off-by: Guillaume Nault Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */ /* Copyright (c) 2018 Mellanox Technologies. */ +#include #include #include #include @@ -229,7 +230,7 @@ int mlx5e_tc_tun_create_header_ipv4(stru int err; /* add the IP fields */ - attr.fl.fl4.flowi4_tos = tun_key->tos; + attr.fl.fl4.flowi4_tos = tun_key->tos & ~INET_ECN_MASK; attr.fl.fl4.daddr = tun_key->u.ipv4.dst; attr.fl.fl4.saddr = tun_key->u.ipv4.src; attr.ttl = tun_key->ttl; @@ -344,7 +345,7 @@ int mlx5e_tc_tun_update_header_ipv4(stru int err; /* add the IP fields */ - attr.fl.fl4.flowi4_tos = tun_key->tos; + attr.fl.fl4.flowi4_tos = tun_key->tos & ~INET_ECN_MASK; attr.fl.fl4.daddr = tun_key->u.ipv4.dst; attr.fl.fl4.saddr = tun_key->u.ipv4.src; attr.ttl = tun_key->ttl;