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 8B065A0C3F for ; Sat, 12 Jun 2021 01:07:06 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8628140E64; Sat, 12 Jun 2021 01:07:06 +0200 (CEST) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam07on2049.outbound.protection.outlook.com [40.107.95.49]) by mails.dpdk.org (Postfix) with ESMTP id 5B65D4003F for ; Sat, 12 Jun 2021 01:07:05 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GICp1M/OxAjVY0js0QAzRkGl3AEE0UsfmkKXr7nGnHIQe5d+szYdy/Anw7uTjne9nnvGpKf1TGcZFl/tY8Mtbq4MuhqqqAg12bBGdCYxNQCAbwWkDHl/wuaN87p8xHM6rDlzNbe7r+xYLjoLHTTR+aM4UZuiGciV3Pgiq3rzjxj7QiKRWDXwY0UUk06iMIhOpB8h0DHOdGJBSdTup0168TcthlR3wtMvPF/g3S6LHVzGPs4HGk9MJ9CoxeAg6q6JD2cNtoWmOqA96BG89EwDAKeJ1d3n9xnOC5DloC1hPguQ+WOIv8u6ku/rcmGfeepahybr+eu54EIvL1B8HVuwJQ== 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-SenderADCheck; bh=fQInwaqD7OLMSF24nYoC/L5Ga7H8ZrCkA88PZYKNiKs=; b=IldakkU5zk3+3sBgTwI345rF2AjYs5gZMBHz8uVwIpsL40yzsQL06qh3W4f/vdbtssycAJ7UuPtcvCFBDLmuhNdhKwWhbG+2PTxCif6uaz7P46n7Y6oU7ViRTf8aHiyikBjfflj0scb80hrgdgiA1ULXtff1zmCQWlqbo/Z9GzrELGpI53rFJ28YewS8iCxb+ELxSvyEGz9GJngBaSTazHYStX5iyFcfdSLrS17VIrmpNaohEEXPmlXjyffKT9p/L3stMnsllSJq/ANHnf44vYCFvi36Obt5jPCXjcwhF9GotUQwGi98ONrpBZLBDsLb6Y+LB6XxRTNIKOngwct2ZA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=intel.com smtp.mailfrom=nvidia.com; dmarc=pass (p=none sp=none 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=fQInwaqD7OLMSF24nYoC/L5Ga7H8ZrCkA88PZYKNiKs=; b=lLMjaow3SPhyPU66BzLO0+RV6RhDNhAV9sDXDxXSSy5Z4ofMUiw8xGACMrBn58OuqG9yvASUoKD5GUEiV9gl0DHXb2x35wEx5GV/g5dJusKhTlM+wbEyLw2xm04ZHZki0Kh8nTstZD6EY02iYJ7Zsphtpwfk+1MlyBWJ27uFgjrAOaRuAMSfSktMJWDEt4UplrlZHsb8lChAiY+97KkM5Hv+D65g/DCnkDhoinarbDW8X1AFm0lHhYyMXRjerhWZR1qE2IlcUOMuCHByquCttf5Fl2shE4B9aeZvpJELHfyKEgE28puSwVYnwoCz0kqFkDCUgvCHpQJneYDukLVPew== Received: from MW4PR03CA0049.namprd03.prod.outlook.com (2603:10b6:303:8e::24) by MW2PR12MB2457.namprd12.prod.outlook.com (2603:10b6:907:10::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.24; Fri, 11 Jun 2021 23:07:03 +0000 Received: from CO1NAM11FT024.eop-nam11.prod.protection.outlook.com (2603:10b6:303:8e:cafe::9b) by MW4PR03CA0049.outlook.office365.com (2603:10b6:303:8e::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.20 via Frontend Transport; Fri, 11 Jun 2021 23:07:03 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by CO1NAM11FT024.mail.protection.outlook.com (10.13.174.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4219.21 via Frontend Transport; Fri, 11 Jun 2021 23:07:03 +0000 Received: from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 11 Jun 2021 23:07:01 +0000 From: Xueming Li To: Viacheslav Ovsiienko CC: Luca Boccassi , Ferruh Yigit , Xiaoyun Li , dpdk stable Date: Sat, 12 Jun 2021 07:01:59 +0800 Message-ID: <20210611230433.8208-25-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210611230433.8208-1-xuemingl@nvidia.com> References: <20210510160258.30982-229-xuemingl@nvidia.com> <20210611230433.8208-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.5] X-ClientProxiedBy: HQMAIL105.nvidia.com (172.20.187.12) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 22f7de5d-96e0-443a-0c02-08d92d2da037 X-MS-TrafficTypeDiagnostic: MW2PR12MB2457: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: x1pvv2lSH0vLjvPFNqJ/D12Q/BGXuxdkUYxlnvR6yF7AmdH99yEKvSTolslGbku1QCHYJONFvbmIZfe1esPr9XA/vefJuYdZhmgu7HdDLs17czt2v7hswBp9OU0hf3VnvWz6Futt/FfgJl58ut/niqwNWafWSLgo9N2lMLHqB0jAFu5qaYbSoeEc2M7bkCj/sI3Sxxp3sWZ1+8ez0KLL2Ruw5Z5dGJLYIYMQY7nMtyhmEd4qye4D/U1Pun3h2KEUQM81dn4PYQ1Lb/XtspBtbZxxXb44PdsBzqZty39WXqxFCvj+zSG+bSERldCd5nZ4+oYuD/1gwfmEjx2Ypn9wYRkRphObYMvzqAcB6m8/VCBDisZcAUVJs26Zjb8seMsGDGHg15HPw65WW+ND6U2mVL/Br9SBRAYSWlwc3mazU5zvMq8ocSTb5ewj5FZV7npwzetJJAk/5qewrK9CpTqzlFoy66m6MOt0xFqnGFlSCuSzR4Ff2dIdTcBwSUWLwN/6ejzujLBstbSc5cqW5dKhOhh2BaToZbE6TB0mrtODRdNZJX8XiHpx+sqzI/NFaeTa/31212quJe1uKqSK0IyNwEEHAMkuqCvWZdhHplm817Y5ZIwLgaPkBj0e5AzVyXThR2LJK60VKkSIU/Errzoxd3cPtt1VvrJ15W1nBhrB/bUZrmcaJZNtxkdhFKvSmDPukFavK0ym9LG2WSkZxcNiAZMV9ypLJX+2KXNxl8SBGRIS6hUGvr5VD/EqX06Sz2m7dpl89Xv0eTR3sJrxkzInxnD/kqluJlMyzQxCVphxM+kQdKdltp5NX/GC5K0X/rDZ X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(39860400002)(136003)(346002)(396003)(376002)(46966006)(36840700001)(53546011)(6862004)(86362001)(6286002)(70206006)(70586007)(356005)(82310400003)(16526019)(36756003)(186003)(7636003)(37006003)(54906003)(36906005)(7696005)(47076005)(426003)(26005)(4326008)(36860700001)(8936002)(336012)(82740400003)(8676002)(83380400001)(316002)(55016002)(5660300002)(1076003)(6636002)(2906002)(966005)(2616005)(478600001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2021 23:07:03.3296 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 22f7de5d-96e0-443a-0c02-08d92d2da037 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT024.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2PR12MB2457 Subject: [dpdk-stable] patch 'app/testpmd: fix segment number check' has been queued to stable release 20.11.2 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 Sender: "stable" Hi, FYI, your patch has been queued to stable release 20.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 06/14/21. 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://github.com/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/9886a1aed2ba8f55f678504ad21bc110d33373de Thanks. Xueming Li --- >From 9886a1aed2ba8f55f678504ad21bc110d33373de Mon Sep 17 00:00:00 2001 From: Viacheslav Ovsiienko Date: Fri, 23 Apr 2021 17:09:52 +0100 Subject: [PATCH] app/testpmd: fix segment number check Cc: Luca Boccassi [ upstream commit 3f47c017eed414490b6428d58d47dfca2964209e ] The --txpkts command line parameter was silently ignored due to application was unable to check the Tx queue ring sizes for non configured ports. The "set txpkts " was also rejected if there was some stopped or /unconfigured port. This provides the following: - If fails to get ring size from the port, this can be because port is not initialized yet, ignore the check and just be sure segment size won't cause an out of bound access. The port descriptor check will be done during Tx setup. - The capability to send single packet is supposed to be very basic and always supported, the setting segment number to 1 is always allowed, no check performed - At the moment of Tx queue setup the descriptor number is checked against configured segment number Bugzilla ID: 584 Fixes: 8dae835d88b7 ("app/testpmd: remove restriction on Tx segments set") Signed-off-by: Viacheslav Ovsiienko Signed-off-by: Ferruh Yigit Acked-by: Xiaoyun Li --- app/test-pmd/cmdline.c | 4 ++++ app/test-pmd/config.c | 32 ++++++++++++++++++++++++-------- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index ab9a603dc2..294031542a 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -2808,6 +2808,10 @@ cmd_setup_rxtx_queue_parsed( if (!numa_support || socket_id == NUMA_NO_CONFIG) socket_id = port->socket_id; + if (port->nb_tx_desc[res->qid] < tx_pkt_nb_segs) { + printf("Failed to setup TX queue: not enough descriptors\n"); + return; + } ret = rte_eth_tx_queue_setup(res->portid, res->qid, port->nb_tx_desc[res->qid], diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 5f147ec711..cb97963157 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -3842,13 +3842,15 @@ nb_segs_is_invalid(unsigned int nb_segs) RTE_ETH_FOREACH_DEV(port_id) { for (queue_id = 0; queue_id < nb_txq; queue_id++) { ret = get_tx_ring_size(port_id, queue_id, &ring_size); - - if (ret) - return true; - + if (ret) { + /* Port may not be initialized yet, can't say + * the port is invalid in this stage. + */ + continue; + } if (ring_size < nb_segs) { - printf("nb segments per TX packets=%u >= " - "TX queue(%u) ring_size=%u - ignored\n", + printf("nb segments per TX packets=%u >= TX " + "queue(%u) ring_size=%u - txpkts ignored\n", nb_segs, queue_id, ring_size); return true; } @@ -3864,12 +3866,26 @@ set_tx_pkt_segments(unsigned int *seg_lengths, unsigned int nb_segs) uint16_t tx_pkt_len; unsigned int i; - if (nb_segs_is_invalid(nb_segs)) + /* + * For single segment settings failed check is ignored. + * It is a very basic capability to send the single segment + * packets, suppose it is always supported. + */ + if (nb_segs > 1 && nb_segs_is_invalid(nb_segs)) { + printf("Tx segment size(%u) is not supported - txpkts ignored\n", + nb_segs); return; + } + + if (nb_segs > RTE_MAX_SEGS_PER_PKT) { + printf("Tx segment size(%u) is bigger than max number of segment(%u)\n", + nb_segs, RTE_MAX_SEGS_PER_PKT); + return; + } /* * Check that each segment length is greater or equal than - * the mbuf data sise. + * the mbuf data size. * Check also that the total packet length is greater or equal than the * size of an empty UDP/IP packet (sizeof(struct rte_ether_hdr) + * 20 + 8). -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2021-06-12 06:53:57.341865600 +0800 +++ 0025-app-testpmd-fix-segment-number-check.patch 2021-06-12 06:53:56.140000000 +0800 @@ -1 +1 @@ -From 3f47c017eed414490b6428d58d47dfca2964209e Mon Sep 17 00:00:00 2001 +From 9886a1aed2ba8f55f678504ad21bc110d33373de Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Luca Boccassi + +[ upstream commit 3f47c017eed414490b6428d58d47dfca2964209e ] @@ -29 +31,0 @@ -Cc: stable@dpdk.org @@ -40 +42 @@ -index 0ad27dff66..5fdcc1ca18 100644 +index ab9a603dc2..294031542a 100644 @@ -43 +45 @@ -@@ -2910,6 +2910,10 @@ cmd_setup_rxtx_queue_parsed( +@@ -2808,6 +2808,10 @@ cmd_setup_rxtx_queue_parsed( @@ -55 +57 @@ -index e189062efd..a4445a73bf 100644 +index 5f147ec711..cb97963157 100644 @@ -58 +60 @@ -@@ -3697,13 +3697,15 @@ nb_segs_is_invalid(unsigned int nb_segs) +@@ -3842,13 +3842,15 @@ nb_segs_is_invalid(unsigned int nb_segs) @@ -80 +82 @@ -@@ -3719,12 +3721,26 @@ set_tx_pkt_segments(unsigned int *seg_lengths, unsigned int nb_segs) +@@ -3864,12 +3866,26 @@ set_tx_pkt_segments(unsigned int *seg_lengths, unsigned int nb_segs)