Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3972687pxb; Tue, 25 Jan 2022 00:20:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJwPQjL8+Cp1npQyTxFlPQ/RVRcbVwmXE04LnMtknH+P/snoCJ01LW4ipKNHI2jMIBB9SKA7 X-Received: by 2002:a17:907:971a:: with SMTP id jg26mr15516655ejc.571.1643098831615; Tue, 25 Jan 2022 00:20:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643098831; cv=none; d=google.com; s=arc-20160816; b=MCMITBz5Ja53/0w0rGjBZXavziG2jM6YB5+GxlSxthsQFnr8yGw3E1OBongupm3GTf rRZPzM4IZxEXnQFvshO4OUvszX8GIdx4ejgCGhgJgNva/8q/AgNM1D0cSjRlem7+/dGA U2gLiK7e5GRJhcPzviLyy0HfPstoRwwbt0XGux5qDaac9JFFe4qiSPQVp1cbby9S/shk 5FyX/fFb/4lvlVc2fLH3/1DnFvaD1sd5S2ngx87OSg7AYUoZ0IRwjzMuC8njo+khGagk c3yO1TDxjkZv8XhNmKqKbzi6PJ4HyZJU1lV2FeBWedoUdKZ2kVmsTT0g/una8+nUVfb1 ez3g== 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=/wdMPmhskn0ANOgE7Muhlt4xOxTqsZH7Ehm1vaT0VjY=; b=WZoEgHq6MuCAwSIiY251SVRIZv+wRfxYCOpcqaoCvozcqmv3ejar6N2/sgRFfatl99 +yxHdNCSst0LdGYcwkFxkIPr6G5eZ8DOGOhc7Y6Q/SED6eMlsgGynQ3EdkHuFQLvEqG0 ZMGOXeFVzIlLi+D+DMN+cRhoY6MWUEEAcUkrcqe9EDOi/bhLICGqSdpX3yPC1aO9iiH+ 0lfJ8+KB95Pteul6XzmUfnt7JtST1A/29z2K/5z3NV/blJYbP8z4X2+Mbgqm8w16xTSB hQrTBkF40e0ppYd48sHyjjcHYwiEvjtgD3S9Fw4gBr0x0wUsHytW8AMb4he+yIiyx6ST 4CMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ANO0HvrL; 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 oz16si22724ejc.791.2022.01.25.00.20.07; Tue, 25 Jan 2022 00:20:31 -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=ANO0HvrL; 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 S3412931AbiAYAiB (ORCPT + 99 others); Mon, 24 Jan 2022 19:38:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2364075AbiAXXqo (ORCPT ); Mon, 24 Jan 2022 18:46:44 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69D12C061341; Mon, 24 Jan 2022 13:42:10 -0800 (PST) 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 0794161502; Mon, 24 Jan 2022 21:42:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1BA0C340E4; Mon, 24 Jan 2022 21:42:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643060529; bh=3gCsW3Bzejtk0VzmibWuV4DlZ1YanDbwS2MEgP2bdzU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ANO0HvrLUVzHNLYlaAxKKFzMb5l21Yt3r5WYR3Rm4apozDZ3xIOWdOxe0B86Q60Ik o9kRAzmPR1eOsufLe+/Buk++nVC92baJcmoADiijk+s9HImv8RVX8sPm9uRSPK2Ffn ejucKZ0t+HxG9abW/4ap711yPKRwCwYbXCK3ExdE= 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.16 0946/1039] mlx5: Dont accidentally set RTO_ONLINK before mlx5e_route_lookup_ipv4_get() Date: Mon, 24 Jan 2022 19:45:35 +0100 Message-Id: <20220124184157.094780705@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@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 @@ -235,7 +236,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; @@ -350,7 +351,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;