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 28BBAA0548; Thu, 2 Jun 2022 15:00:01 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1530E40691; Thu, 2 Jun 2022 15:00:01 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2086.outbound.protection.outlook.com [40.107.243.86]) by mails.dpdk.org (Postfix) with ESMTP id 35B224021E; Thu, 2 Jun 2022 15:00:00 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=T7b0LOdzQ9fa471u+MqFFeRAE1FvAVwS5+HkNKd0Sagm9VtGc+uFMZgWz+YxAfqFkDYax2RY0w3bgRnm1PCkwhROX9JnJqB9MTEJdhd7qs6maESVQa10MbrgLI7FPg9GfRRnOtlQ8ZIKo17ume7GtUNZ9EdLWAhPfotDHfm3qCS1RB0HSY6w1afeAIXrjBISSBvbDewT2YcVFSD8v8kPZ+4Lr3ZZhsWiquzqF/ilXkRFEFncjIaeVSJaw/jrCJWhx+pQ0BmQbHz3wS13u+17i+Zhxf6DTCYVYxaS1hWiz/FeT83IeJmygqlWvVHbmnsASWWHgLePGcCNELcaiJkb4g== 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=6gwQPAH5qJO0LmBNphq1AaiX5KNKFZBkBWhwZo2lAJE=; b=V6hzM5QATOFz4l2GFa+GhBj3b8FLUd9lNxMjuPEnnJuGLPz8JhSwJwRmFrpYy2M1ELpB4P8CkhCUW1YQNzLQaSloaklvZZlhUlfyS+yUIEaSucAchrZD6xsCO65UpC0ovnLLcSWdJbpHKT/YIG1xCLgbefBeiivjFTforjre3K6wCg1BZnRPBchYN+zZCuziYCNxpToYAOABHKKEsxRjBYhucZNu1HSSlkyFqzGXq27evme5Sx5/0n3SM8W2oFceYuTkhuFwwBi8+VsUElXdFbijVTP4qfMwvV5lUi2qtpYs74IoyeXUBGPHSYsJuRadoiCYjuVwRVrxkT7uAO4tJw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.234) 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=6gwQPAH5qJO0LmBNphq1AaiX5KNKFZBkBWhwZo2lAJE=; b=EzZI0dCA5+jY6i8GvGijVHRVSRfUrqm5Yb+NjLzx50IpvAV++CS3t6HIcDmBqB2CEJjTFGRMAAEoJRVQz5aPZqxTpFHde/X6XRv8je2pYFzG5rMuR3vLs1Y3apwhJ3mRk1QF7EGVeeUxdWrPJ0ZEdcucwmml0EMhMFPsOibVyGl1NByVBBcOf4le00TxY0OjikujwTU31h2plSEruUxvKvFepY6jKus7NOYo1xfElkCtLSBWznBAD2tCo0VJe92IHZu9kfMNrurv+yThXtKpopnrwVxsMFDxL74/xLRafE3RjZcYBZIaUJUnBlQ+KsUXlcGrt9jRM57rGkrZRn09fg== Received: from MW4PR02CA0022.namprd02.prod.outlook.com (2603:10b6:303:16d::15) by SJ1PR12MB6172.namprd12.prod.outlook.com (2603:10b6:a03:459::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.12; Thu, 2 Jun 2022 12:59:58 +0000 Received: from CO1NAM11FT018.eop-nam11.prod.protection.outlook.com (2603:10b6:303:16d:cafe::76) by MW4PR02CA0022.outlook.office365.com (2603:10b6:303:16d::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.12 via Frontend Transport; Thu, 2 Jun 2022 12:59:58 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.234) 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 12.22.5.234 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.234; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.234) by CO1NAM11FT018.mail.protection.outlook.com (10.13.175.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5314.12 via Frontend Transport; Thu, 2 Jun 2022 12:59:58 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL101.nvidia.com (10.27.9.10) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Thu, 2 Jun 2022 12:59:57 +0000 Received: from nvidia.com (10.126.230.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.22; Thu, 2 Jun 2022 05:59:56 -0700 From: Raja Zidane To: CC: , Subject: [PATCH] app/testpmd: fix packets segments allocation Date: Thu, 2 Jun 2022 15:59:47 +0300 Message-ID: <20220602125947.12581-1-rzidane@nvidia.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.126.230.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-Office365-Filtering-Correlation-Id: 8b9907f0-16f7-4f47-7419-08da4497cc2d X-MS-TrafficTypeDiagnostic: SJ1PR12MB6172:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hYpx3SSjTW4SEHrlahs7Fkp54SrTZnuYHaUqobNQ6Un7bp/tIjpL4pjUD6BodLFZnFJyzWTptFZXmjdR5KNA34BrNLEUTBCVR5abG5Sjoo02ZGLFG9rwqtaloM8k1A/uIyiDDDSqpraQ1DABt/QR+Vkg0njEfNF0mRGioP9sSMlPufhWNG3dGwwyh25QWW/1ytNaC8KJZh26zn8ct3MCoIAenwvrJRWFKuxDO04KOvZrxrgtJYecGdLAKWAtwn+qCj2xQpEkdEl1IT3dcD0hpsfbs9fvQaP9dXBABHiLPE4VoVynoyvFT2Iw+j/DkAwiQyFZ35QsRNylJRIJVVTgqxytm7ay5ANN3eA5TyPq7CByYPukv5TxshOlN6VwnVooNUkvCtfjSwfckP3BKX22S46BjEkMa32WDvV+SEy/z5d9GZO1rrpNA9htZGSJhDqdex+u12FgnmIlUr9omUYOaVsQAQFPKaFakZJIV89wkB9VR0YESRa/0ph0znA1TQTnDAScJePnCN0IALfwe9yhqo+VhoIlZkZrUx+4gAZwFsjoNTKrtoOuqmN6pLYIlmApyAOpy6kXVnjBwuyHcL50uoz3mW9YG6XWCENk4hkGJwixvs13IvGilu8C3kWGPC+qlccZm0L5bY3VUNfYMK31injTVqqyn/YmDVM75Svr2V1T1UWpYHt+NWKwar377Iv6jcMmghqZTYZTmCTsCujg3g== X-Forefront-Antispam-Report: CIP:12.22.5.234; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230001)(4636009)(36840700001)(46966006)(40470700004)(5660300002)(356005)(8936002)(1076003)(6916009)(54906003)(2616005)(186003)(508600001)(26005)(7696005)(6666004)(6286002)(36860700001)(81166007)(316002)(40460700003)(16526019)(47076005)(426003)(336012)(2906002)(83380400001)(70206006)(450100002)(4326008)(70586007)(8676002)(82310400005)(36756003)(86362001)(55016003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jun 2022 12:59:58.1534 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8b9907f0-16f7-4f47-7419-08da4497cc2d X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.234]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT018.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ1PR12MB6172 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 When --mbuf-size cmdln parameter is specified, the segments to scatter packets on are allocated sequentially from these extra memory pools (the mbuf for the first segment is allocated from the first pool, the second one from the second pool, and so on, if segment number is greater then pool’s the mbuf for remaining segments will be allocated from the last valid pool). A bug in comparing segment index with mbuf index caused wrong mapping of one of the segments. Fix the comparison. Fixes: 2befc67ff679 ("app/testpmd: add extended Rx queue setup") Cc: stable@dpdk.org Signed-off-by: Raja Zidane Acked-by: Matan Azrad --- app/test-pmd/testpmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 99f2a31bb8..f5e5987487 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -2671,7 +2671,7 @@ rx_queue_setup(uint16_t port_id, uint16_t rx_queue_id, * Use last valid pool for the segments with number * exceeding the pool index. */ - mp_n = (i > mbuf_data_size_n) ? mbuf_data_size_n - 1 : i; + mp_n = (i >= mbuf_data_size_n) ? mbuf_data_size_n - 1 : i; mpx = mbuf_pool_find(socket_id, mp_n); /* Handle zero as mbuf data buffer size. */ rx_seg->length = rx_pkt_seg_lengths[i] ? -- 2.21.0