[dpdk-dev,v2,1/7] eventdev: add API to get service id
Checks
Commit Message
From: Pavan Bhagavatula <pbhagavatula@caviumnetworks.com>
In case of sw event device the scheduling can be done on a service core
using the service registered at the time of probe.
This patch adds a helper function to get the service id that can be used
by the application to assign a lcore for the service to run on.
Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
---
v2 changes:
- fix checkpatch issues
- update eventdev versio map
- fix --slcore option not removed in app/test-event-dev
lib/librte_eventdev/rte_eventdev.c | 17 +++++++++++++++++
lib/librte_eventdev/rte_eventdev.h | 22 ++++++++++++++++++++++
lib/librte_eventdev/rte_eventdev_version.map | 1 +
3 files changed, 40 insertions(+)
--
2.7.4
Comments
> From: Pavan Nikhilesh [mailto:pbhagavatula@caviumnetworks.com]
> Sent: Friday, October 13, 2017 5:37 PM
> To: jerin.jacob@caviumnetworks.com; hemant.agrawal@nxp.com; Van Haaren,
> Harry <harry.van.haaren@intel.com>
> Cc: dev@dpdk.org; Pavan Bhagavatula <pbhagavatula@caviumnetworks.com>
> Subject: [dpdk-dev] [PATCH v2 1/7] eventdev: add API to get service id
>
> From: Pavan Bhagavatula <pbhagavatula@caviumnetworks.com>
>
> In case of sw event device the scheduling can be done on a service core
> using the service registered at the time of probe.
> This patch adds a helper function to get the service id that can be used
> by the application to assign a lcore for the service to run on.
>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
<snip>
> * Dump internal information about *dev_id* to the FILE* provided in *f*.
> *
> * @param dev_id
> diff --git a/lib/librte_eventdev/rte_eventdev_version.map
> b/lib/librte_eventdev/rte_eventdev_version.map
> index d555b19..59c36a0 100644
> --- a/lib/librte_eventdev/rte_eventdev_version.map
> +++ b/lib/librte_eventdev/rte_eventdev_version.map
> @@ -53,6 +53,7 @@ DPDK_17.11 {
> rte_event_dev_attr_get;
> rte_event_port_attr_get;
> rte_event_queue_attr_get;
> + rte_event_dev_service_id_get;
Version-map diff didn't apply cleanly - probably better fixed on apply;
Also, I think the functions are supposed to be in alphabetical order.
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
On Fri, Oct 20, 2017 at 10:21:57AM +0000, Van Haaren, Harry wrote:
> > From: Pavan Nikhilesh [mailto:pbhagavatula@caviumnetworks.com]
> > Sent: Friday, October 13, 2017 5:37 PM
> > To: jerin.jacob@caviumnetworks.com; hemant.agrawal@nxp.com; Van Haaren,
> > Harry <harry.van.haaren@intel.com>
> > Cc: dev@dpdk.org; Pavan Bhagavatula <pbhagavatula@caviumnetworks.com>
> > Subject: [dpdk-dev] [PATCH v2 1/7] eventdev: add API to get service id
> >
> > From: Pavan Bhagavatula <pbhagavatula@caviumnetworks.com>
> >
> > In case of sw event device the scheduling can be done on a service core
> > using the service registered at the time of probe.
> > This patch adds a helper function to get the service id that can be used
> > by the application to assign a lcore for the service to run on.
> >
> > Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
>
> <snip>
>
> > * Dump internal information about *dev_id* to the FILE* provided in *f*.
> > *
> > * @param dev_id
> > diff --git a/lib/librte_eventdev/rte_eventdev_version.map
> > b/lib/librte_eventdev/rte_eventdev_version.map
> > index d555b19..59c36a0 100644
> > --- a/lib/librte_eventdev/rte_eventdev_version.map
> > +++ b/lib/librte_eventdev/rte_eventdev_version.map
> > @@ -53,6 +53,7 @@ DPDK_17.11 {
> > rte_event_dev_attr_get;
> > rte_event_port_attr_get;
> > rte_event_queue_attr_get;
> > + rte_event_dev_service_id_get;
>
>
> Version-map diff didn't apply cleanly - probably better fixed on apply;
> Also, I think the functions are supposed to be in alphabetical order.
>
Yep, will fix in v3.
> Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
@@ -961,6 +961,23 @@ rte_event_dequeue_timeout_ticks(uint8_t dev_id, uint64_t ns,
}
int
+rte_event_dev_service_id_get(uint8_t dev_id, uint32_t *service_id)
+{
+ struct rte_eventdev *dev;
+
+ RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL);
+ dev = &rte_eventdevs[dev_id];
+
+ if (service_id == NULL)
+ return -EINVAL;
+
+ if (dev->data->service_inited)
+ *service_id = dev->data->service_id;
+
+ return dev->data->service_inited ? 0 : -ESRCH;
+}
+
+int
rte_event_dev_dump(uint8_t dev_id, FILE *f)
{
struct rte_eventdev *dev;
@@ -1116,6 +1116,10 @@ struct rte_eventdev_data {
/**< Event device capabilities(RTE_EVENT_DEV_CAP_)*/
struct rte_event_dev_config dev_conf;
/**< Configuration applied to device. */
+ uint8_t service_inited;
+ /* Service initialization state */
+ uint32_t service_id;
+ /* Service ID*/
RTE_STD_C11
uint8_t dev_started : 1;
@@ -1619,6 +1623,24 @@ rte_event_port_links_get(uint8_t dev_id, uint8_t port_id,
uint8_t queues[], uint8_t priorities[]);
/**
+ * Retrieve the service ID of the event dev. If the adapter doesn't use
+ * a rte_service function, this function returns -ESRCH.
+ *
+ * @param dev_id
+ * The identifier of the device.
+ *
+ * @param [out] service_id
+ * A pointer to a uint32_t, to be filled in with the service id.
+ *
+ * @return
+ * - 0: Success
+ * - <0: Error code on failure, if the event dev doesn't use a rte_service
+ * function, this function returns -ESRCH.
+ */
+int
+rte_event_dev_service_id_get(uint8_t dev_id, uint32_t *service_id);
+
+/**
* Dump internal information about *dev_id* to the FILE* provided in *f*.
*
* @param dev_id
@@ -53,6 +53,7 @@ DPDK_17.11 {
rte_event_dev_attr_get;
rte_event_port_attr_get;
rte_event_queue_attr_get;
+ rte_event_dev_service_id_get;
rte_event_eth_rx_adapter_create;
rte_event_eth_rx_adapter_free;