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 C017AA0547; Thu, 21 Oct 2021 10:03:44 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A3C8B4116A; Thu, 21 Oct 2021 10:03:44 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2047.outbound.protection.outlook.com [40.107.92.47]) by mails.dpdk.org (Postfix) with ESMTP id F1BA6410E2; Thu, 21 Oct 2021 10:03:42 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V+fXqjcAaasJINgvmJMvPDRbal6Qmcf0XutrQTDQuJ/c9K1BJSldRcee327WkTmgKrqQuiiLUKKNhblWKBOxGF3nQs6jOD/VGKF/izR4EpaI6ESvN3peWeh3YwK0qIcugbepXwKR/6sN2Ty/YZh5W3FU/kl8lg1hzuzohc0S0bKQkaIkmrfQ8T6VDxyTrBiF6avriNeKgy+WyGPeR0tIvCWaA1Pa3OhQZZgGQOn1ksYF2eWgmgsxjrZvKCt6okVpijjArScpqS/MDeAemSlxPO+Vwm6ZuwOU1vsmjtgDpmoQgE9UdREQpPOK90RZwCp8U97qAZm8xrc5+TaRnr5X6g== 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=5X2sr9CPTFMor5O2aWMhEJfRaESYf7h3RtqPuFBdVt8=; b=Cdj8l/MqhUJRkTWAGhDC5IHGXZTmVqdUibqlNlEqvqqp/WrUJ37s8FEqLnQkkpG+ZDwey+96c2nqDQeQShFBIlfaFzwrxHCN8k7C+WI0W7gw5NyYKrJVeWy0fjjJ7cy3yenIGudbNevOlrbA3CvheMOrX3spJGrPb8QH8twVawAlTn1IZz2WzpGpKI77xmX+AigZMzvKRzgGhw93+d9jgKD4ZDOJW+bs5sqb+O1oRjbXe14aWB9J+5r3dPxjhDV5w8bP1QX+ZcBJkfmpr0bBpMyki5z7JGc/r7qFEYLCN1OuqMeoCaif9QvwcvV4SU2XOtncWbn5hg+D/c/Z4skuCw== 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=5X2sr9CPTFMor5O2aWMhEJfRaESYf7h3RtqPuFBdVt8=; b=DtvLhk05HIzQCDaZ+QMlhNywEI2poOoBzXVGVlUVSXaPOFpEPUO9yZSsdpXMXgl3hmELIAfKfR17yILiYkvXFtm7eqKbE2R8lAwWeivTAJsnfHQWIFKzP7UIjRXeJLGvNLotYxXVRCRIkbl0Ip5yQAPGb43TceIvG8OffwK3DVqUddFJ6zr9WZyZ5myS3oxNnh2X6uK4tiH/9NpIP6UjY/dIgZ2jb47lhYVuPhpseh+lzjqIRY0T5HSij3PmurBqOkF7HHTpfd+DiPG13rtOG3251Xar3xhLtPaQ7858BdmH7vcGnkbwWrM6z5zM8UaPqYcdyph1LGnhQYrmHRvS7A== Received: from MW4P222CA0028.NAMP222.PROD.OUTLOOK.COM (2603:10b6:303:114::33) by DM5PR12MB1753.namprd12.prod.outlook.com (2603:10b6:3:10d::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.16; Thu, 21 Oct 2021 08:03:40 +0000 Received: from CO1NAM11FT053.eop-nam11.prod.protection.outlook.com (2603:10b6:303:114:cafe::4a) by MW4P222CA0028.outlook.office365.com (2603:10b6:303:114::33) 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 08:03:40 +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 CO1NAM11FT053.mail.protection.outlook.com (10.13.175.63) 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 08:03:40 +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 08:03:37 +0000 From: Eli Britstein To: CC: Matan Azrad , Asaf Penso , "Slava Ovsiienko" , Thomas Monjalon , , , Eli Britstein , Date: Thu, 21 Oct 2021 11:03:10 +0300 Message-ID: <20211021080310.9892-1-elibr@nvidia.com> X-Mailer: git-send-email 2.18.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 60d77234-0e17-4a8f-7345-08d994694b19 X-MS-TrafficTypeDiagnostic: DM5PR12MB1753: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6790; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rOguhCixwGJ6TJ9htORpU53IVKsFbhedF+Q+ndqkNrnxfKNVeJkJvAMUFZ1b5AlMkCD0iwolVKCkL/YiKZSl8p0VwhJfXkCdckEhyt06IN+Iisp+rtMCPZpi/JMTokit6NyygfBAEzxbXJWUoL9KuU5sKRnibGSfeOjVOwE/g+7fWwYNIir8rrl8Jzp446Jc1hemn//nPGdfy6LOYjrO4cbBb6UHNjRU2Ipdd17SRzlFEg5VydJpfK4u94ADNDNo+2BzFY8O2KR5vmwNrUWcAd2t5wg6hhdqdxCpER1OEB9ZEZuCW92iqCUJ18HknERuS2HOlRygjXkn9b/PYX6drAOwbC+iJPO13wPlbhZGz4IF/oY3r5OU8piRe0kN6VEQTrt3/uX4jbfuLmZBeJX8AS4yv7ZX8jyhi725nU70BwYKAQljmyW8XVNoZzgBKkMiCM3CG5u2xJEWviNOFYmtiz7Vvdu++Y+n1H44xA1Rv5VJGpZKMGfbutGix2QoVCiJ37AMIQlTrDJq+lvfLJK6Cotjy+9fSTKSZqkEjvxII0tDF6v4znqMFJyZahiWfMw1MKcE/erRsfL9wZTR0T/7Yna6Fl27fwZ3uhav/KCx1l1vPOX+sOS0idKLv4HV3wQY0tlseZonWhU/eNX2SX8FlCDYKQBaF+ujr+svTZ+BmxkCLcV27WDAWXjf37NOaO+0bUJ2ZoIziNQfrVCxfOdhHA== 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)(2906002)(36860700001)(83380400001)(336012)(426003)(5660300002)(1076003)(186003)(82310400003)(47076005)(8676002)(36756003)(8936002)(16526019)(508600001)(70206006)(6916009)(6666004)(6286002)(55016002)(4326008)(86362001)(7696005)(2616005)(26005)(7636003)(316002)(70586007)(54906003)(356005)(36906005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2021 08:03:40.0982 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 60d77234-0e17-4a8f-7345-08d994694b19 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: CO1NAM11FT053.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1753 Subject: [dpdk-dev] [PATCH] 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. Enlarge the spread stats array by one cell to fix the possible out of range memory access. Fixes: af75078fece3 ("first public release") Cc: stable@dpdk.org Signed-off-by: Eli Britstein Reviewed-by: Matan Azrad --- 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