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 A2C29A034F; Wed, 10 Nov 2021 17:53:20 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6668841158; Wed, 10 Nov 2021 17:53:20 +0100 (CET) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2046.outbound.protection.outlook.com [40.107.220.46]) by mails.dpdk.org (Postfix) with ESMTP id 7787C41153; Wed, 10 Nov 2021 17:53:18 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bNwaQj8QKmicqANDMOPrGM11C42q+GlbX5x+VHTn6LWX6Zq9mnZ4PYYi8Vki5wG5m4bqJzyeI7uNLM5lSlP4FE5Ji4mmUdyh6breh6vUFZyCofFNTvc8epaMBSbHohZa+YA4e0rskHG5cqawP4w2YYnGQg4VauCMyxYClDV4oK73OK+qxZ/OnCC0S3dH73lHRnZrkGru7WZB44sx1LT67xGvgvptEEffDq4Ab9W5BF48oyKH0s/JibzmnCFjCO0pH+MYfJ1NYuNO9/uUaBkLxHfx8c8OviVkg6LZn/m8bPo62JDgiRr2xWvshtvYFBpDRPHu07MvHx6wHaz5CbEbBw== 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=dKQAfkf1CxoNEw6M8ZiGbdM7xeCvPc7GEU0fgNBfby8=; b=FW294vr31uvyp8mxrEnAiV8GYmV2gBnxWaX425KJMLzkQSKLkXZfyjKBUENRrg80BaIjohPP6qWtDbBJkT87Zj89x7tKMwNZjozk8lLNT4OqjIQDkRFMi+bhBnpUlZMQIPGm+uXzFqKLZf1jDzho5fFwPuWybmjEbYwsvnXHOT8uk4AJUBAW1mPZYLlgqJyBPcTckKHnUVmCJ2veHQnFQe/rAkFlB9nVf3vmXaEAfIEATMzPyC5QSNape1TQVu9UV5YBgrHNyfkhTxOgfHoPKfpiqtG6lB68A7NVCIv3dVWfnQsZRMRlaKaTxuRXEt1KlzQKnATzievQe8yTcgYYxg== 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=dKQAfkf1CxoNEw6M8ZiGbdM7xeCvPc7GEU0fgNBfby8=; b=VYGDjxfC/9ubtI75mZcs7M/PeK1ZM7Bdize8zHEQ4nXn014Lr/1lubCqpeymE+RNseCCdygek2/zDeVI/2pbEbQNrgofNLD6wKM1KD6RtaKmZBLCWNKZcIxhhg25sJr8N0ht3fwqbDZgF54aIjDrmzEywpaOSMLodLenbUV735ixPQg3iDLWx79/d9bANdoNJGaPz2v+0+HJvcel+dmVPquerjlRNOW6dg3hVVDpKKUDWxmcixU5NcMEm4Jgq78I7ELalVbA7Rzi/nOXYa54/2niQ7GnGISyf+fjy7PP3VEgMwc1/YGy75Rr9dBzQw01Wm0bE07Q9+PFE/VoH3ECAQ== Received: from MWHPR1201CA0008.namprd12.prod.outlook.com (2603:10b6:301:4a::18) by DM6PR12MB3386.namprd12.prod.outlook.com (2603:10b6:5:115::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.17; Wed, 10 Nov 2021 16:53:14 +0000 Received: from CO1NAM11FT013.eop-nam11.prod.protection.outlook.com (2603:10b6:301:4a:cafe::3e) by MWHPR1201CA0008.outlook.office365.com (2603:10b6:301:4a::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.16 via Frontend Transport; Wed, 10 Nov 2021 16:53:14 +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 CO1NAM11FT013.mail.protection.outlook.com (10.13.174.227) 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:53:14 +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:53:11 +0000 From: Gregory Etelson To: , CC: , , , , Anatoly Burakov Subject: [PATCH v3] examples/multi_proces: fix Rx packets distribution Date: Wed, 10 Nov 2021 18:52:56 +0200 Message-ID: <20211110165256.10162-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: 8ed00ba6-eff1-4aa4-f323-08d9a46a9630 X-MS-TrafficTypeDiagnostic: DM6PR12MB3386: 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: FmJjwuxmyM91QMl23V/rGYQwWus9/W19EpdxZ0mlZGLBWQE9KRYhP9wKJijuNhyetz18q8Miw6D051Zh8DfU65na5hTBS2HW2mAoPfTs5qjSiyNpPk/M3IpCuyCPnSJoy6ujrwh59jfL85R4SW7BK4grkyz6B9uuWBMftcjU4Wdj/8HIjG1FA/foyk3F5kYG8+3KrZR6i/T6DjZieb51MllF1yhjB8gSkI/atAFoTrrSklbWdwkTc1UbgX3pytS5krNFIP7oF/o6fwJ4RflRACtH7jrmU6btWSThJx8L78538fzIdzbJO2+Td4vUG6T/6kk6y+AMQ0RYHfW48jLBGlY+yoW7kbPx0DZ41J/dcQpPHzLHCxQOOklsAalF07kavWJ/QgayeJdhyW5a3g+/jv+u6vjbdenGyfYqOsIJvxNGxAtegmJ2ZJhlBKg9S+batNen3K0PxJe6PdBz8vvppjLOung82trVGQ99yQ+HEQMmEP/vSfOJ8ron4v72sam5OyHoeqZMbRXuWPzuHza1UqZ+g7GAt98Vo5OWa9fBu3mAtz22t8mu3t2hyJ8PitTsYe3ppMg2tmqOKb18K47jxqiaF9Bjj6ug7Bd+rmLoOLZg5vuoNVdhwLxTrGzGSnFl/PZ4yIub6NbQqQdR6UnPUIrY5nGk/Wlrch5QrsYT3c0cY+sjuCD4bHm0zTBNnqERomk4TenriY4cNXT/YXt0Og== 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)(6666004)(6286002)(356005)(26005)(7049001)(70206006)(16526019)(186003)(47076005)(8676002)(70586007)(110136005)(36756003)(54906003)(336012)(36906005)(1076003)(2616005)(426003)(7636003)(82310400003)(316002)(4326008)(508600001)(7696005)(86362001)(36860700001)(5660300002)(8936002)(55016002)(2906002)(83380400001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2021 16:53:14.1705 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8ed00ba6-eff1-4aa4-f323-08d9a46a9630 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: CO1NAM11FT013.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB3386 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 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. --- 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