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 AACCFA0C47; Tue, 26 Oct 2021 11:51:09 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 631C1410D5; Tue, 26 Oct 2021 11:51:09 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2082.outbound.protection.outlook.com [40.107.92.82]) by mails.dpdk.org (Postfix) with ESMTP id 05607407FF for ; Tue, 26 Oct 2021 11:51:08 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S8lbLbbBv+IsntqFw3MPXYO4wBfwIntfVJAJSj6Dh5o3onvEON2afuA/C77ePuqZcXaJBCWq6cKpGqNn7KYioFx8ae0KYfzqW+tW8IaNvGJrnC5DD/SdfXj+CYg9ApI3MSh9rV+snoIsV80mdnXygwOBGVfQC/MPHDO3OlmAMHY3VgxhjXg4sMyX+ezAIpycm4FCaI/lkJbowsjw+eM0fKLG6UJrKiupuT4RQPPL817GPAzFtHU6TApyIVrExr+iAWEmy6GLhBm8PftruRizZWVSK7O9ikg9cx7bRVZxB+1whbABtIxOy0kFtMRwnXyWws01lqU5xccz08l0I51Txg== 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=+HSfI/RtTAGWBPOJHnK36L1xS4DYmcTTjbENRG5swPw=; b=iTqEW2IW9lu9zZjn0TWqRG3x1SKA1LRIPQEEJ9x/bO+SNUAVuYe8FvE2egJQ6WFhToqzB9LHD9bdI/Fw8FhAi9owJ2BLcV7bB2jYX64P52o1TjGI6W889m3Pc1l2WrSLgAQccZxyHLhZ50I5Kd95GU1dY66q6RV/1eg5Ecd/4t1EHc+jH4zmBL+dIUsvIuMZqJwXGpeHPVRyZRGsYnC4tOWJQJhoxRKFh/2fzLgRbWGeCMUiqeL/lx6Hv4WQzRimUb0Rj2aLtQME6sNOV7ICfD0PgXQPtMbKvSKo91Mv0UgHcQC8SSmN0cV6ByGU/eFwp2L+xY2BumM+jXxygq9zqA== 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=+HSfI/RtTAGWBPOJHnK36L1xS4DYmcTTjbENRG5swPw=; b=nbRgvkI/AppCYvk2pZneDnuxEALJOK1TLrJ/oOL08m63EGtlxb+UJM1wLzbHdcSY54DH3cS6g/VCufwTJywp/64UcjAWD445PJWHGzUJkymciD2D2jPvLaGBLd8CcMh/3vYZ8b7zCtPSpATb+xCqKueiunt5RMcsDNvNvUfzCoTJU51ybJ8A+ac5UgjPWKob7MBFhFaR00mAJFXeAxMd5MX8PgzBTTDI7Atis8AdL6TrWh+RTOFhp3QM271/UDzoWLctzVsPIzKCy/mPfCCXG3hzKMMu7g+qd7smaJsgxofh6uyaj+bgmST76gz8ceSIHmWkm9WuJozgq/EVTkjPbQ== Received: from BN9PR03CA0531.namprd03.prod.outlook.com (2603:10b6:408:131::26) by MW2PR12MB2363.namprd12.prod.outlook.com (2603:10b6:907:f::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.13; Tue, 26 Oct 2021 09:51:05 +0000 Received: from BN8NAM11FT041.eop-nam11.prod.protection.outlook.com (2603:10b6:408:131:cafe::a9) by BN9PR03CA0531.outlook.office365.com (2603:10b6:408:131::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4628.22 via Frontend Transport; Tue, 26 Oct 2021 09:51:04 +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 BN8NAM11FT041.mail.protection.outlook.com (10.13.177.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4628.16 via Frontend Transport; Tue, 26 Oct 2021 09:51:01 +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.18; Tue, 26 Oct 2021 09:50:59 +0000 From: Gregory Etelson To: , CC: , , Dmitry Kozlyuk , Anatoly Burakov Date: Tue, 26 Oct 2021 12:50:37 +0300 Message-ID: <20211026095037.17557-1-getelson@nvidia.com> X-Mailer: git-send-email 2.33.1 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: 27b4ae4a-ca84-45d8-054b-08d998661ede X-MS-TrafficTypeDiagnostic: MW2PR12MB2363: 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: IOuyXsN7WhQghIBAvu/mJcd4y7EtUYAeH4ppCfkHMAiU4afBDMKbNOdd1rxBZoS1sPm+Tam9m4eIt+TCxmKRmgCNnOrLQ4zaAF6gUJAwWcFsaoZj26dKGuLMHJ4Su9KpG8ja5p7+wQ5Ow0YkjDdgi009vN5lC9ZOFS8G9ONcIYYN/A6hvYnYYvROniNhb6ne5TMfbz9wXiyQ+ayFyni85+rJkUQ9a+1COewuuwf9Vc/ho+X8Sy7sFIH9mSokpjH1s/3b60wQ3JkboXvTFnnBIM2y5UfbngwNqNlcmir1LsZfC5LI7L6f9fLuQQPqzjLZTqTMwsrkNcrcbbTbkmqwOBfU4q72t82PZ9ZXDryGkemYo6jVakYW0G++uaWfOLFXqYv05vCZTCVV3GCthDlMfWdx6wTeo/VJ6VndcnQId2HikzOKMF2ds3THvy1yPHpsx73/xUrfbsHzj/NrvSpMPWmWvE3La0iqYlE61P7H0g13aGsFbmhn4F8shDSzaLIA6iBHuQ4Zy+/5MCNS72zvHGCh8g4zOGo3xngsPoHNConBYmOJtWTt9L0dUu3f59NYT9PM8VkXOCSgw8RLojCI96/9IEc8BSqtGcBiZSqfidsT/tz5f6RNZmzpOJZGxGiPYfh9MXOQwDtoj2EZWe2Hye2f9SE6cCvuB1/UtRnZ/9gaVTkeIrMPngL5ZVnuCSy6 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)(2616005)(36756003)(316002)(2906002)(54906003)(110136005)(55016002)(6666004)(5660300002)(70586007)(70206006)(336012)(426003)(36860700001)(83380400001)(186003)(47076005)(16526019)(86362001)(508600001)(356005)(6286002)(26005)(7636003)(7696005)(8936002)(7049001)(4326008)(82310400003)(1076003)(8676002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Oct 2021 09:51:01.6221 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 27b4ae4a-ca84-45d8-054b-08d998661ede 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: BN8NAM11FT041.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2PR12MB2363 Subject: [dpdk-dev] [PATCH] examples/multi_process: fix RX packets distribution 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" 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 a multiple of clients number. 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. Fixes: af75078fece3 ("first public release") Signed-off-by: Gregory Etelson Reviewed-by: Dmitry Kozlyuk --- 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..fb441cbbf0 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 = 0; for (i = 0; i < rx_count; i++) { enqueue_rx_packet(client, pkts[i]); -- 2.33.1