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 B628143E57 for ; Sat, 13 Apr 2024 14:53:18 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AE2E5406FF; Sat, 13 Apr 2024 14:53:18 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2086.outbound.protection.outlook.com [40.107.223.86]) by mails.dpdk.org (Postfix) with ESMTP id 0311E4068E for ; Sat, 13 Apr 2024 14:53:17 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aKxC59p/Hs7YNfMJABCq9Z+naRlnvaeTiMJigHUake6cE9H1u7hRrENDIgBQYUJStEDLoW/Q8xY+ug6YFfIGUvtWwiDSymDZ7u7gy2sThfUf0hoFf9lY+QeJJG7IyhZBC53dUGMSmed4ADox0mamkwvDTikvwaYRbzmQEunO3wgDBuGaqXQdcNiMoB/nnqe6bIjV1sjutcx+x17RWHRTWElPKjqiLbGVqJasnDJmEj0qSTo7d9Q4rSIkpg7xMXyTd6txRNEKnp0LvPsmPYPXqloXfe7Va8fxp95MhowoY9isLB2bQ9LPwLBJzZ0th1/W6s5yMfjKx0lVmkH6G189Vw== 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=O4cChRyYIeoh0jUPwKlh05iiAr3tMAkarPPro2D8zio=; b=kSWjlZHkX5WAiMGj76or7VVqbXhpKVZ/FB5fp3uEHDfrROqeVMHBUsx504R3BMIefeRpGJnUJcSedjs06hKS1MjwgEkRwuOCSmL6JHqBD4WeH1yUJwV/PCPEaIYwvCMa6LlMi8YlxrWt+4GlI8Hk4CBKcYAO0mG236RE+X866412cXHBQ2tZF61hfnWHLSZhVjbY4orltANOKbLsFFewmN6fsbLFjtvtvzFViO4PJWLccpXu17G4XXuTLXcs7T8wV/1y+MjX03hT2p26gZriUaSFvunPO9J7HBTttehM3tSPhd1lhTnzCzD4FaJSEcl8lxJMlMCaF0cFdUOQsR1g7A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=marvell.com 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 (0) 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=O4cChRyYIeoh0jUPwKlh05iiAr3tMAkarPPro2D8zio=; b=QNgV7/otQmkk0LRTX5OzWZ/FWuheDnY6XOSVpO2aBADlCRHbDEWnPQfE8GG8OP4PdjmuGYGCSjHsn3rYL4WyPnmoZT1g+j14PnRaHL3QiEf4KGzI0XgXI0dSO+nm6wtl8ioktovI6xGkPbrsgfyvuQAhDgwUB/QjBLWA/XfDpKHEkJLP/ByQc7u9Zown/mV/TQBoZIo+PNNB1pjDg9pHll9/mSuF5sB3jFgS6mxJb87rLhSKN14B7wzTgcPvkBfZVJ/+d1WIgZ+XJ7gclRNDe8lwdviTMDWogzlKxzz8gnv/IHsKptLrHl11KOAVBZiAA7cnkZJ8xfyQ8YblHUPRJg== Received: from SJ0PR05CA0073.namprd05.prod.outlook.com (2603:10b6:a03:332::18) by LV2PR12MB5776.namprd12.prod.outlook.com (2603:10b6:408:178::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.55; Sat, 13 Apr 2024 12:53:13 +0000 Received: from SJ1PEPF00001CDE.namprd05.prod.outlook.com (2603:10b6:a03:332:cafe::db) by SJ0PR05CA0073.outlook.office365.com (2603:10b6:a03:332::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7495.16 via Frontend Transport; Sat, 13 Apr 2024 12:53:13 +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 SJ1PEPF00001CDE.mail.protection.outlook.com (10.167.242.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.22 via Frontend Transport; Sat, 13 Apr 2024 12:53:13 +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.41; Sat, 13 Apr 2024 05:53:06 -0700 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.1258.12; Sat, 13 Apr 2024 05:53:05 -0700 From: Xueming Li To: Nithin Dabilpuram CC: dpdk stable Subject: patch 'net/cnxk: fix buffer size configuration' has been queued to stable release 23.11.1 Date: Sat, 13 Apr 2024 20:48:32 +0800 Message-ID: <20240413125005.725659-32-xuemingl@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240413125005.725659-1-xuemingl@nvidia.com> References: <20240305094757.439387-1-xuemingl@nvidia.com> <20240413125005.725659-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ1PEPF00001CDE:EE_|LV2PR12MB5776:EE_ X-MS-Office365-Filtering-Correlation-Id: e81a0de8-d699-4f5e-e38c-08dc5bb8ae18 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cL15f6fUNqaZXi/7gt/jJbK5fHWiZyuA/3ZgQK+MOiZWMHd7GK0sk/a//59LiDmfgLkxQ6vdegfw61BwxApxFkN+06dN9tlB7zo5RSD6+zEt4qwkY69ZOfGA+WOo8BLICIiofplBfgwkoAhSHcYegiByu3JskLk0OvLP5H/rSy0Pc0Kx40HKYMRCNwZe0rD0c8jZDpEbcvFVsUVhy+p0VF/PGCjbe1EjrqOy7YWsRbi1CeYmRHwfEOSqxjPGO5jBUHH98FaMdTpvNaRJMwWN19vGmp4WbLfUxgeV49T9aKncoxHWdwskZjb7BPS0POd5/fCP5D1YzO3c3CDd3+9D8wNPOB41IC8c5hW4xKqhdYBb+p5fNc7BC5r2USe1CF9O535PnCbZ1Wo3INRFHyEd4Nb2GaAOz43lTcKaAXyiis84WmpKfCzDimQZ2Rg0w59rPZZEey4Ztc7aci975alrvygJwb5DnGz7pDfGTfF406qYmHt3n5eWFm9gz8hx8UtHE8U3v3BxD8HTlIlMV3cT5WgAB0F67DFWh0FkuPg/AcY3gUPNxK+552I9yVRMQANjmzZ4q0OMJog8+lKsspivVHr3C+yKuZYZVAmiftQYCXwTv57N1x7Pm6ffNX/y8tdhnmhG9uHGy4mzT6WebaK4sChEFys1q5Gtk8m6TESx7h7ueW+DX8UnbbYoI8FvM87u3h6zF7OPiwXz/dmrLsgVmK1fFodw5rtztevTKv/Sk7xEbLd+GJLY7LESBQyEQrWa 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:(13230031)(376005)(82310400014)(36860700004)(1800799015); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2024 12:53:13.2275 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e81a0de8-d699-4f5e-e38c-08dc5bb8ae18 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: SJ1PEPF00001CDE.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5776 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 23.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 04/15/24. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://git.dpdk.org/dpdk-stable/log/?h=23.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=e71ac13a3825273e9cfec20cf4410dd0d4db2ebb Thanks. Xueming Li --- >From e71ac13a3825273e9cfec20cf4410dd0d4db2ebb Mon Sep 17 00:00:00 2001 From: Nithin Dabilpuram Date: Mon, 26 Feb 2024 19:05:28 +0530 Subject: [PATCH] net/cnxk: fix buffer size configuration Cc: Xueming Li [ upstream commit 3e12147f71ffb96595bf35a92f3f3741ae9d91bb ] In case where cnxk_nix_mtu_set() is called before data->min_rx_buf_size is set, use buf size from first RQ's mempool. Fixes: 34b46320f446 ("net/cnxk: perform early MTU setup for event mode") Signed-off-by: Nithin Dabilpuram --- drivers/net/cnxk/cnxk_ethdev_ops.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/drivers/net/cnxk/cnxk_ethdev_ops.c b/drivers/net/cnxk/cnxk_ethdev_ops.c index 5de2919047..ec72c32826 100644 --- a/drivers/net/cnxk/cnxk_ethdev_ops.c +++ b/drivers/net/cnxk/cnxk_ethdev_ops.c @@ -544,8 +544,9 @@ cnxk_nix_mtu_set(struct rte_eth_dev *eth_dev, uint16_t mtu) struct cnxk_eth_dev *dev = cnxk_eth_pmd_priv(eth_dev); struct rte_eth_dev_data *data = eth_dev->data; struct roc_nix *nix = &dev->nix; + struct cnxk_eth_rxq_sp *rxq_sp; + uint32_t buffsz = 0; int rc = -EINVAL; - uint32_t buffsz; frame_size += CNXK_NIX_TIMESYNC_RX_OFFSET * dev->ptp_en; @@ -561,8 +562,24 @@ cnxk_nix_mtu_set(struct rte_eth_dev *eth_dev, uint16_t mtu) goto exit; } - buffsz = data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM; - old_frame_size = data->mtu + CNXK_NIX_L2_OVERHEAD; + if (!eth_dev->data->nb_rx_queues) + goto skip_buffsz_check; + + /* Perform buff size check */ + if (data->min_rx_buf_size) { + buffsz = data->min_rx_buf_size; + } else if (eth_dev->data->rx_queues && eth_dev->data->rx_queues[0]) { + rxq_sp = cnxk_eth_rxq_to_sp(data->rx_queues[0]); + + if (rxq_sp->qconf.mp) + buffsz = rte_pktmbuf_data_room_size(rxq_sp->qconf.mp); + } + + /* Skip validation if RQ's are not yet setup */ + if (!buffsz) + goto skip_buffsz_check; + + buffsz -= RTE_PKTMBUF_HEADROOM; /* Refuse MTU that requires the support of scattered packets * when this feature has not been enabled before. @@ -580,6 +597,8 @@ cnxk_nix_mtu_set(struct rte_eth_dev *eth_dev, uint16_t mtu) goto exit; } +skip_buffsz_check: + old_frame_size = data->mtu + CNXK_NIX_L2_OVERHEAD; /* if new MTU was smaller than old one, then flush all SQs before MTU change */ if (old_frame_size > frame_size) { if (data->dev_started) { -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-04-13 20:43:06.097194496 +0800 +++ 0032-net-cnxk-fix-buffer-size-configuration.patch 2024-04-13 20:43:04.947753997 +0800 @@ -1 +1 @@ -From 3e12147f71ffb96595bf35a92f3f3741ae9d91bb Mon Sep 17 00:00:00 2001 +From e71ac13a3825273e9cfec20cf4410dd0d4db2ebb Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 3e12147f71ffb96595bf35a92f3f3741ae9d91bb ] @@ -11 +13,0 @@ -Cc: stable@dpdk.org @@ -19 +21 @@ -index e9ab8da781..e816884d47 100644 +index 5de2919047..ec72c32826 100644