From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 06FCFA0577; Tue, 22 Nov 2022 06:13:40 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AFF954114B; Tue, 22 Nov 2022 06:13:39 +0100 (CET) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by mails.dpdk.org (Postfix) with ESMTP id 3D00640A80 for ; Tue, 22 Nov 2022 06:13:38 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Oisl+NGKC5JwXLByTtx1w1isXsjdsR0A631FttsEfbmlMheFWZoJ1yNYzVVpwdU51cSrKw4njPpOYcEm3feHWrNmyRNx2OPtzmIBhYK1twaxESaXrtJcQTtc4jX0PGSYShmazpu9mgAGCOt5cLeJexClrNLpCM24gkODjPc7PjjAKbk92rLr8yLb1D6X2vGlCIl7SmtNS2IvvT3TgN6LYH5iPtLb9kvnJSFauiyQWNzjBiRtSNb309lI+xbjnMxCnPg4qBJTNJbwBCXsA91x1b67Vbcegi7sWeOXL5RKIVaVT6Q8AH/nnM15EBioM4B7IoXgO5djbImKgB3YiE2rfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=kwNncp8WkyzCBieBtlkts3i9s6ixLop5H9yrjZ0TEdQ=; b=JisvV+bCVpgiO4UtzKpk9UjCht/1UqkvKxOLeW4sA61YAvMav8nYkT9Z2LqNe/Zlzhj9Gajx9BNoFCWa6461MS1ua7fm7SqIqDZ6Tu9WFl2dWtikINYXcziCVJGy433noOhy8i7bAENNMkMFzCJhkCdVknxKPGnGAnO05PUVzM02vnTMGGRPAP8uJicUfqI3yhQvw6B5FSnB5IXbY46H1qEMLRmhY35GVCHN9NbuHxQH4e7rxWszZbkWV0S6Q8Cx7MxHMDQoZfeMAcfKqvzlwEq/CDwxV93CoSpaEua8759/5qq2jO7AJaBAUwOTlQgj9LyhCGDFtSHrxWMPFb2jIA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kwNncp8WkyzCBieBtlkts3i9s6ixLop5H9yrjZ0TEdQ=; b=iNBGPf5/hMxuAcen8nayQCU41tXLeFCb3/2rqy68mKkADCJfdrGm6MWHJYgLPwTAqTet9H+EgNexlwXqVIYWtTEiYcndxudVfftlfoE1JkLmYv+CO1E6dIPLVfBZrDBCPEJxq+Qu3dTiOyR4bJd22C9tejY53OmbiUsTc/98UnT0BhKUAl35CRMCVW9ivJpIn9PWqhOf+VUsJSQu0jj9PBDIewe4pbVIWihDOOuUaGJjQSvK3j79Kfo3t1pQFe8zj72VJkmHvtC5csEq/lshRmcD9vS8fL0Xcnv3SFfPtWFbrhwuOwLybqFO9dLYsXGjR/3iQhMRK6/riD2xL56JbA== Received: from MW4PR04CA0207.namprd04.prod.outlook.com (2603:10b6:303:86::32) by SA3PR12MB7951.namprd12.prod.outlook.com (2603:10b6:806:318::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5834.11; Tue, 22 Nov 2022 05:13:36 +0000 Received: from CO1NAM11FT111.eop-nam11.prod.protection.outlook.com (2603:10b6:303:86:cafe::5f) by MW4PR04CA0207.outlook.office365.com (2603:10b6:303:86::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5834.15 via Frontend Transport; Tue, 22 Nov 2022 05:13:36 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by CO1NAM11FT111.mail.protection.outlook.com (10.13.174.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5834.8 via Frontend Transport; Tue, 22 Nov 2022 05:13:36 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Mon, 21 Nov 2022 21:13:26 -0800 Received: from nvidia.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Mon, 21 Nov 2022 21:13:24 -0800 From: Gregory Etelson To: CC: , , , Viacheslav Ovsiienko Subject: [PATCH v2 1/2] net/mlx5: fix port private max LRO msg size Date: Tue, 22 Nov 2022 07:13:06 +0200 Message-ID: <20221122051308.194-1-getelson@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221117143901.27957-1-getelson@nvidia.com> References: <20221117143901.27957-1-getelson@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT111:EE_|SA3PR12MB7951:EE_ X-MS-Office365-Filtering-Correlation-Id: dcb9eca3-99f3-4c19-9e49-08dacc484f05 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /VrUu6tuHXRFEOdx+lPKqwG7wMYsaNLXuDrF/dGgh2RXSTtgnMotQXsPnTmJeEBbmWgCr93dlCzH8ZjzZwbg+sEqdmTi9d/9VaiPR/TS8B8fuLXWbACMJmFOaWu+PC26PXja7qXITHn1fjde5HWLQrPo7Ieh+0mTQ5WlxPXoULxOXoBQOk4evKxUJolTrhrSes2cRngUiuUV08sGlft78ya4HwNn0EYcco2O/J3Ybz0n5sIo7UVZmSH+nzSJ5NwcWTEzy8Kg9WYGQrEdCHEOZkWO0/pxq0E3pYAQC2P6B4jhR5KvBpgzVtTKiB4gWq6N7SN1YRuxDbuMKrKSag40URnnlV4Vv6guDWDyGobS0sfgbS0YNye6ZSL0SFzBiT3GhA5e1kIo54Pu3N42uPMDsBu24wFNsIBZeiGRc5C8tQCBN3ypLRu0fW4IWw5cMPxaDOYlQv/BofGZ0FJ0yA9s+GyFXAUnoK91bWj6dkRX4/V/lmU7SRmqI2YoZeNpTS5MZ04qUP4N6YKXCWUfwYMINWeIlYjGYOQ+8Ij70kDDocS7embH/k5k3csf4XZzkNd8jlfyG3GyNuYs2F0L84fOTpBtsClu4a/dN0e9IVTd858fCTtoExTmMrCNI/YoPkFxxC8FY9/DCioJunF9Uh+3//br6bzcwWHTEnfxFoi1bFepK2/PV0fNlpbUA6zEKM6cx1MymdIq7BKrF7Wl3cN+cw== X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230022)(4636009)(396003)(346002)(376002)(39860400002)(136003)(451199015)(36840700001)(46966006)(40470700004)(70586007)(316002)(54906003)(8676002)(4326008)(70206006)(6916009)(186003)(107886003)(26005)(6286002)(2906002)(5660300002)(40460700003)(8936002)(36756003)(7696005)(478600001)(41300700001)(6666004)(55016003)(36860700001)(86362001)(40480700001)(83380400001)(82310400005)(1076003)(82740400003)(7636003)(16526019)(47076005)(336012)(2616005)(356005)(426003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2022 05:13:36.0732 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dcb9eca3-99f3-4c19-9e49-08dacc484f05 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT111.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA3PR12MB7951 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The PMD analyzes each Rx queue maximal LRO size and selects one that fits all queues to configure TIR LRO attribute. TIR LRO attribute is number of 256 bytes chunks that match the selected maximal LRO size. PMD used `priv->max_lro_msg_size` for selected maximal LRO size and number of TIR chunks. Fixes: b9f1f4c239 ("net/mlx5: fix port initialization with small LRO") Signed-off-by: Gregory Etelson Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5.h | 2 +- drivers/net/mlx5/mlx5_devx.c | 3 ++- drivers/net/mlx5/mlx5_rxq.c | 4 +--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index 02bee5808d..31982002ee 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -1711,7 +1711,7 @@ struct mlx5_priv { uint32_t refcnt; /**< Reference counter. */ /**< Verbs modify header action object. */ uint8_t ft_type; /**< Flow table type, Rx or Tx. */ - uint8_t max_lro_msg_size; + uint32_t max_lro_msg_size; uint32_t link_speed_capa; /* Link speed capabilities. */ struct mlx5_xstats_ctrl xstats_ctrl; /* Extended stats control. */ struct mlx5_stats_ctrl stats_ctrl; /* Stats control. */ diff --git a/drivers/net/mlx5/mlx5_devx.c b/drivers/net/mlx5/mlx5_devx.c index c1305836cf..02deaac612 100644 --- a/drivers/net/mlx5/mlx5_devx.c +++ b/drivers/net/mlx5/mlx5_devx.c @@ -870,7 +870,8 @@ mlx5_devx_tir_attr_set(struct rte_eth_dev *dev, const uint8_t *rss_key, if (lro) { MLX5_ASSERT(priv->sh->config.lro_allowed); tir_attr->lro_timeout_period_usecs = priv->config.lro_timeout; - tir_attr->lro_max_msg_sz = priv->max_lro_msg_size; + tir_attr->lro_max_msg_sz = + priv->max_lro_msg_size / MLX5_LRO_SEG_CHUNK_SIZE; tir_attr->lro_enable_mask = MLX5_TIRC_LRO_ENABLE_MASK_IPV4_LRO | MLX5_TIRC_LRO_ENABLE_MASK_IPV6_LRO; diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c index 724cd6c7e6..81aa3f074a 100644 --- a/drivers/net/mlx5/mlx5_rxq.c +++ b/drivers/net/mlx5/mlx5_rxq.c @@ -1533,7 +1533,6 @@ mlx5_max_lro_msg_size_adjust(struct rte_eth_dev *dev, uint16_t idx, MLX5_MAX_TCP_HDR_OFFSET) max_lro_size -= MLX5_MAX_TCP_HDR_OFFSET; max_lro_size = RTE_MIN(max_lro_size, MLX5_MAX_LRO_SIZE); - max_lro_size /= MLX5_LRO_SEG_CHUNK_SIZE; if (priv->max_lro_msg_size) priv->max_lro_msg_size = RTE_MIN((uint32_t)priv->max_lro_msg_size, max_lro_size); @@ -1541,8 +1540,7 @@ mlx5_max_lro_msg_size_adjust(struct rte_eth_dev *dev, uint16_t idx, priv->max_lro_msg_size = max_lro_size; DRV_LOG(DEBUG, "port %u Rx Queue %u max LRO message size adjusted to %u bytes", - dev->data->port_id, idx, - priv->max_lro_msg_size * MLX5_LRO_SEG_CHUNK_SIZE); + dev->data->port_id, idx, priv->max_lro_msg_size); } /** -- 2.34.1