Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp161286pxb; Mon, 13 Sep 2021 15:56:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxvEt7+t9NUi/vS5Xk/l8LAUODVmc/sJh0blgH+xlxVxQ78uPYG9Wm7T1jO0G7yKBh/2H/ X-Received: by 2002:aa7:d0cf:: with SMTP id u15mr13853888edo.43.1631573779226; Mon, 13 Sep 2021 15:56:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631573779; cv=none; d=google.com; s=arc-20160816; b=w49O/5Ks5y0B2vN49R2uPWMyeNXMWLJD7KPiE/l7ehC7M654qVcRpUZ7zEEH//tyZ6 b4NfzUFkDbhfu9lnMCshNFLY1U6id0Yeka7g513XWA1TGMEPVROu8dVitedzKdU/xdqy fOCBhD3K5ZXe2ykBt9DGUOKxX5N/oLeD1hq5IRgfk0HjlZmvYyNGHNfDKf3whTKtVDth H+zBAdGdbbpEk4Q6W8z5+MMfFWfb0NzBZXq4vvYOtajoRwzw0v6Mt+O+5lduBNk953QY u5+wbzAw10pcc/cWWSxJ0IjgbtdYO8brgTfjnte3S6AVvQJXrFOrM6nNuRnzUKyYsn3e 8m2g== 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=CHWOaBuyHfgdsEyoIG/8bYfT/ceafG5iYWMlGwzYnWw=; b=vZ1sUWcXOW3dR0gJ4CTQCdDoBxszONVfg10rHEyXTXcJEAfb76aFdIywnl0mY4yEiz hI35CJlVUAuJKhrqswLboknk0Otnm6bVQrJT0ZBL1Gh2jG1KPXW3mwzDxlur3yznXu5D a4mOTPLOkUqI0Xtwe3yxg/dnaFwmbYBq6Jo0R4o6glmzNlCi/6pra5t0ygCRYPpF9doW PRnwc21vi37aETnfKqS0SKpPjg6IsnWBkBlVTazAFI8sjx8ync31g9J2/VuxoTNjiP3I lB32yQW3OVzp4MTxbrnR2IE1AvTych7fx5OQlbYEDtu+SkTXTCDr0HqtPE8vZKDmBKft IA7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aXs5+p62; 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 q5si10041939edh.492.2021.09.13.15.55.55; Mon, 13 Sep 2021 15:56:19 -0700 (PDT) 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=aXs5+p62; 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 S1347419AbhIMOe2 (ORCPT + 99 others); Mon, 13 Sep 2021 10:34:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:51900 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346883AbhIMO3y (ORCPT ); Mon, 13 Sep 2021 10:29:54 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 58E8E61B73; Mon, 13 Sep 2021 13:50:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631541043; bh=+Zu1pgGVllMnvRvGzW5ASeV95Xu79FmbpBM3//tfPnM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aXs5+p62qhlxv04nAwDqWjYVKoSrxxII92+OEMSlFCMgeN98BFooJmoc3FHboFIZS Xm1ZEZcVrfiC5MAGKS6tflh837q9OUUUgn4z0IF/Oi5SFfDLdPnOg6HPByqXrX50RV dxrlxePUpGxbqQkGupwGF9l1yavYx8tRpcYvFDSs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Maxim Mikityanskiy , Saeed Mahameed , Sasha Levin Subject: [PATCH 5.14 132/334] net/mlx5e: Block LRO if firmware asks for tunneled LRO Date: Mon, 13 Sep 2021 15:13:06 +0200 Message-Id: <20210913131117.831653275@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131113.390368911@linuxfoundation.org> References: <20210913131113.390368911@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: Maxim Mikityanskiy [ Upstream commit 26ab7b384525ccfa678c518577f7f0d841209c8b ] This commit does a cleanup in LRO configuration. LRO is a parameter of an RQ, but its state is changed by modifying a TIR related to the RQ. The current status: LRO for tunneled packets is not supported in the driver, inner TIRs may enable LRO on creation, but LRO status of inner TIRs isn't changed in mlx5e_modify_tirs_lro(). This is inconsistent, but as long as the firmware doesn't declare support for tunneled LRO, it works, because the same RQs are shared between the inner and outer TIRs. This commit does two fixes: 1. If the firmware has the tunneled LRO capability, LRO is blocked altogether, because it's not possible to block it for inner TIRs only, when the same RQs are shared between inner and outer TIRs, and the driver won't be able to handle tunneled LRO traffic. 2. mlx5e_modify_tirs_lro() is patched to modify LRO state for all TIRs, including inner ones, because all TIRs related to an RQ should agree on their LRO state. Fixes: 7b3722fa9ef6 ("net/mlx5e: Support RSS for GRE tunneled packets") Signed-off-by: Maxim Mikityanskiy Signed-off-by: Saeed Mahameed Signed-off-by: Sasha Levin --- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 15 +++++++++++++++ include/linux/mlx5/mlx5_ifc.h | 3 ++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c index 24f919ef9b8e..b7be1ef4cbb2 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c @@ -2567,6 +2567,14 @@ static int mlx5e_modify_tirs_lro(struct mlx5e_priv *priv) err = mlx5_core_modify_tir(mdev, priv->indir_tir[tt].tirn, in); if (err) goto free_in; + + /* Verify inner tirs resources allocated */ + if (!priv->inner_indir_tir[0].tirn) + continue; + + err = mlx5_core_modify_tir(mdev, priv->inner_indir_tir[tt].tirn, in); + if (err) + goto free_in; } for (ix = 0; ix < priv->max_nch; ix++) { @@ -4812,7 +4820,14 @@ static void mlx5e_build_nic_netdev(struct net_device *netdev) netdev->hw_enc_features |= NETIF_F_HW_VLAN_CTAG_TX; netdev->hw_enc_features |= NETIF_F_HW_VLAN_CTAG_RX; + /* Tunneled LRO is not supported in the driver, and the same RQs are + * shared between inner and outer TIRs, so the driver can't disable LRO + * for inner TIRs while having it enabled for outer TIRs. Due to this, + * block LRO altogether if the firmware declares tunneled LRO support. + */ if (!!MLX5_CAP_ETH(mdev, lro_cap) && + !MLX5_CAP_ETH(mdev, tunnel_lro_vxlan) && + !MLX5_CAP_ETH(mdev, tunnel_lro_gre) && mlx5e_check_fragmented_striding_rq_cap(mdev)) netdev->vlan_features |= NETIF_F_LRO; diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h index b0009aa3647f..6bbae0c3bc0b 100644 --- a/include/linux/mlx5/mlx5_ifc.h +++ b/include/linux/mlx5/mlx5_ifc.h @@ -921,7 +921,8 @@ struct mlx5_ifc_per_protocol_networking_offload_caps_bits { u8 scatter_fcs[0x1]; u8 enhanced_multi_pkt_send_wqe[0x1]; u8 tunnel_lso_const_out_ip_id[0x1]; - u8 reserved_at_1c[0x2]; + u8 tunnel_lro_gre[0x1]; + u8 tunnel_lro_vxlan[0x1]; u8 tunnel_stateless_gre[0x1]; u8 tunnel_stateless_vxlan[0x1]; -- 2.30.2