Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp3681478lfo; Mon, 23 May 2022 11:15:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwrA+0GiY8TVNBo0Ig3hnHBeGgyG1vPmvBWajmLhI5xx6bzlPIoLMTuIbCb6x1cQAGpqwrr X-Received: by 2002:a63:1412:0:b0:3f2:7a68:2819 with SMTP id u18-20020a631412000000b003f27a682819mr20991231pgl.299.1653329746306; Mon, 23 May 2022 11:15:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653329746; cv=none; d=google.com; s=arc-20160816; b=TCg1nPpax4fFtTQX9FsOEDAsfqRxaDsKAmXBcoI1Cdxr0OD06f+QXxGAqgFkA9I3EB +fsev3uQqvpaGIhnWP+Moql4rPFpopW/lRjy44rPrnQdA+cGMU9+3o9BjIcI46a8tBZY 6j61pUE03A2TrWvIWcRwR+fIB1eDZldLSLBqG6F4DwAkNxJxI2YvPHuxD0KHF9e+U5bT uE2EeDTBlsYe25YltIyY6cU3Bl2HHtq62nlzde3FBKwfyCuJ8uEgL+W4fKPJG1P82EXp 6KxioTiFuLxcy68KAAEhva5tI793em7QYr3h8T7Vrh6SFOHkIIVgBUYZJwJzEvGpQt2m Qp7w== 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=4hl10LjpLyoHeTUiyZkSpF2+G3PGRIkNfJAIzApVZIo=; b=ADexq2vKT6CRBznTV1Pdz9hxJSUtyDemtk9tbiX+QIYvP1Qv3E8W5rEmX25dtti/qJ jf++P3kh8W6kSDoumWlKzM6ix2eM5DSJf6I6NmLGMv3qSxGrWsH5h7UtbzQ+HkfRbfXO dfUnhAMypxGYAxzIlwdm3QcoEvh88I4Ebguma2scZqpTM6IKrCVBV6BiQMcfjP6f/3YS 2rLRvWaDGM4UA+wHs9L1T540suQpZgFGtpteJDfH+1bHACKdBwfTJFVWVvFFJmaoDx8j 5OqxiKrxH/k+2KwxDFF9IGvdcbo1SSuc/uK6Nat0v10Zy/fwZB4NieGq4m0MX+grDeEZ DDcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pX5F67BA; 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 r18-20020a63d912000000b003f5d7e95185si11458294pgg.280.2022.05.23.11.15.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 11:15:46 -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=pX5F67BA; 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 584CC15E482; Mon, 23 May 2022 11:13:58 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243669AbiEWSEF (ORCPT + 99 others); Mon, 23 May 2022 14:04:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241784AbiEWRgD (ORCPT ); Mon, 23 May 2022 13:36:03 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70EEB8FD66; Mon, 23 May 2022 10:30:03 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 083AD611E6; Mon, 23 May 2022 17:29:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ECC61C385A9; Mon, 23 May 2022 17:29:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1653326941; bh=iGoQwlvfqcP4hlbNazx0sB6oj/lSpmf3r72OruQpJEs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pX5F67BAIAgjk+rZs3MTzb41JQvqrCDsLk0Ibd86Gy8zpq/ANFGMimiElHbNAJfXg Xj7k4RVJhW+8Xipth2bhbEqWlZuijpd6fak1CHgRYhSCTJtrd7Q4SaYEnkP3HAek6i CTcVQ2cnJEsB4MsPk/dM1p2XRY+DQ5bYjg/3qoac= 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.17 107/158] net/mlx5e: Properly block HW GRO when XDP is enabled Date: Mon, 23 May 2022 19:04:24 +0200 Message-Id: <20220523165848.887505261@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220523165830.581652127@linuxfoundation.org> References: <20220523165830.581652127@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 b0617e7b35001c92c8fa777e1a095d3e693813df ] HW GRO is incompatible and mutually exclusive with XDP and XSK. However, the needed checks are only made when enabling XDP. If HW GRO 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 and XSK status in mlx5e_fix_features and disabling HW GRO if XDP is enabled. Fixes: 83439f3c37aa ("net/mlx5e: Add HW-GRO offload") 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 | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c index 1f8fc8d77bc3..4b83dd05afcd 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c @@ -3870,6 +3870,18 @@ static netdev_features_t mlx5e_fix_features(struct net_device *netdev, netdev_warn(netdev, "LRO is incompatible with XDP\n"); features &= ~NETIF_F_LRO; } + if (features & NETIF_F_GRO_HW) { + netdev_warn(netdev, "HW GRO is incompatible with XDP\n"); + features &= ~NETIF_F_GRO_HW; + } + } + + if (priv->xsk.refcnt) { + if (features & NETIF_F_GRO_HW) { + netdev_warn(netdev, "HW GRO is incompatible with AF_XDP (%u XSKs are active)\n", + priv->xsk.refcnt); + features &= ~NETIF_F_GRO_HW; + } } if (MLX5E_GET_PFLAG(params, MLX5E_PFLAG_RX_CQE_COMPRESS)) { -- 2.35.1