Re: [PATCH] example: add new service cores sample application
From: Van Haaren, Harry <hidden>
Date: 2017-10-19 10:02:16
From: Eads, Gage Sent: Monday, September 25, 2017 5:32 PM To: Van Haaren, Harry <redacted> Cc: dev@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.quoted
+#define PROFILE_SERVICE_PER_CORE 8Any reason not to use 5 here? That would remove a few zeroes from the profiles[] initializers.
Nope - good suggestion, Fixed in v2.
quoted
+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.
quoted
+ + 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.