DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] examples/service_cores: check lcores before test run
@ 2018-10-12 13:14 Vipin Varghese
  2018-10-17 14:57 ` Van Haaren, Harry
  0 siblings, 1 reply; 3+ messages in thread
From: Vipin Varghese @ 2018-10-12 13:14 UTC (permalink / raw)
  To: dev, harry.van.haaren; +Cc: stephen1.byrne, Vipin Varghese

The service core samples has varied profiles created to run on specified
lcore count. The patch adds the check before each run, to ensure
example has sufficent lcores to be added as service cores on given run
profile. If sufficent cores are not found, the run is skipped with user
notification.

Signed-off-by: Vipin Varghese <vipin.varghese@intel.com>
---
 examples/service_cores/main.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/examples/service_cores/main.c b/examples/service_cores/main.c
index 2cd572904..c7c792810 100644
--- a/examples/service_cores/main.c
+++ b/examples/service_cores/main.c
@@ -118,6 +118,12 @@ apply_profile(int profile_id)
 	struct profile *p = &profiles[profile_id];
 	const uint8_t core_off = 1;
 
+	if (p->num_cores > rte_lcore_count() + 1) {
+		printf("insufficent cores to run (%s)",
+			p->name);
+		return;
+	}
+
 	for (i = 0; i < p->num_cores; i++) {
 		uint32_t core = i + core_off;
 		ret = rte_service_lcore_add(core);
-- 
2.17.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] examples/service_cores: check lcores before test run
  2018-10-12 13:14 [dpdk-dev] [PATCH] examples/service_cores: check lcores before test run Vipin Varghese
@ 2018-10-17 14:57 ` Van Haaren, Harry
  2018-10-29  2:06   ` Thomas Monjalon
  0 siblings, 1 reply; 3+ messages in thread
From: Van Haaren, Harry @ 2018-10-17 14:57 UTC (permalink / raw)
  To: dev; +Cc: Byrne, Stephen1, Varghese, Vipin

> -----Original Message-----
> From: Varghese, Vipin
> Sent: Friday, October 12, 2018 6:14 AM
> To: dev@dpdk.org; Van Haaren, Harry <harry.van.haaren@intel.com>
> Cc: Byrne, Stephen1 <stephen1.byrne@intel.com>; Varghese, Vipin
> <vipin.varghese@intel.com>
> Subject: [PATCH] examples/service_cores: check lcores before test run
> 
> The service core samples has varied profiles created to run on specified
> lcore count. The patch adds the check before each run, to ensure
> example has sufficent lcores to be added as service cores on given run
> profile. If sufficent cores are not found, the run is skipped with user
> notification.
> 
> Signed-off-by: Vipin Varghese <vipin.varghese@intel.com>
> ---

The +1 feels weird, but given there's a core offset of 1 above,
this seems like the best solution:

Acked-by: Harry van Haaren <harry.van.haaren@intel.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] examples/service_cores: check lcores before test run
  2018-10-17 14:57 ` Van Haaren, Harry
@ 2018-10-29  2:06   ` Thomas Monjalon
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2018-10-29  2:06 UTC (permalink / raw)
  To: Varghese, Vipin; +Cc: dev, Van Haaren, Harry, Byrne, Stephen1

17/10/2018 16:57, Van Haaren, Harry:
> From: Varghese, Vipin
> > 
> > The service core samples has varied profiles created to run on specified
> > lcore count. The patch adds the check before each run, to ensure
> > example has sufficent lcores to be added as service cores on given run
> > profile. If sufficent cores are not found, the run is skipped with user
> > notification.
> > 
> > Signed-off-by: Vipin Varghese <vipin.varghese@intel.com>
> > ---
> 
> The +1 feels weird, but given there's a core offset of 1 above,
> this seems like the best solution:
> 
> Acked-by: Harry van Haaren <harry.van.haaren@intel.com>

Applied, thanks

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-10-29  2:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-12 13:14 [dpdk-dev] [PATCH] examples/service_cores: check lcores before test run Vipin Varghese
2018-10-17 14:57 ` Van Haaren, Harry
2018-10-29  2:06   ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).