From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0089.outbound.protection.outlook.com [104.47.38.89]) by dpdk.org (Postfix) with ESMTP id 6B9E42C35 for ; Mon, 6 Mar 2017 14:06:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=xEXm7vGqaYSRGfPjkUAwbYmSPpH0n6t7kBmflHMKILQ=; b=acMfwXYSvpDX8Bd7hBpWcI8cpFy46diav1nJqrwVrRJMh6sZ8fQ8x/ygGgcgNOfYe18rFbUebAXznt5yPLqJ7WZasWOPDFRd4FDFR+T3lIaQoPDUQzuWhnNXbv3aSAMWrFNP39wwzkvP8dI4vXb5wFueId3Jlj+mQsOsdb2vAb8= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=caviumnetworks.com; Received: from localhost.localdomain (106.200.230.99) by BY1PR0701MB1724.namprd07.prod.outlook.com (10.162.111.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.947.12; Mon, 6 Mar 2017 13:06:50 +0000 Date: Mon, 6 Mar 2017 18:36:26 +0530 From: Jerin Jacob To: Gage Eads Cc: dev@dpdk.org, bruce.richardson@intel.com, hemant.agrawal@nxp.com, harry.van.haaren@intel.com, nipun.gupta@nxp.com Message-ID: <20170306130625.GA4250@localhost.localdomain> References: <1488430056-32055-1-git-send-email-gage.eads@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1488430056-32055-1-git-send-email-gage.eads@intel.com> User-Agent: Mutt/1.7.1 (2016-10-04) X-Originating-IP: [106.200.230.99] X-ClientProxiedBy: PN1PR01CA0045.INDPRD01.PROD.OUTLOOK.COM (10.164.136.145) To BY1PR0701MB1724.namprd07.prod.outlook.com (10.162.111.143) X-MS-Office365-Filtering-Correlation-Id: 4c514b24-ec8a-4f54-36ca-08d46491a8ad X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BY1PR0701MB1724; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1724; 3:SCEWSw4JyOxH1Ps0M4dHBBHxPg3DGQup54KaIYGR229y65wqOYI5iSIgyzBUieXGS75l7bhmwI1fBJow2UAEr18fGvEz7ivTdS5t0+TyQ1riNhjKV1FVNV1aiIkLCEir1p5/0uNSjcu3p33uGVt/KLew76DqcYicQxvK3ErJQDofhCqoCZIK/gDuRudlW597b2pl/GOOB+IB0okPK7R0URIqmaFREpGfJIzVmuAE86qbp4c25NziAJ9qSykZid8rHm2KXEYnDLmbyJc3rW/JLQ==; 25:rZLPvNiIFEZscNmcCyFJ700qx+GbCC2w81T0XHXi54G9bkJ8ev7lM7xW8EIhe4wq09BUYzDjpmCgdaa2r4BCi6e8NkChSm67jEszKCWRjb7wQOxeickPLFQzWrku32Nw7Do33EZJ2VO8tiZ1sU7kq3oBSCk6DI/QLMsv29SM+QL7O9WlQWrgWsJme+7nVIkyKu+phX2WHtvH8jrKi1ya+8hVjlH2ydxQlEFMSMRItBWSmsgshN79YXWvQsh/MVtbFEW2cdwb3YgD5fHUXlAOgl27sdmEBv/z14WOoCuR+eV/ZY6cL0gHENBVf7NlCbjh+Lu51pYGpvTc316q/Ko1e4/QyK3BJVJc+jCK3qOKpIaUHtc3CFKWKQMIagGKkND0tHi2wuU2fvYsKiRQfyUgNX9wM0PRyMmBuFIyffREkF4nNForD0BUFGUkWLGYRCsuWm83xPbDTtqx7x7psySTqQ== X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1724; 31:mpDvVgP1b8YrE+gv829P8hIMmqSXnNQQdjL4DLOEjkS/gAcJS0iG56BTYG8W3QKzbRQsxzypqMP5d2EGvOQbVrTOWUyDT+cun8jUUuCO8J1e3g6RVLfaGHVmziLF1gI3GDGToDfNsJyX1AjxbyywK1ndS5exzWT6U70tzUjENc70CsChTGVeNvsLqITTQvJMVdTKqN7Rkqwa4SKv+7urYkRfyA/miLMO0rNU6U/hj3zq7FYWYY3eG8cUAzFwo3cgUIQtLRLlplTv5kiiD0sjaCb59r0iPdUl8/Qk4sBZC7g=; 20:iyctatdNUIxg/dNGEymDpjteT+QE17Fs4JXbBx7qBitsBmqtKCy4xJVxsNiqSN/qQvh5lySlgSE3AeZ96QPr3XiNw66qQfAuNHJgZavq16I0yUZ7F8iNBpojw2ghTTY8xnMtkSaSgV8v78jT8j3z6PByJ8GsxoAHJgbJ/BYyXipBMszIK1ixSQ4HsAJWoSio736srWRGAkzTkIv7qqW7r5Sk+1shEKGszFou+gbCH7PqZW4o6CkO0lc8LgGqhu/YnypsipvvVjYvkXoYnD4iLmT1J2660QGFEvKrUV/AFQk8UobiLJ3EaiUkAv5fF9OHfi+vSCdGSW87wMXqFsRwrEe27zr7JSz1G2YiHUokoGfg4oXvIxAnk0MokEJ/kqbPIzb6M6/orBvz9yi4eRUY08eEAgK4WIKXbyczjfnsiROp8+Ui12uSPAT0uu95KVmcJbuFi2kx3A8ZdkdcWEwKaPyyyRzYHvils9paMKezhqYO1DBF2hNKhlOC4CL+q4kLT3xYsWZ6OvUTF9syoyhr9JsJkXhlC7qghP/oBoyfmw1p/ATFfy5Ujzd7Gg6TGgEi0mmRjUTbg3eZkx/58daVXnZaKmNqHPzbz0Q8kiYYQVQ= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6041248)(20161123558025)(20161123560025)(20161123555025)(20161123564025)(20161123562025)(6072148); SRVR:BY1PR0701MB1724; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0701MB1724; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1724; 4:gf9C/CYkrAWOpqkxUzEQwFUTBUKf5rXTWjQVeLWxuFbkdPszl6yrtUJ+o2ZOuMlyvtCTOsXwaGJebihB+FEFEV1XKGfM/7zCJihrPrrS+nASqW4EkxSo1rbs2/9zc920VB6EreiAsp+z3f9Dh5O+a3ZmCbWV/yHffFIOlSpnsbiNlDirSgRfPvXZAnizW8nofxhnhcqcAnKcuQTm0ldGmc5wWed9A8yeHDh3GcyxQ19iisurjHerC2A9KsQANYsR8FxngD91zita5I653Kd/kbuKj8GBN+J/ajH+lfhZKismq2CunzWjT/jkELjKkIKvxPVqAH6AUfvhDVpkz6AjD8uLD1IrQRSfkoiGAr5xmz9MlFRoadF1uPyP7sHQS5JcNODzH1nkD8a/tMlczAwGocBfedEa4DH8C7bgg9aXAsaIcdBieZhuLR7etdhqa2pS0f4A0/UcLoS3mD3l2rAkasqVXd2q95uYkLYaSXlzI6eXgFhtLQEiEe4MCRP+k0jwLG0QGZ6Cf/FN365dE5kU8UxqwuU6MEHcnpiGEhVjKb1tjtf2weJ5KtxeSDgR1vrr3hImEKwDqpNgB9pu8X7EnsPXjSol5eCnIhfjVJX1O2l+6BpuZQLtPTIUO8x4OJ25zzpr6umG1idQ/M4HIneHBQ== X-Forefront-PRVS: 0238AEEDB0 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(39450400003)(24454002)(189998001)(53936002)(4001350100001)(4326008)(50986999)(92566002)(42882006)(2950100002)(6916009)(83506001)(50466002)(6246003)(61506002)(110136004)(38730400002)(54356999)(5660300001)(76176999)(66066001)(8656002)(305945005)(3846002)(6666003)(6116002)(5009440100003)(6506006)(7736002)(47776003)(81166006)(9686003)(42186005)(23726003)(33656002)(25786008)(229853002)(2906002)(1076002)(55016002)(8676002)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0701MB1724; H:localhost.localdomain; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnost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i1udQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1724; 7:PbqnOqRxnsFV4/hP5zfAnYJAGD/3BGcS6c0Jw+1xZmA1Pa7XI9UW6yU7w3D/LplRtAoZgeJBGpcERrzUPoKmcYxf34AlBgMBseKACtPLpPhCNN9dJtXCbYcCUA1Fw6+9leZ1+nFalJepKUMbDHAfFm+CMSqxgC16PflXgjFQZrfAkN4AF32kNNBeYX86QqXwgVYWmh143a69FPYqSpBWip1ahgwUgPR8Wj4z3NS5sNokbmL7EvdxLFd+//5BMACy02uRsWL+V1luWHezEH6cw1KG+hVQhc3n8gGY0kauEHWncUVqm8H9UtuS+6W0v7+7gUYcxIKGbTAlNFqmMpyUkw== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2017 13:06:50.2791 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1724 Subject: Re: [dpdk-dev] [PATCH] eventdev: Fix links_map initialization X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Mar 2017 13:06:55 -0000 On Wed, Mar 01, 2017 at 10:47:36PM -0600, Gage Eads wrote: > This patch initializes the links_map array entries to > EVENT_QUEUE_SERVICE_PRIORITY_INVALID, as expected by > rte_event_port_links_get(). > > Signed-off-by: Gage Eads > --- > lib/librte_eventdev/rte_eventdev.c | 17 ++++++++++++----- > 1 file changed, 12 insertions(+), 5 deletions(-) > > diff --git a/lib/librte_eventdev/rte_eventdev.c b/lib/librte_eventdev/rte_eventdev.c > index 68bfc3b..b8cd92b 100644 > --- a/lib/librte_eventdev/rte_eventdev.c > +++ b/lib/librte_eventdev/rte_eventdev.c > @@ -190,6 +190,8 @@ rte_event_dev_queue_config(struct rte_eventdev *dev, uint8_t nb_queues) > return 0; > } > > +#define EVENT_QUEUE_SERVICE_PRIORITY_INVALID (0xdead) > + > static inline int > rte_event_dev_port_config(struct rte_eventdev *dev, uint8_t nb_ports) > { > @@ -251,6 +253,9 @@ rte_event_dev_port_config(struct rte_eventdev *dev, uint8_t nb_ports) > "nb_ports %u", nb_ports); > return -(ENOMEM); > } > + for (i = 0; i < nb_ports * RTE_EVENT_MAX_QUEUES_PER_DEV; i++) > + dev->data->links_map[i] = > + EVENT_QUEUE_SERVICE_PRIORITY_INVALID; > } else if (dev->data->ports != NULL && nb_ports != 0) {/* re-config */ > RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->port_release, -ENOTSUP); > > @@ -305,6 +310,10 @@ rte_event_dev_port_config(struct rte_eventdev *dev, uint8_t nb_ports) > > if (nb_ports > old_nb_ports) { > uint8_t new_ps = nb_ports - old_nb_ports; > + unsigned int old_links_map_end = > + old_nb_ports * RTE_EVENT_MAX_QUEUES_PER_DEV; > + unsigned int links_map_end = > + nb_ports * RTE_EVENT_MAX_QUEUES_PER_DEV; > > memset(ports + old_nb_ports, 0, > sizeof(ports[0]) * new_ps); > @@ -312,9 +321,9 @@ rte_event_dev_port_config(struct rte_eventdev *dev, uint8_t nb_ports) > sizeof(ports_dequeue_depth[0]) * new_ps); > memset(ports_enqueue_depth + old_nb_ports, 0, > sizeof(ports_enqueue_depth[0]) * new_ps); > - memset(links_map + > - (old_nb_ports * RTE_EVENT_MAX_QUEUES_PER_DEV), > - 0, sizeof(ports_enqueue_depth[0]) * new_ps); > + for (i = old_links_map_end; i < links_map_end; i++) > + links_map[i] = > + EVENT_QUEUE_SERVICE_PRIORITY_INVALID; rte_event_port_setup() has rte_event_port_unlink() at the end of the function. On rte_event_port_unlink, we are doing the same operation(writing EVENT_QUEUE_SERVICE_PRIORITY_INVALID) and rte_event_port_links_get() should be called after rte_event_dev_start(), If so, Do you still think this duplicates writes are required? or Do you have any other call sequence in mind? ---------------------------- Description from header file----------------- The functions exported by the application Event API to setup a device designated by its device identifier must be invoked in the following order: - rte_event_dev_configure() - rte_event_queue_setup() - rte_event_port_setup() - rte_event_port_link() - rte_event_dev_start() Then, the application can invoke, in any order, the functions exported by the Event API to schedule events, dequeue events, enqueue events, change event queue(s) to event port [un]link establishment and so on. Application may use rte_event_[queue/port]_default_conf_get() to get the default configuration to set up an event queue or event port by overriding few default values. If the application wants to change the configuration (i.e. call rte_event_dev_configure(), rte_event_queue_setup(), or rte_event_port_setup()), it must call rte_event_dev_stop() first to stop the device and then do the reconfiguration before calling rte_event_dev_start() again. The schedule, enqueue and dequeue functions should not be invoked when the device is stopped. ----------------------------------------------------------------------------- > } > > dev->data->ports = ports; > @@ -815,8 +824,6 @@ rte_event_port_link(uint8_t dev_id, uint8_t port_id, > return diag; > } > > -#define EVENT_QUEUE_SERVICE_PRIORITY_INVALID (0xdead) > - > int > rte_event_port_unlink(uint8_t dev_id, uint8_t port_id, > uint8_t queues[], uint16_t nb_unlinks) > -- > 2.7.4 >