[dpdk-dev] [PATCH v3 5/7] service cores: enable event/sw with service

Jerin Jacob jerin.jacob at caviumnetworks.com
Tue Jul 4 12:52:30 CEST 2017


-----Original Message-----
> Date: Sun, 2 Jul 2017 22:35:12 +0100
> From: Harry van Haaren <harry.van.haaren at intel.com>
> To: dev at dpdk.org
> CC: jerin.jacob at caviumnetworks.com, thomas at monjalon.net,
>  keith.wiles at intel.com, bruce.richardson at intel.com, Harry van Haaren
>  <harry.van.haaren at intel.com>
> Subject: [PATCH v3 5/7] service cores: enable event/sw with service
> X-Mailer: git-send-email 2.7.4
> 
> This commit shows how easy it is to enable a specific
> DPDK component with a service callback, in order to get
> CPU cycles for it.
> 
> The beauty of this method is that the service is unaware
> of how much CPU time it is getting - the application can
> decide how to split and slice cores and map them to the
> registered services.
> 
> Signed-off-by: Harry van Haaren <harry.van.haaren at intel.com>
> 
> ---
> 
> v2:
> - Remove #include <rte_cycles.h> (Jerin)
> - Remove development prints (Jerin)
> - Track service name in PMD
> - Print warning if service does not have an lcore mapped (Jerin)
> ---
>  drivers/event/sw/sw_evdev.c | 32 ++++++++++++++++++++++++++++++++
>  drivers/event/sw/sw_evdev.h |  3 +++
>  2 files changed, 35 insertions(+)
> 
> diff --git a/drivers/event/sw/sw_evdev.c b/drivers/event/sw/sw_evdev.c
> index fe2a61e..baab376 100644
> --- a/drivers/event/sw/sw_evdev.c
> +++ b/drivers/event/sw/sw_evdev.c
> @@ -38,6 +38,7 @@
>  #include <rte_kvargs.h>
>  #include <rte_ring.h>
>  #include <rte_errno.h>
> +#include <rte_service_private.h>
>  
>  #include "sw_evdev.h"
>  #include "iq_ring.h"
> @@ -597,6 +598,13 @@ sw_start(struct rte_eventdev *dev)
>  {
>  	unsigned int i, j;
>  	struct sw_evdev *sw = sw_pmd_priv(dev);
> +
> +	/* check a service core is mapped to this service */
> +	struct rte_service_spec *s = rte_service_get_by_name(sw->service_name);
> +	if (!rte_service_is_running(s))
> +		SW_LOG_ERR("Warning: No Service core enabled on service %s\n",
> +				s->name);

For now, we can print just Warning. Once we remove schedule api from
eventdev then we can make it as error. Right?

Acked-by: Jerin Jacob <jerin.jacob at caviumnetworks.com>


More information about the dev mailing list