Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1840059pxb; Mon, 13 Sep 2021 06:42:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxIo1duV70GuarhsqwLHNCQprkCosH2Wx9jLkYcb48fBwmxm2eIfAG/J6cAtSgiQgaaN+h4 X-Received: by 2002:a92:130a:: with SMTP id 10mr7774072ilt.186.1631540530742; Mon, 13 Sep 2021 06:42:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631540530; cv=none; d=google.com; s=arc-20160816; b=HEzmTms8PBE+XG7kWMTFTYzCOcwUyCEaogcGmK52YAKTQbETsRpuQlEeeXOeL5VwVK 4Lx/5LzYpFrByjdcogjyJu28Ry3G6UDVKU7bT7r+dG9klSMSXVV1Ti8dQio5RFogR9Y1 mXQg9U0KsiNOdM4N8m/jmQoLS8HPykCiSzaL7Nd044cJgXJIlJSv1Xt/kdHPGYPrj6dt xp7ByVTfefo6mg/TCjeqLSMZD9vYEMDccCkR0vdOjBbGvjn6AXgBpt4Em+VdB5HSmc9a X9dcyOQTw6/IMb66ai3x6Fbi08x9HAbiMDkLGLyparU8U/PzeX+LoiEmOYzeQvsZYyk7 rl1w== 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=dFSCPh4nZ0u8ycE6z4PWZM2c1nc8lto4PXJyQwR+Ma0=; b=TpcnwpOGtQzriw+Yz3kPbK33vZ+rPfXhXIkX5xpR3JhUDEN1wlkQ8weqA+d+JWcZiS lAo3kKIotERueKB4p7tFpx/dK4wNoVv+BqxeOoqOUxzgruXBjq4JBfetKLGbmPrZJAdL uSWUg6sCJoGsL4cysDbZqijfSp8exMHTncG0wSdNFbJPJuEjC+yxSqpOVJOb6r8JX0r1 lzfTeIZ1TWcOrNrM6iSV+PsLY1exqeWBzOcySb/wELREvlIHp9rRkQgR2kvuzk4yanxz 4f7uC6euu8Dxp4hT/WK41rndTwvOzbuxIHQwag19dHWWFDSitnoDARB+Ot1TkajTikwN HW3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aKBCLAQO; 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 186si6694396jaf.38.2021.09.13.06.41.57; Mon, 13 Sep 2021 06:42:10 -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=aKBCLAQO; 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 S242044AbhIMNl5 (ORCPT + 99 others); Mon, 13 Sep 2021 09:41:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:37714 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242250AbhIMNgT (ORCPT ); Mon, 13 Sep 2021 09:36:19 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8DB28613AC; Mon, 13 Sep 2021 13:27:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631539656; bh=Xw2Wt6X/rzdPEGy4bOISnM3fwO99gSGxHky3mCEX4CI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aKBCLAQOLLCQ5eG85c3aHo0KSP4Nz4SqJ7VAb53I1vgyUC/4J4+wp+zWdwPKErch3 uKQnYr+r2YYOsCCm1DoGDtbYhbJ8bgrj6vgCTQzDvjKC/geR5GPoPoBfxb+Xn4N5HX bN3fYRXPukVoaHsHHgi/lZpee/2NhUfvB1t/7SuU= 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.10 109/236] net/mlx5e: Block LRO if firmware asks for tunneled LRO Date: Mon, 13 Sep 2021 15:13:34 +0200 Message-Id: <20210913131104.047840925@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131100.316353015@linuxfoundation.org> References: <20210913131100.316353015@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 6b4a3d90c9f7..6974090a7efa 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c @@ -2803,6 +2803,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++) { @@ -4928,7 +4936,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 af8f4e2cf21d..70a3664785f8 100644 --- a/include/linux/mlx5/mlx5_ifc.h +++ b/include/linux/mlx5/mlx5_ifc.h @@ -876,7 +876,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