Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2110497ioo; Mon, 23 May 2022 10:16:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJztEygIOib86c4WzlND+YGHmEf/sMMSm9Csr0FPmjhFsY5v9XOxiPMgGAC/fuGKVa5BPXU4 X-Received: by 2002:a17:903:213:b0:162:15c2:e4b5 with SMTP id r19-20020a170903021300b0016215c2e4b5mr9283817plh.114.1653326167236; Mon, 23 May 2022 10:16:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653326167; cv=none; d=google.com; s=arc-20160816; b=P157MdSMsB4epz+fkCamZwYruKI4dFWT+ZJ/PCNIYi+cuyMSLySxos+u8UMYTczZuF PZAWtNNnpxOx53Nf/w8uW2QE0q+WnemcXa9l7FWfDq9ZNGIzfUQmh9mXsR1MSx43BePB d65VynQzb2PkFRw8zON69hKrRTQ8DTPk5jmOEBpS64eaNUUy38vnA0PKvyHwPxfGT1rB 2NZoHxlngiAlFlW34XQwJL445tFfYbzl4NepyyzYtMbAlx08dEF3PgifgddfM6t32+OH SDu9WgVBzQghi03oDGPj3L1hGA/nRUrJqdlUNAjjnGtK/RbXcSxBXusU/XJIw6GoX4xu aCgg== 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=mVb2CXEtWjNij9v2OYmlf0P86sIPvrmPrF5iGy8L4gc=; b=wlHPw+f+n/YzL4ftIu1eVZss3fhU7FwLAVMH+xwrR6ThYVVhrnZIr6FZosiqL/S46r SsiG7k6vYfgD3tZe82sj3+3tJvH/vRLIA8G4C5K/iyJthPCzRcYDrAzKkOqunkLTucia 0JW7i0oYALulO8qDXu68ydbSK1Af9sgP4m8v808/cB3RmmTNEtdcvQ98AaxN0Yd+QAVY ojh8e8sPa2WJ896FbG2OIzvpEuf/8WYvG64MG4/onFz+b7Rt7jUybDXHvkZKifaGhk4i In4lWOLnVYcyjyKjz47PBo3qnGaO6PEVApjdcfG8mXwkfBPVmKsJHKtQ9lBIGeygBW/i REpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Sl+K99nh; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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. [23.128.96.19]) by mx.google.com with ESMTPS id b14-20020a6567ce000000b003f9d9fae1b4si10503566pgs.802.2022.05.23.10.16.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 10:16:07 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Sl+K99nh; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 2685471A35; Mon, 23 May 2022 10:15:42 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239586AbiEWRO7 (ORCPT + 99 others); Mon, 23 May 2022 13:14:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240689AbiEWRMg (ORCPT ); Mon, 23 May 2022 13:12:36 -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 A5E7D657F; Mon, 23 May 2022 10:11:53 -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 42924B81205; Mon, 23 May 2022 17:10:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 78BC4C385AA; Mon, 23 May 2022 17:10:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1653325845; bh=WQ6IbxlW3LrNya8zSBCdZn07hds9I9oyLxUT7lwwvtc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Sl+K99nhZzBHOxJWSVYqz9TRmQutQE7dNH3Ny4Iv5mz6VhNPMAGPvkPT4z29NA2LL vRzn8wPpuoLxLvr0mvW7YYNR1Q7FNe87+ST7V0nMj/DxsMeeoDcnPcJ9l6B5bLX5pu Na+lBV5EuGScMgx79t+JDdmhvrfVIimvj8IAyLa4= 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 4.19 28/44] net/mlx5e: Properly block LRO when XDP is enabled Date: Mon, 23 May 2022 19:05:12 +0200 Message-Id: <20220523165758.240884429@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220523165752.797318097@linuxfoundation.org> References: <20220523165752.797318097@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 5979fcf124bb..75872aef44d0 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c @@ -3739,6 +3739,13 @@ static netdev_features_t mlx5e_fix_features(struct net_device *netdev, netdev_warn(netdev, "Disabling LRO, not supported in legacy RQ\n"); } + 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