hs-test: CPU allocation improvements

- Release build runs on numa node0, debug on node1.
  Using the last digit of a build number to reserve 4 cores per test
  mmeans we can run 20 jobs (10 release, 10 debug) on the same machine,
  assuming we have 111 cores available (not counting core 0).
  Can be increased if needed, there are still some cores left.
- Added separate numa aware cpu allocation
- Added CPU0=true|false (useful for users with 4c/8t)

Type: test

Change-Id: Iba8e492a4e01a7f457e49112303887a2a27f6af9
Signed-off-by: Adrian Villin <avillin@cisco.com>
diff --git a/extras/hs-test/Makefile b/extras/hs-test/Makefile
index 596acb1..e326e9f 100644
--- a/extras/hs-test/Makefile
+++ b/extras/hs-test/Makefile
@@ -41,6 +41,10 @@
 REPEAT=0
 endif
 
+ifeq ($(CPU0),)
+CPU0=false
+endif
+
 ifeq ($(VPPSRC),)
 VPPSRC=$(shell pwd)/../..
 endif
@@ -81,6 +85,7 @@
 	@echo " VPPSRC=[path-to-vpp-src] - path to vpp source files (for gdb)"
 	@echo " PARALLEL=[n-cpus]        - number of test processes to spawn to run in parallel"
 	@echo " REPEAT=[n]               - repeat tests up to N times or until a failure occurs"
+	@echo " CPU0=[true|false]        - use cpu0"
 	@echo
 	@echo "List of all tests:"
 	@$(MAKE) list-tests
@@ -117,7 +122,7 @@
 	@# necessary so gmake won't skip executing the bash script
 	@-bash ./hs_test.sh --persist=$(PERSIST) --verbose=$(VERBOSE) \
 		--unconfigure=$(UNCONFIGURE) --debug=$(DEBUG) --test=$(TEST) --cpus=$(CPUS) \
-		--vppsrc=$(VPPSRC) --parallel=$(PARALLEL) --repeat=$(REPEAT)
+		--vppsrc=$(VPPSRC) --parallel=$(PARALLEL) --repeat=$(REPEAT) --cpu0=$(CPU0)
 	@bash ./script/compress.sh
 
 .PHONY: test-debug
@@ -126,14 +131,15 @@
 	@# necessary so gmake won't skip executing the bash script
 	@-bash ./hs_test.sh --persist=$(PERSIST) --verbose=$(VERBOSE) \
 		--unconfigure=$(UNCONFIGURE) --debug=$(DEBUG) --test=$(TEST) --cpus=$(CPUS) \
-		--vppsrc=$(VPPSRC) --parallel=$(PARALLEL) --repeat=$(REPEAT) --debug_build=true
+		--vppsrc=$(VPPSRC) --parallel=$(PARALLEL) --repeat=$(REPEAT) --debug_build=true \
+		--cpu0=$(CPU0)
 	@bash ./script/compress.sh
 
 .PHONY: test-cov
 test-cov: .deps.ok .build.cov.ok
 	@-bash ./hs_test.sh --persist=$(PERSIST) --verbose=$(VERBOSE) \
 		--unconfigure=$(UNCONFIGURE) --debug=$(DEBUG) --test=$(TEST-HS) --cpus=$(CPUS) \
-		--vppsrc=$(VPPSRC)
+		--vppsrc=$(VPPSRC) --cpu0=$(CPU0)
 	@$(MAKE) -C ../.. test-cov-post HS_TEST=1
 	@bash ./script/compress.sh