[dpdk-dev] [PATCH] example: add new service cores sample application
Van Haaren, Harry
harry.van.haaren at intel.com
Thu Oct 19 12:02:14 CEST 2017
> From: Eads, Gage
> Sent: Monday, September 25, 2017 5:32 PM
> To: Van Haaren, Harry <harry.van.haaren at intel.com>
> Cc: dev at dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] example: add new service cores sample application
>
> Neat example. Looks good overall, I just have a few questions.
>
> > +#define PROFILE_SERVICE_PER_CORE 8
>
> Any reason not to use 5 here? That would remove a few zeroes from the profiles[] initializers.
Nope - good suggestion, Fixed in v2.
> > +static int
> > +apply_profile(int profile_id)
> > +{
> > + uint32_t i;
> > + uint32_t s;
> > + int ret;
> > + struct profile *p = &profiles[profile_id];
> > + const uint8_t core_off = 1;
> > +
> > + for (i = 0; i < p->num_cores; i++) {
> > + ret = rte_service_lcore_add(i + core_off);
> > + if (ret && ret != -EALREADY)
> > + printf("core %d added ret %d\n", i + core_off, ret);
>
> I'm wondering if this and the other printfs in this function should be rte_panics? These seem like fatal errors.
They're not fatal, they shouldn't (and don't) occur in the sample app. The error handling is there to be a good example - panic() doesn't seem a good suggestion to handle and error.. I'll leave as is.
>
> > +
> > + ret = rte_service_lcore_start(i + core_off);
> > + if (ret && ret != -EALREADY)
> > + printf("core %d start ret %d\n", i + core_off, ret);
> > +
> > + for (s = 0; s < NUM_SERVICES; s++) {
> > + if (rte_service_map_lcore_set(s, i + core_off,
> > + p->cores[i].mapped_services[s]))
> > + rte_panic("failed to map lcore to 1\n");
>
> What does '1' refer to here? Perhaps it should be: rte_panic("failed to map lcore %d to %s\n", i + core_off, services[s].name);
Good catch, fixed in v2.
More information about the dev
mailing list