Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp3672125lfo; Mon, 23 May 2022 11:00:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCJ7Fw4P69jm1+ul/+QZs1jnMV6v5cFgnhan/khx4VnnnKgQioQ1fEgMb2pz9DHzmxhV1F X-Received: by 2002:a62:fb0e:0:b0:505:fd9e:9218 with SMTP id x14-20020a62fb0e000000b00505fd9e9218mr25052818pfm.78.1653328809882; Mon, 23 May 2022 11:00:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653328809; cv=none; d=google.com; s=arc-20160816; b=AAopcAFUxrqfEAaKeHSM00sUo+GXg3pY4t6hR60lDYDnr5+1yM81OCByqD0iprvnWN FdD2ULHJF9bqPKtE2/6Z/mRknz0JGm8R24wv6LTvRWtASmZXrmQYeoQd/aDpwkUv0TLo Ft4kEuv08TmI19AM971noZYUvOhHKb5w4vA9/tXRd0YrOsbwvlbWx0CV6UsgIkAHfoQV ngs7S/132nwaeCKsnbP53TnLzouYab4DlWijXhAkt594T2Gox16lBshQpNpOGBtELJNc 6FMAvO7ezmcEMPjQTwG2QCyMJjrmCYkfhKJOdX27T2B21cJdPgBe7sXLTk2j94T6EIdw 18/w== 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=e62iE7ivRi2ClQC8FA1HZU4NJZm3tBBiNmrVrSsHli0=; b=MR/Qv/CqSV40+pQlCDIb8UWSUFx6yL8TKPFKY3YIH8gljSYfbkJjOAONOYBoK5hfed PruYNTPmSMOfZ8vTpOxszG0wDGPnQlBKFHBPHJYASXgQKsBECjAN/cDNjcWJAfDP272e vPiquRygayM7owx0KIKNVH35QEPfO1Sqe9tgHI0WaVEfq94ltkd4D6YX7j+w70kTUXkb GDoPTQL7lUTnAEl9AH9iAmS0rjGT1WcUghveFJVymXfpu/CqSgsyhciSkH6/CMIJJcSj YComdVhDdka3yJRmmc8N6mKarW1gfZz7YJjNt1rJd09l1VMdyZrlM9GngVnp3zqP55jk ECBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Fes8fK5L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id w3-20020a170902e88300b0016198140119si12038064plg.606.2022.05.23.11.00.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 11:00:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Fes8fK5L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4A906128178; Mon, 23 May 2022 10:59:10 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241236AbiEWRy1 (ORCPT + 99 others); Mon, 23 May 2022 13:54:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241376AbiEWR0o (ORCPT ); Mon, 23 May 2022 13:26:44 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6D7B71A3C; Mon, 23 May 2022 10:21:45 -0700 (PDT) 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 ams.source.kernel.org (Postfix) with ESMTPS id E5546B811CE; Mon, 23 May 2022 17:13:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3EB3FC385A9; Mon, 23 May 2022 17:13:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1653326027; bh=/GDkSZHAzbamarORSCxgSsnl12Nd3mgbPNSPPbVHg7c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Fes8fK5LbUrLEr7aim30OdLeOsGhYW5LFPCoJaLi8dHZsMF5lexDKgMV36fArRzXx Hy/mqBFj+pSmEUXtsz69yu67iDE6zFPilRpC6mtxoaOLXDp6328QlVi+CNJUFZ8Fg9 ik8mR7HRsOCQp1PDmmkmyqwovp/27aIMQH8BEE3g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Maxim Mikityanskiy , Tariq Toukan , Saeed Mahameed , Sasha Levin Subject: [PATCH 5.4 44/68] net/mlx5e: Properly block LRO when XDP is enabled Date: Mon, 23 May 2022 19:05:11 +0200 Message-Id: <20220523165809.884987901@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220523165802.500642349@linuxfoundation.org> References: <20220523165802.500642349@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Maxim Mikityanskiy [ Upstream commit cf6e34c8c22fba66bd21244b95ea47e235f68974 ] LRO is incompatible and mutually exclusive with XDP. However, the needed checks are only made when enabling XDP. If LRO is enabled when XDP is already active, the command will succeed, and XDP will be skipped in the data path, although still enabled. This commit fixes the bug by checking the XDP status in mlx5e_fix_features and disabling LRO if XDP is enabled. Fixes: 86994156c736 ("net/mlx5e: XDP fast RX drop bpf programs support") Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Sasha Levin --- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c index 2465165cbea7..73291051808f 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c @@ -3980,6 +3980,13 @@ static netdev_features_t mlx5e_fix_features(struct net_device *netdev, } } + if (params->xdp_prog) { + if (features & NETIF_F_LRO) { + netdev_warn(netdev, "LRO is incompatible with XDP\n"); + features &= ~NETIF_F_LRO; + } + } + if (MLX5E_GET_PFLAG(params, MLX5E_PFLAG_RX_CQE_COMPRESS)) { features &= ~NETIF_F_RXHASH; if (netdev->features & NETIF_F_RXHASH) -- 2.35.1