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 7BA63A0548 for ; Wed, 10 Nov 2021 17:58:20 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 73F0A411A4; Wed, 10 Nov 2021 17:58:20 +0100 (CET) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2079.outbound.protection.outlook.com [40.107.220.79]) by mails.dpdk.org (Postfix) with ESMTP id B27FD41184; Wed, 10 Nov 2021 17:58:17 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eE8aMCY0VEB7dPK9n30T9NUwVDkIvynC2v7xwAYl7VAentYUOKxqnHA/jCVIdFHdVp3E+ovNlycVxASQvE6GxiSHj97IGTflSzyipEFUQw+LK1DFNHii10w+2+JVMq2rkMZGO3K5/ZebbhOwIELJ0r4oYOO2jRMvedBB8KRNZYcVs5jDVIoC8nMgUQZMBJZFMTcjAeaZmYlfguiWMLyJVosJXG+uobcxOWwRMpyxfHYSrrlvFMsuKTB362u6jjrRJcszD12XDjPE+iFCVjIaF6GVoEix5fK/ySmCpPGpsslx9Mf658IjZgUUc6Ukngl7CIwguOfYO1fslACOog380A== 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=Hwrd2wn13kYxk1FhQgFDvd05Fy7/jETGT5ScuV62Qg8=; b=iGT1nGMNlXkO/HA2VHusqxrdh3fLt/zCc2rHhuXG3HPCfzYVW2y5V/y6iEIAeGzxLWIqCITLqDX3w/C50zR2JbGPPfsBBSjpftDTdgqAu7RtXu8pc4cbbQUCkiKm72rQ0FF014naA6It0g98RmUrku3sNSO5nu6r1akuw3xvvYX0gATK9M8UUoikgf+qxL5G1lGZPZ/o3f/BPVhx94n4mqmK+iP5PBp577eaUtIwztC/VvEaHlJGH0CJtQftStWsM+qsjkXLxyKWiWonVcukNT92HGyW+0wPYfL2vHAqCl1KlzvxOCNnnLBpm2gl5uZXJXYCzrxmUXqLBtXJOCIJTw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=dpdk.org 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=Hwrd2wn13kYxk1FhQgFDvd05Fy7/jETGT5ScuV62Qg8=; b=I/FoHENKsE9z4y6rhf2m/p93f8Bo4UbTrpp0mbgN33haA8HqBqblJQAtBNyKund5awvn78EoEBdaTVscoK0S1lKkicn2CD2P0Sh4LWD60zftgdlIGs9NUnMJ5W0zEg5ItF1qs7YKk0AI763Lpae7Nkh6RnHrmNcqhKofM0yBg3WQNm9/uR/BSXooVa5PeVm2nMeRgK+Hg5/TwJC6RfGJH4iryrLBKzX8wBTUjajREOLycM+tajv7LUKUGhmhWU2qctYvQf3edlYG4MBs1sV8Q1/HtEJnEzkGL3qXBX6Z/DK8GYwPRhuQqH/c0b2zMxj41iZ1nyoXZkfjMNM5enWOhA== Received: from DM5PR18CA0062.namprd18.prod.outlook.com (2603:10b6:3:22::24) by BN6PR1201MB2530.namprd12.prod.outlook.com (2603:10b6:404:b0::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11; Wed, 10 Nov 2021 16:58:16 +0000 Received: from DM6NAM11FT056.eop-nam11.prod.protection.outlook.com (2603:10b6:3:22:cafe::5e) by DM5PR18CA0062.outlook.office365.com (2603:10b6:3:22::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.15 via Frontend Transport; Wed, 10 Nov 2021 16:58:15 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; 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 DM6NAM11FT056.mail.protection.outlook.com (10.13.173.99) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4690.15 via Frontend Transport; Wed, 10 Nov 2021 16:58:15 +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; Wed, 10 Nov 2021 16:58:12 +0000 From: Gregory Etelson To: , CC: , , , , Anatoly Burakov Subject: [PATCH v4] examples/multi_process: fix Rx packets distribution Date: Wed, 10 Nov 2021 18:57:59 +0200 Message-ID: <20211110165800.11018-1-getelson@nvidia.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211026095037.17557-1-getelson@nvidia.com> References: <20211026095037.17557-1-getelson@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: dc94a59e-71d2-47d7-b96e-08d9a46b49af X-MS-TrafficTypeDiagnostic: BN6PR1201MB2530: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: 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: mM4y03QxbnkIA8wdqnLnaNE9ZzLkOAMe8XycEfY8r0bsh8/X/dfylnXEAqRB+K+Y2IIy2qErvoikJPA1CLVsxdR/5fjbxuNQdzcNQUH4iQd2W8zHqGpuligY5a/WKaD2WzmBpZnTBPqwCZJ0R+pori1HWS+kGrY5r4D5oMMsLVEFuNROHAlABMmfAtWRA60+5hhsjTu8iO70nHQW80yLHCvd6j6iXCNakH9ln7LHiV+MJpPkHx7flV7fEumZPr2Jh2SDFbZSvFjbzj3rS2LBQ4ZDqrXwNmX2ksI4WvYh3qBcbD3hmp/7/BDrzb+HCLstLnrYt4goKstNRFT/sAiiJ4y38U6PyqHYeAV9FraGI71pcjaLw5PPVrm+QsgDPRxzSKjEpU57hAYudzCj09NhThx+4fwveQJTm6gLR3f/uFIi/oZwCNQoainHLnEpyH6B6JXP4a4cA+uSXD+n3/zrYyPSL/wkI2jxhThc24X9wYRpwZarUgt4h7CjCIgwT2/k+sEbIvTUaQ9zvQbOpnKNz9H4RlyFlm3zikX35W0RwtkbmeAxdH+ddOAZj9hOpPLDDKeE4nkQY2k5quukfyQ87Xd6d7il8G0qkCku1zGZe1sg30H77s6CCevTIbUFpYCiuc5BXU8Kap6z+gf7q43mPngi640rui3zp/DM/p0tpMSBu+Apy1IK9z2yQ+JcijfhPTIWkKRaNoJoQiBiXL/xHg== 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)(46966006)(36840700001)(316002)(82310400003)(7049001)(83380400001)(36906005)(47076005)(70206006)(55016002)(356005)(508600001)(70586007)(8676002)(8936002)(1076003)(36860700001)(4326008)(426003)(7636003)(6286002)(36756003)(336012)(7696005)(2616005)(86362001)(2906002)(5660300002)(26005)(6666004)(54906003)(186003)(16526019)(110136005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 16:58:15.3225 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dc94a59e-71d2-47d7-b96e-08d9a46b49af 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: DM6NAM11FT056.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR1201MB2530 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 MP servers distributes Rx packets between clients according to round-robin scheme. Current implementation always started packets distribution from the first client. That procedure resulted in uniform distribution in cases when Rx packets number was around clients number multiplication. However, if RX burst repeatedly returned single packet, round-robin scheme would not work because all packets were assigned to the first client only. The patch does not restart packets distribution from the first client. Packets distribution always continues to the next client. Cc: stable@dpdk.org Fixes: af75078fece3 ("first public release") Signed-off-by: Gregory Etelson Acked-by: Anatoly Burakov --- v2: Remove explisit static variable initialization. v3: Remove comment. v4: Spell check. --- examples/multi_process/client_server_mp/mp_server/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/multi_process/client_server_mp/mp_server/main.c b/examples/multi_process/client_server_mp/mp_server/main.c index b4761ebc7b..f54bb8b75a 100644 --- a/examples/multi_process/client_server_mp/mp_server/main.c +++ b/examples/multi_process/client_server_mp/mp_server/main.c @@ -234,7 +234,7 @@ process_packets(uint32_t port_num __rte_unused, struct rte_mbuf *pkts[], uint16_t rx_count) { uint16_t i; - uint8_t client = 0; + static uint8_t client; for (i = 0; i < rx_count; i++) { enqueue_rx_packet(client, pkts[i]); -- 2.33.1