From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerin Jacob Subject: Re: [PATCH] eventdev: add dev id checks to config functions Date: Mon, 4 Sep 2017 10:50:40 +0530 Message-ID: <20170904052038.GA11420@jerin> References: <1500900500-144237-1-git-send-email-harry.van.haaren@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev@dpdk.org To: Harry van Haaren Return-path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0067.outbound.protection.outlook.com [104.47.42.67]) by dpdk.org (Postfix) with ESMTP id 10C4337B0 for ; Mon, 4 Sep 2017 07:21:03 +0200 (CEST) Content-Disposition: inline In-Reply-To: <1500900500-144237-1-git-send-email-harry.van.haaren@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" -----Original Message----- > Date: Mon, 24 Jul 2017 13:48:20 +0100 > From: Harry van Haaren > To: dev@dpdk.org > CC: jerin.jacob@caviumnetworks.com, Harry van Haaren > > Subject: [PATCH] eventdev: add dev id checks to config functions > X-Mailer: git-send-email 2.7.4 > > This commit adds checks to verify the device ID is valid > to the following functions. Given that they are non-datapath, > these checks are always performed. Makes sense. > > This commit also updates the event/octeontx test-cases to > have the correct signed-ness, as the API has changes this > change is required in order to compile. > > Suggested-by: Jesse Bruni > Signed-off-by: Harry van Haaren > > --- > @@ -1288,9 +1293,10 @@ worker_ordered_flow_producer(void *arg) > static inline int > test_producer_consumer_ingress_order_test(int (*fn)(void *)) > { > - uint8_t nr_ports; > + int16_t nr_ports; > > - nr_ports = RTE_MIN(rte_event_port_count(evdev), rte_lcore_count() - 1); > + nr_ports = RTE_MIN(rte_event_port_count(evdev), > + (int)rte_lcore_count() - 1); While I agree on the problem statement, I am trying to see 1/ an API symmetrical to ethdev APIs. Similar problem solved in a differently in ethdev. see rte_eth_dev_adjust_nb_rx_tx_desc(). Just want to make sure, all the APIs across ethdev, eventdev looks same 2/ How to get rid of above typecasting Considering above two points and following the rte_eth_dev_adjust_nb_rx_tx_desc() pattern. How about, Removing, rte_event_port_dequeue_depth() rte_event_port_enqueue_depth() rte_event_port_count() rte_event_queue_count() rte_event_queue_priority() and change to, int rte_event_port_attr_get(uint8_t dev_id, uint8_t port_id, uint8_t *enqueue_depth /*out */, uint8_t *dequeue_depth /* out*/, uin8_t *count /*out*/); int rte_event_queue_attr_get(uint8_t dev_id, uint8_t port_id, uin8_t *prio /* out */, uint8_t *count /*out */); or something similar.