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 A53A242651; Wed, 27 Sep 2023 10:13:57 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 78DD0402E1; Wed, 27 Sep 2023 10:13:57 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 89926402CA; Wed, 27 Sep 2023 10:13:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695802436; x=1727338436; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=m1nxA1yAJPo2a2jboELTgNkXo5dXty4AMRemT7hADZ8=; b=fXCyTE+RkqYRsz6HX2c0FOLpAzCZdKBPMlzwHzWzizImGc2zSwLq3o5K jBoKoOF6TSEu+SWjT6J7dKJDxNR7PHp0jY81JO8ksPypSdYLiY2WiHJb3 j9DuF8E8ZnsUUhVEZL2qiu2eFAf1J4GSZKEShtR7vMANApM/HdZ4xA8yL I9UPXhft/Wz/B5qdKZSydHQj2L9b6PRsXyaQ4qwIKKLNDBDua6fGmHWST 1tAr9zBKq7qnxsUpQvcgfaoHjypiQGR/uZcn/EN2ovCcyXrjYA5mIz5qh Pa436zxoVv35hSPP7/2xW2qldvYHtjwMaIKQ/JprifIQ2bBIG6Vccy2Kz w==; X-IronPort-AV: E=McAfee;i="6600,9927,10845"; a="384547089" X-IronPort-AV: E=Sophos;i="6.03,179,1694761200"; d="scan'208";a="384547089" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Sep 2023 01:13:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10845"; a="749107159" X-IronPort-AV: E=Sophos;i="6.03,179,1694761200"; d="scan'208";a="749107159" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orsmga002.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 27 Sep 2023 01:13:31 -0700 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Wed, 27 Sep 2023 01:13:30 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32 via Frontend Transport; Wed, 27 Sep 2023 01:13:30 -0700 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (104.47.56.42) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.32; Wed, 27 Sep 2023 01:13:30 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mtDQR9NV5Vmv6W3wlGx/G6kCyXG/bPlFss6hfzL2xyxijlgQT26FJpITCVX+9+QJH4tHHn+W+353mKAfbZYdUd5QqDIVFnIDeczapGEav7EASeZOOxBaa/ZiDtyZZooKWzrdTQtOcx//vJCRL47Tzu7+/Ner4TuXPBUVbZCB2qDoa3OW6ANcIP5RhdcUcSu2V5d/SimSLQeHGFkynSKoS0KRLh6i7DAFoxZxwInCg/eAqflK6sEq7Nm3kEV3Z7bi7H5P0toTxjmpal3jgNAYY0DKIbHpBMMB/C9xFI+11tIYk0UgJmWFossrOTwXTl5pqSAbybFN9u8L/CosPUp7cw== 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=ZE9Y1O7qDsPpuuGFEC5+C8/dVrMGeVak2YPfRKeSWJw=; b=jbvGPQSgX09Udz6qFXWJ0ugxNHyrcbbAmOhWSJHT8kv0S1PJPsCrjMCJQpI5hTG+ow7MGix9wpmowG9AZrbKTzxwVzOhQThPGinfVVQZin9y3KmRffYtk0cx8Zh46Cw5oCM8jvcSmGtHOs7KaXsBrb5nFNvLGL7KvkvB2wtzftoVz78VUaTMYjL1m/bAA9/+0AwU9i2MguQjPVUob0iQVr1v9Vf8PSG3122ccr2vYhZnOuX4fyPPUICX3WgJHTOuR02W1e2Dlnntbi6cG6dmm2qA/1CEn7HpAG74hTTIXnpIGMedM72COEkaQRchYG70h0TIeB8pafUuRLad7eFJhg== 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 Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) by CH3PR11MB7675.namprd11.prod.outlook.com (2603:10b6:610:122::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.20; Wed, 27 Sep 2023 08:13:28 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::43d1:af60:464:347]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::43d1:af60:464:347%5]) with mapi id 15.20.6768.029; Wed, 27 Sep 2023 08:13:28 +0000 Date: Wed, 27 Sep 2023 09:13:20 +0100 From: Bruce Richardson To: Jerin Jacob CC: Mattias =?iso-8859-1?Q?R=F6nnblom?= , Mattias =?iso-8859-1?Q?R=F6nnblom?= , , Jerin Jacob , , , Peter Nilsson , Heng Wang , Naga Harish K S V , Pavan Nikhilesh , Gujjar Abhinandan S , Erik Gabriel Carrillo , Shijith Thotton , "Hemant Agrawal" , Sachin Saxena , Liang Ma , Peter Mccarthy , Zhirun Yan Subject: Re: [PATCH v4 1/3] lib: introduce dispatcher library Message-ID: References: <20230904130313.327809-2-mattias.ronnblom@ericsson.com> <20230922073825.351453-1-mattias.ronnblom@ericsson.com> <20230922073825.351453-2-mattias.ronnblom@ericsson.com> <00d5595f-11a2-089f-f563-3d1d75df27df@lysator.liu.se> Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-ClientProxiedBy: DU2PR04CA0054.eurprd04.prod.outlook.com (2603:10a6:10:234::29) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|CH3PR11MB7675:EE_ X-MS-Office365-Filtering-Correlation-Id: e3a6384a-6104-45d6-a8bd-08dbbf31a139 X-LD-Processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QLXerVP79WRTnBH8mgtOd/BMcAaoc3b+ZAMmVgYK1xMy+6qdTCjo0ZVnKZbj5j3XCvQq8jCPhLYIrvFdwrBf6FcuahvZBNo3u3jmhqPkiTRK0lQk8Hd2nLrYlNJ+cmpMLzIo5oURhe79i2zxJ4QI+IDe8ppPuJExJYjCMUoqgLR8OvtnjHteYWwLpULKJqOapAXaEVwICjgPc29FDa/c/PU0hgwbcU7HMN82fLOErLpfnLGaYwpk0DzM82RinA6ApxYMSb+5dbKggxLpripEK8/IvKOwYLsXIILAeWrywlLOvd2Hg/ta6hFTzLs5Gfzbd2ekXLT3BNICtrX2RfBDpFXxDN3pNDWY6BjhiOfQIvNTeL8UepAwjg7IOWwc8UZAx5QDEon0GwdOs2ag92uwhH8AUps/T7MLljvVNbUPLuaTPDHZhiuqBZYPSYn99B99U56ynNXdtYUFKiqOUAzGvGDa/k3y7tN9Y0hbyxSuCctVCnZOrrCQHKUmItkk1wmWrvM1VALVSoQKsL4i7yGWGTjmsMC2/X7TB0gBPKyNu/nEdWBBg5jYSm41mAb8GstiPaHqbsLnXTfvp0Ddc9s0pGIwPH7qfjYLcwMAMha8JVQ= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS0PR11MB7309.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(136003)(376002)(366004)(39860400002)(346002)(396003)(230922051799003)(186009)(451199024)(1800799009)(107886003)(38100700002)(478600001)(26005)(6506007)(82960400001)(6486002)(53546011)(6666004)(6512007)(5660300002)(44832011)(4326008)(8676002)(8936002)(54906003)(316002)(66556008)(6916009)(41300700001)(66476007)(86362001)(66946007)(7416002)(2906002)(67856001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?YzV4Mk1tam9WMjZ6eUZDM0RyczNSaGtZVmpkTGJhVzB0SVBzR1FrQnNwdVZJ?= =?utf-8?B?Y0dkVm1jSWZBVkpYWkZoMVdNd3NXQnMvNGpvLzI3VHBsaXptbzB3QWc3NDRO?= =?utf-8?B?d1ZUVko3L2kxN0lvZ1VPL3pmRXBIR2k5Uk1uMVcya2psa3VzU1RjbXBLMzV3?= =?utf-8?B?aWZVdUcxcGdYanhNNVVaQ0psL21wbEI1UE9wWlI0VnIrdGhnY2dzN1ozbkth?= =?utf-8?B?bUFaNFp5bVpGY2tmcnhMT3RIVzFLSVRQQWRrTEVtS0hzZmJOeFRIVWhKMjNU?= =?utf-8?B?R1M1MmhOT1JaRHFhSG85MDhuWW42RkVNMWtO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3ZYMjJhUE90aXFPbllZZHUwZFVEWnZndDU3NHZkL29SSW54VU1iWW9RVlZ6?= =?utf-8?B?Vmc9PQ==?= X-MS-Exchange-CrossTenant-Network-Message-Id: e3a6384a-6104-45d6-a8bd-08dbbf31a139 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Sep 2023 08:13:28.4982 (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: k8yZUtSxN/OIYBdBkfRUxPzQ0xND3+m7NZhCGRtHe+pR1rjVxsqal1OLPMQiyoJ9Fy7zpaWXnjtMAERuMtxBvk5lSrqvlrLhM0EGUrzyQ0s= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR11MB7675 X-OriginatorOrg: intel.com 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 On Tue, Sep 26, 2023 at 11:58:37PM +0530, Jerin Jacob wrote: > On Mon, Sep 25, 2023 at 12:41 PM Mattias Rönnblom wrote: > > > > On 2023-09-22 09:38, Mattias Rönnblom wrote: > > > > > > > > > +int > > > +rte_dispatcher_create(uint8_t id, uint8_t event_dev_id) > > > +{ > > > > > > There are two changes I'm considering: > > > > 1) Removing the "id" to identify the dispatcher, replacing it with an > > forward-declared rte_dispatcher struct pointer. > > > > struct rte_dispatcher; > > > > struct rte_dispatcher * > > rte_dispatcher_create(uint8_t event_dev_id); > > > > > > The original reason for using an integer id to identify a dispatcher is > > to make it look like everything else in Eventdev. I find this pattern a > > little awkward to use - in particular the fact the id is > > application-allocated (and thus require coordination between different > > part of the application in case multiple instances are used). > > > > 2) Adding a flags field to the create function "for future use". But > > since the API is experimental, there may not be that much need to > > attempt to be future-proof? > > > > Any thoughts are appreciated. > > IMO, better to have rte_dispatcher_create(struct > rte_dispatch_create_params *params) > for better future proofing with specific > rte_dispatch_crearte_params_init() API(No need to add reserved fields > in rte_dispatch_create_params now, may need only for before removing > experimental status) > > Just 2c. > I don't like using structs in those cases, I'd much rather have a flags parameter, as flags can be checked for explicit zeros for future proofing, while a struct cannot be checked for extra space on the end for future fields added. Furthermore, if we need to add new parameters to the create function, I actually believe it is better to add them as explicit parameters rather than new fields to the struct. Struct fields can be missed by a user just recompiling, while new function parameters will be flagged by the compiler to make the user aware of the change. [There would be no change for ABI compatibility as function versioning would be usable in both cases] /Bruce