From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerin Jacob Subject: Re: [PATCH v3 1/4] eventdev: add port attribute function Date: Mon, 11 Sep 2017 22:05:18 +0530 Message-ID: <20170911163517.GB21422@jerin> References: <1504883894-43451-1-git-send-email-harry.van.haaren@intel.com> <1504885015-44642-1-git-send-email-harry.van.haaren@intel.com> <1504885015-44642-2-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-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0075.outbound.protection.outlook.com [104.47.41.75]) by dpdk.org (Postfix) with ESMTP id 18E742B84 for ; Mon, 11 Sep 2017 18:35:40 +0200 (CEST) Content-Disposition: inline In-Reply-To: <1504885015-44642-2-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: Fri, 8 Sep 2017 16:36:52 +0100 > From: Harry van Haaren > To: dev@dpdk.org > CC: jerin.jacob@caviumnetworks.com, Harry van Haaren > > Subject: [PATCH v3 1/4] eventdev: add port attribute function > X-Mailer: git-send-email 2.7.4 > > This commit reworks the port functions to retrieve information > about the port, like the enq or deq depths. Note that "port count" > is a device attribute, and is added in a later patch for dev attributes. > > Signed-off-by: Harry van Haaren > --- > lib/librte_eventdev/rte_eventdev.c | 33 +++++++++++-------- > lib/librte_eventdev/rte_eventdev.h | 49 ++++++++++++---------------- > lib/librte_eventdev/rte_eventdev_version.map | 7 ++++ > test/test/test_eventdev.c | 16 ++++++--- > 4 files changed, 59 insertions(+), 46 deletions(-) > > - > -uint8_t > -rte_event_port_count(uint8_t dev_id) > -{ > - struct rte_eventdev *dev; > + if (!is_valid_port(dev, port_id)) { > + RTE_EDEV_LOG_ERR("Invalid port_id=%" PRIu8, port_id); > + return -EINVAL; > + } > > - dev = &rte_eventdevs[dev_id]; > - return dev->data->nb_ports; > + switch (attr_id) { > + case RTE_EVENT_PORT_ATTR_ENQ_DEPTH: > + *attr_value = dev->data->ports_enqueue_depth[port_id]; > + break; > + case RTE_EVENT_PORT_ATTR_DEQ_DEPTH: > + *attr_value = dev->data->ports_dequeue_depth[port_id]; > + break; IMO, We should have "default:" case here to detect invalid attr_id here and return the error code accordingly in the header file as well. > + }; > + return 0; > } > /** > * Start an event device. > diff --git a/lib/librte_eventdev/rte_eventdev_version.map b/lib/librte_eventdev/rte_eventdev_version.map > index 4c48e5f..a0adde3 100644 > --- a/lib/librte_eventdev/rte_eventdev_version.map > +++ b/lib/librte_eventdev/rte_eventdev_version.map > @@ -51,3 +51,10 @@ DPDK_17.08 { > rte_event_ring_init; > rte_event_ring_lookup; We should delete the remove functions from here. like rte_event_port_dequeue_depth() and rte_event_port_enqueue_depth; > } DPDK_17.05; > + > +EXPERIMENTAL { Note sure we need to add EXPERIMENTAL here.(i.e other section don't have this) > + global: > + > + rte_event_port_attr_get; > + > +} DPDK_17.08;