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 3FC4EA0C4E; Thu, 21 Oct 2021 15:20:27 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AA7B3411FE; Thu, 21 Oct 2021 15:20:26 +0200 (CEST) Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam08on2085.outbound.protection.outlook.com [40.107.101.85]) by mails.dpdk.org (Postfix) with ESMTP id 6574D4118E; Thu, 21 Oct 2021 15:20:25 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LdY8eCaklm0VRiJ9GapYs+HVQrHS+m+wDkCxLVorZabBcF5SzjJOexx9OmMOFLU4RZ9a9W5Qf2yHYluvjaJmNVTWKpph4TsMiGsE/X2lVCPlV0NWQUIyM118nYdubzehgJLiKavmS7vzltF1mH1sV74VZ37CXtJ6Oe+JhdZcACMh2xbWRBo6dT+JKe1ILQTnRt3Yw6ykNSbohShkIszJMjcBs963KLwYjuWe4MMQzJNwZPiRuEb27X4x4N9hehl7zs6kPfJx9e5mKOVcq04Q88tweKTkceJM+7p0Lnkvs3Z/GzsictYWzTZot5W2AWLwQuMF5GtSP5TdiJEXH568pw== 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=BYRSVV8V+TBKEit8LONV2riteUAIv4TFqBRICi8Mo0c=; b=WrOnhINb+sNNdKimYXb5sTGTSYA3R1Qq4CL3gMIKx9PmuH33C+8qnHYHm9WCvmdSyX7N5x9baQuoiX7pIA1zUYu0MAnUGSuuqbyYEPLoz6Jq/zmkj5tDeTE1JM2gVczsPBcvoQFHbWkW46AnDuKqgc89GzBYVHDjscyex9UEk8waw4qO8CEKF3WeeDDAjaDxpFXdh8v62PJxftsKGbRGLV14tWsNXFE4vZHobNO9cmET8Pf4Fn66bFtk/87marhRUpEevAVo/SdgOfMJhdAe6icijQj8G336Z0IG4ZiDklxbaOeuz0lBs2iQJnxhZJ6maZTkBCDUZ4FdMwFWDpYvcQ== 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=quarantine sp=quarantine 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=BYRSVV8V+TBKEit8LONV2riteUAIv4TFqBRICi8Mo0c=; b=SnMbxtRhl2liOsaFGo5wu7y5cxSArSjaV6j5G0fYpLkDoAPt29X502HgAFwK12Tw7Thmgu040pIdB5v/SQ6bMo7kZvgfILdJXIIQpji89BrJ1gyznvYrBnYuIP36iweHU9zAdd8ZD4t/IvfVY+KZDkNTDFBw++qOTM2e9wihsLjM6x8/6JOjYsln8p1QjU1641ZSsIWMscFnrkhJGcp9EFOo6jEFo2AQSoO7TCXJiKypJ7fLreNGicMPsWKCKPRSCJMErfK7ZE40tK5ZrIhmtMR6m4XxmqShxo+TNItb7Ng9HgYIMUr1MLsxs9pZGh/Cnmr9dM7ZDJbHV5IDz2UfqA== Received: from MWHPR14CA0040.namprd14.prod.outlook.com (2603:10b6:300:12b::26) by BYAPR12MB2981.namprd12.prod.outlook.com (2603:10b6:a03:de::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.18; Thu, 21 Oct 2021 13:20:23 +0000 Received: from CO1NAM11FT003.eop-nam11.prod.protection.outlook.com (2603:10b6:300:12b:cafe::ea) by MWHPR14CA0040.outlook.office365.com (2603:10b6:300:12b::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4628.16 via Frontend Transport; Thu, 21 Oct 2021 13:20:23 +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 CO1NAM11FT003.mail.protection.outlook.com (10.13.175.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4628.16 via Frontend Transport; Thu, 21 Oct 2021 13:20:22 +0000 Received: from nvidia.com (172.20.187.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Thu, 21 Oct 2021 13:20:19 +0000 From: Eli Britstein To: CC: Matan Azrad , Asaf Penso , "Slava Ovsiienko" , Thomas Monjalon , , , Ferruh Yigit , Eli Britstein , Date: Thu, 21 Oct 2021 16:20:02 +0300 Message-ID: <20211021132002.26231-1-elibr@nvidia.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20211021080310.9892-1-elibr@nvidia.com> References: <20211021080310.9892-1-elibr@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cae01c98-e5f3-4373-a559-08d9949589da X-MS-TrafficTypeDiagnostic: BYAPR12MB2981: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Exchange-Transport-Forked: True X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oT1z+CTLwQilFuZoo4rndn9yVangiwZr2FiKtJr4jYIVlcY9odt/9S6K18stgo/2vOjtd6S+yKVF0RnVxYTIRg00LszdpLe1EgrCSaFDkJ52t7phsoY7iQT164Lbf/YG2a4WjAwwJ5eoGgCDZHLxlpdcR8FaagugWvttxLe6atc1KGyUz2mwhLhzZ5jBQcfhmWuw4lQeYR/G47xImlDGP1Eh0d5Q7ka/a20TcaE5YDRL4qTTEDudO1JXak/0JPtNF5SGU9CR6al0vZkNoKx4SIqVQFGGGU971VXYKSNjxKxMARmu3fVRBG4pPuiL8GQQZyru6Jk+UfdCaM8Ivj66cpkh83YS0/OG/lCarnOYt08wYmpLkcU4Vrc+qJtvAPI+5yIZtIFnyKdL5F47iJBBpEOSZ71Bn37tWtojdRIbc1E1D4ir1jk2aUCHSukKVYUE5SA3huHWplcpXZPHzB7h7+lJNd/EdiFXKolY/6xnIxBhKbVE0QnGOLEPBMYM/dck78XYlF7h3Wskhgsxybg1bkeL5/0okD+QN+oUEkcs287Bw9xu3i8AOKss6YoLA+uZLKeIfsKJL+J3ejawndMn4JxBBaisO/XExgVj9f4RdIWxYGMU588mo5O98KGPHy8DXW/P2M7bVojEO4Hy0mrIleohVcjOODPv+gfEm9rwYD55SzVYp5DsXxmXAjHMGkyOuMCmW/i0BwJQPkMb3m6pKg== 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)(36840700001)(46966006)(36756003)(8676002)(426003)(8936002)(186003)(316002)(7636003)(36860700001)(1076003)(6666004)(6916009)(83380400001)(70206006)(47076005)(86362001)(7696005)(70586007)(5660300002)(4326008)(55016002)(336012)(82310400003)(2616005)(356005)(36906005)(54906003)(26005)(6286002)(16526019)(2906002)(508600001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2021 13:20:22.8804 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cae01c98-e5f3-4373-a559-08d9949589da 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: CO1NAM11FT003.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB2981 Subject: [dpdk-dev] [PATCH V2 1/1] app/testpmd: fix packet burst spreading stats 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 Sender: "dev" RX/TX functions (rte_eth_rx_burst/rte_eth_tx_burst) get 'nb_pkts' argument, which specifies the maximum number to receive/transmit. It can be 0..nb_pkts, meaning nb_pkts+1 options. Testpmd can provide statistics of the burst sizes ('set record-burst-stats on') by incrementing an array cell of index . This array is mistakenly [MAX_PKT_BURST] size. Receiving the maximum burst will cause out of bound write. Enlarge the spread stats array by one cell to fix it. Fixes: af75078fece3 ("first public release") Cc: stable@dpdk.org Signed-off-by: Eli Britstein Reviewed-by: Matan Azrad Acked-by: Ferruh Yigit --- app/test-pmd/testpmd.c | 2 +- app/test-pmd/testpmd.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index af0e79fe6d..d75451ac7b 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -1873,7 +1873,7 @@ pkt_burst_stats_display(const char *rx_tx, struct pkt_burst_stats *pbs) pktnb_stats[0] = 0; /* Find the next 2 burst sizes with highest occurrences. */ - for (nb_pkt = 1; nb_pkt < MAX_PKT_BURST; nb_pkt++) { + for (nb_pkt = 1; nb_pkt < MAX_PKT_BURST + 1; nb_pkt++) { nb_burst = pbs->pkt_burst_spread[nb_pkt]; if (nb_burst == 0) diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index e3995d24ab..5238308ca7 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -96,7 +96,7 @@ enum { * that are recorded for each forwarding stream. */ struct pkt_burst_stats { - unsigned int pkt_burst_spread[MAX_PKT_BURST]; + unsigned int pkt_burst_spread[MAX_PKT_BURST + 1]; }; /** Information for a given RSS type. */ -- 2.28.0.2311.g225365fb51