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 4CC3DA0547; Thu, 28 Oct 2021 17:35:53 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 16DDE41140; Thu, 28 Oct 2021 17:35:53 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 50EF64111A for ; Thu, 28 Oct 2021 17:35:50 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10151"; a="254008888" X-IronPort-AV: E=Sophos;i="5.87,190,1631602800"; d="scan'208";a="254008888" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Oct 2021 08:35:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,190,1631602800"; d="scan'208";a="725766105" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga005.fm.intel.com with ESMTP; 28 Oct 2021 08:35:49 -0700 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Thu, 28 Oct 2021 08:35:48 -0700 Received: from fmsmsx601.amr.corp.intel.com (10.18.126.81) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Thu, 28 Oct 2021 08:35:48 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Thu, 28 Oct 2021 08:35:48 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.171) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Thu, 28 Oct 2021 08:35:48 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=O8J5Ng44GIYAyLn2bMeVRLQWWfHP0AAyJLOC952O4LYnrpc7jL+aXMTyKo4sl/85N9bh/XAOMAlJBRmEgGXJ+MXnnIS0Jjw7lGL7Se5ZJvoRjC+TDYBXaYEFZ2PyaE3TAfLH4PjZediZ3sXdu74O5JeDwykvz1FWVT//ueNfXcxcPcUtqQrRhIhexYZFHysrk28V1uXszij+YpWBc2849ZzOTceZndRx+gAHzirgPdhvnTUi9QGvrk+9z6IPjUG92KU9Vv4P1PGuDteVLS49d5f58HkmL1LDiWwF1yIW3dW/KVnxRsTGe/Q3uNO1KAA9UEw4ccpXgKCFJt2VUsYa/Q== 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=7UcaDFNxI/zYtNtXJJr2GSvUEW+PMVdGYv5YPpJSVFE=; b=Wrjfx3dleTYZnM/8oMm6BgNqdYzYXIvP+xNftO7Vu7gaUv5fW+2EOlIayO/AygiSjE4RElaWU8MbBW02DkIBwoi7wdWwHaFiLkMEgNc5po9Y755w6CzzZ7tTAZmy7t62fV7Jj6wwrOFOl5d9ge0MKMdwHnFFt9TMuo6+NlagdFNDv+8Eka3zpuxl7tanRNyP7p5b1uHEiWGaWm6EfypU4KfNlPRkYY1aP3iZlny8GTp2+496/YMqB7uBTbd7yKpUTOxQKLuledlByt8+qsdULdTV+uf+oiIcWi2k5i53ntD5agD3jJgZXojO5wWrrhetE305e2mH4l6oUi1atwguBg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7UcaDFNxI/zYtNtXJJr2GSvUEW+PMVdGYv5YPpJSVFE=; b=RlKIDQiUD97LtG84X6D1zeiMdAqVDn2OtHkc7Roma3GmjeMFwjrmhpjwvxjpcCyQY1gSnhVA4ib0/90/D/Dcsbv7Xm/D6H3L68EFqfrvQjCF2qDlAw9iHvNIc1IGdjBnXtL5yyOfM3kFyoHlbt/3i3HcfHVabams6aiuPK6tHHA= Authentication-Results: nvidia.com; dkim=none (message not signed) header.d=none;nvidia.com; dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5093.namprd11.prod.outlook.com (2603:10b6:510:3e::23) by PH0PR11MB4806.namprd11.prod.outlook.com (2603:10b6:510:31::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.13; Thu, 28 Oct 2021 15:35:47 +0000 Received: from PH0PR11MB5093.namprd11.prod.outlook.com ([fe80::a80e:d881:3c58:9730]) by PH0PR11MB5093.namprd11.prod.outlook.com ([fe80::a80e:d881:3c58:9730%3]) with mapi id 15.20.4649.015; Thu, 28 Oct 2021 15:35:47 +0000 Message-ID: Date: Thu, 28 Oct 2021 16:35:41 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0 Thunderbird/91.2.1 Content-Language: en-US To: Gregory Etelson , "dev@dpdk.org" CC: Matan Azrad , Raslan Darawsheh , Dmitry Kozlyuk References: <20211026095037.17557-1-getelson@nvidia.com> <4fd478e1-a65d-405c-a51f-4b4569908357@intel.com> From: "Burakov, Anatoly" In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: DB6PR0501CA0020.eurprd05.prod.outlook.com (2603:10a6:4:8f::30) To PH0PR11MB5093.namprd11.prod.outlook.com (2603:10b6:510:3e::23) MIME-Version: 1.0 Received: from [192.168.1.10] (212.17.34.161) by DB6PR0501CA0020.eurprd05.prod.outlook.com (2603:10a6:4:8f::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4649.13 via Frontend Transport; Thu, 28 Oct 2021 15:35:45 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 66287fdb-60c9-4741-965c-08d99a289cb0 X-MS-TrafficTypeDiagnostic: PH0PR11MB4806: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: s5vPG20eSaFvWHZ+/OgYvE2dNzSFBGmCQ0VqSE1tdQPnXiuc4n8zcXsPl5o0o//FpKo92mRdPIdxocS4whk62ZjhLVxNSDiMtLC75Vj8F+Lt8joV/SfktttSjyIkQd2GqUWyUQJokbm2optL9QGTOwWMUjYxY1q8dLTGZjK5OrBrQ1KtN72InsRxcwYp4C75fCD39MP9GiwMLZolK2JC0gbeIhBDqxRdnaiOMI+ah23mIknTMUjv4HStrFGNltEHr71h/LVJWjfNOWRzKfM4qnV2pD4zRFdEk71nemnXDBt1PESklHnzVISvde4aCZxuTjS0YRN3uva5Z7SmLgh08rV4ac3Ua5rNiyqAl+gS6RFbWDSANRaf4mlkvoMzyhb5KxtNJJJ4z+Kqkg9XJ2P46+Y72N6hkbso6uPtMLXAJrkgVZQzLMbvZ04eD1T9AnrzdG2jWKkiQ9gpJRHCF6ViQuPVd/eVoBhBHkKYCcTMuPIPRjY2W2wk0OPS5TXg7oYW88t9n3c8FICbdbuQHoIUQdFpILS/xSJtyr/QNqSU+kFDMlys8LSxgfxjHlawNaPxwkrIsNEPsyebLtLcTLC5k2ZtpbUPR56S77T4uUOv0BaRic4IrB1Xf3dTiYiLjDMVVTbKsjITj3Sz6rkdQp/EtwExDroE4RS7bZkiQLsXkB7rytVui6wfUigCNmI3WhLw7iVaGa/vIeDNySIQnzS+eCfl+dWkIBYIlDrIRull3vE= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5093.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(6486002)(16576012)(31686004)(4326008)(82960400001)(5660300002)(6666004)(8936002)(110136005)(86362001)(316002)(66946007)(54906003)(31696002)(8676002)(36756003)(66476007)(53546011)(38100700002)(2906002)(66556008)(186003)(508600001)(2616005)(26005)(956004)(43740500002)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?ZytqTGJIeTJ6UzRQWGRHRndzektjUFFNMTRnYUhCWVByV2JOSXpNQ0FCUldC?= =?utf-8?B?TkRHenRIczZOSFFENlBOelZTS09ITjlST3Z5VDNsVkVKc2VrYmI2T0hhTVdR?= =?utf-8?B?YVdab1FzanAxWXJoU0Q1YllpSTd3L1FpZFArT1h6YnVxbU42dkRwVFoxV1VG?= =?utf-8?B?bU9uSTlhRmNrZ1F5dUkrN2xXNVdMNERqbWRaYTFmdUNrMnAwek9ER051aDc2?= =?utf-8?B?dkRnTnQxaW15Q3FweEhRdjdBNHJWbXhHVk5PSjJHU2FOWGF0dWFnN3grUXVG?= =?utf-8?B?Vzc3MkM0anRHVFFoM0k4Q2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mlPa2xQMGJuOVE0ZWdDWVJ6T0ZTMUNTSUdlaElTK0dUSGZXK0U5YTQ5dXp3?= =?utf-8?B?SUxncS9tZndWMjhtR2x6dlU0OW9IcWlTbnl5UzQ5Z3BkdVBDVmVuRjNzTk1K?= =?utf-8?B?TUp1d29LY3ViRVBnR25uOXA1QmxRPT0=?= X-MS-Exchange-CrossTenant-Network-Message-Id: 66287fdb-60c9-4741-965c-08d99a289cb0 X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5093.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Oct 2021 15:35:47.0671 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: BV1s4h+ME+6TpYxyImoZ9jzG7NGDVP4vuorlmEBdtEPXsNFexfY6M1wJ3w94nqr2H8u60lGI0TVvh5JUPih/IAIjReJ9/8Ys8lB0Yv0+PDw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB4806 X-OriginatorOrg: intel.com Subject: Re: [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" On 28-Oct-21 4:14 PM, Gregory Etelson wrote: > Hello Anatoly, > > ..snip.. > >> b/examples/multi_process/client_server_mp/m >> p_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]); >>> >> >> Wouldn't that make it global? I don't recall off >> the top of my head if >> the multiprocess app is intended to have >> multiple Rx threads, but if you >> did have two forwarding threads, they would >> effectively both use the >> same `client` value, stepping on top of each >> other. This should probably >> be per-thread? >> > > MP client-server example was not designed as a multi-threaded app. > Server and clients run in a different process and the model allows one server process. > Server allocates a dedicated ring to each client and distributes Rx packets > between rings in round-robin sequence. > Each ring configured for single producer and single consumer. > Consider an example when server's rte_eth_rx_burst() returns a single packet > on each call. > Without the patch, the server will ignore all clients with id > 0 and > assign all Rx packets to rx_ring 0. > Changing process_packets() `client` variable to static allows unform round-robin > packets distribution between rings. > > Regards, > Gregory > Right, i just checked the code, and the app indeed allows only one forwarding thread on the server. Acked-by: Anatoly Burakov -- Thanks, Anatoly