patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Kevin Traynor <ktraynor@redhat.com>
To: Vamsi Attunuru <vattunuru@marvell.com>
Cc: David Marchand <david.marchand@redhat.com>,
	dpdk stable <stable@dpdk.org>
Subject: [dpdk-stable] patch 'test/eal: fix --socket-mem option' has been queued to LTS release 18.11.3
Date: Thu,  5 Sep 2019 11:17:23 +0100	[thread overview]
Message-ID: <20190905101754.21933-23-ktraynor@redhat.com> (raw)
In-Reply-To: <20190905101754.21933-1-ktraynor@redhat.com>

Hi,

FYI, your patch has been queued to LTS release 18.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 09/12/19. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable-queue/commit/a661dbf0ca7e9ee7b012fe24a0cd4114529e7e28

Thanks.

Kevin Traynor

---
From a661dbf0ca7e9ee7b012fe24a0cd4114529e7e28 Mon Sep 17 00:00:00 2001
From: Vamsi Attunuru <vattunuru@marvell.com>
Date: Mon, 29 Jul 2019 10:08:50 +0200
Subject: [PATCH] test/eal: fix --socket-mem option

[ upstream commit ae0976c37bbc2748faa1c2d0cac273c7733f34b8 ]

eal flag autotest fails when multiple mem size flags are passed to
--socket-mem option irrespective of RTE_MAX_NUMA_NODES and the number of
available sockets on the test system.

Fixes: 45f1b6e8680a ("app: add new tests on eal flags")

Signed-off-by: Vamsi Attunuru <vattunuru@marvell.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Vamsi Attunuru <vattunuru@marvell.com>
Tested-by: Vamsi Attunuru <vattunuru@marvell.com>
---
 test/test/test_eal_flags.c | 144 ++++++++++++++++++++++---------------
 1 file changed, 86 insertions(+), 58 deletions(-)

diff --git a/test/test/test_eal_flags.c b/test/test/test_eal_flags.c
index 775ccd3dd..f70fb07e1 100644
--- a/test/test/test_eal_flags.c
+++ b/test/test/test_eal_flags.c
@@ -1134,4 +1134,38 @@ test_file_prefix(void)
 }
 
+/* This function writes in passed buf pointer a valid --socket-mem= option
+ * for num_sockets then concatenates the provided suffix string.
+ *
+ * Example for num_sockets 4, mem "2", suffix "plop"
+ * --socket-mem=2,2,2,2plop
+ */
+static void
+populate_socket_mem_param(int num_sockets, const char *mem,
+		const char *suffix, char *buf, size_t buf_size)
+{
+	unsigned int offset = 0;
+	int written;
+	int i;
+
+	written = snprintf(&buf[offset], buf_size - offset, "--socket-mem=");
+	if (written < 0 || written + offset >= buf_size)
+		return;
+	offset += written;
+
+	for (i = 0; i < num_sockets - 1; i++) {
+		written = snprintf(&buf[offset], buf_size - offset,
+			"%s,", mem);
+		if (written < 0 || written + offset >= buf_size)
+			return;
+		offset += written;
+	}
+
+	written = snprintf(&buf[offset], buf_size - offset, "%s%s", mem,
+		suffix);
+	if (written < 0 || written + offset >= buf_size)
+		return;
+	offset += written;
+}
+
 /*
  * Tests for correct handling of -m and --socket-mem flags
@@ -1161,22 +1195,27 @@ test_memory_flags(void)
 
 	/* valid (zero) --socket-mem flag */
+	char arg2_socket_mem[SOCKET_MEM_STRLEN];
 	const char *argv2[] = {prgname, "-c", "10", "-n", "2",
-			"--file-prefix=" memtest, "--socket-mem=0,0,0,0"};
+			"--file-prefix=" memtest, arg2_socket_mem};
 
 	/* invalid (incomplete) --socket-mem flag */
+	char arg3_socket_mem[SOCKET_MEM_STRLEN];
 	const char *argv3[] = {prgname, "-c", "10", "-n", "2",
-			"--file-prefix=" memtest, "--socket-mem=2,2,"};
+			"--file-prefix=" memtest, arg3_socket_mem};
 
 	/* invalid (mixed with invalid data) --socket-mem flag */
+	char arg4_socket_mem[SOCKET_MEM_STRLEN];
 	const char *argv4[] = {prgname, "-c", "10", "-n", "2",
-			"--file-prefix=" memtest, "--socket-mem=2,2,Fred"};
+			"--file-prefix=" memtest, arg4_socket_mem};
 
 	/* invalid (with numeric value as last character) --socket-mem flag */
+	char arg5_socket_mem[SOCKET_MEM_STRLEN];
 	const char *argv5[] = {prgname, "-c", "10", "-n", "2",
-			"--file-prefix=" memtest, "--socket-mem=2,2,Fred0"};
+			"--file-prefix=" memtest, arg5_socket_mem};
 
 	/* invalid (with empty socket) --socket-mem flag */
+	char arg6_socket_mem[SOCKET_MEM_STRLEN];
 	const char *argv6[] = {prgname, "-c", "10", "-n", "2",
-			"--file-prefix=" memtest, "--socket-mem=2,,2"};
+			"--file-prefix=" memtest, arg6_socket_mem};
 
 	/* invalid (null) --socket-mem flag */
@@ -1185,16 +1224,13 @@ test_memory_flags(void)
 
 	/* valid --socket-mem specified together with -m flag */
+	char arg8_socket_mem[SOCKET_MEM_STRLEN];
 	const char *argv8[] = {prgname, "-c", "10", "-n", "2",
-			"--file-prefix=" memtest, "-m", DEFAULT_MEM_SIZE, "--socket-mem=2,2"};
-
-	/* construct an invalid socket mask with 2 megs on each socket plus
-	 * extra 2 megs on socket that doesn't exist on current system */
-	char invalid_socket_mem[SOCKET_MEM_STRLEN];
-	char buf[SOCKET_MEM_STRLEN];	/* to avoid copying string onto itself */
+			"--file-prefix=" memtest, "-m", DEFAULT_MEM_SIZE,
+			arg8_socket_mem};
 
 #ifdef RTE_EXEC_ENV_BSDAPP
-	int i, num_sockets = 1;
+	int num_sockets = 1;
 #else
-	int i, num_sockets = RTE_MIN(get_number_of_sockets(),
+	int num_sockets = RTE_MIN(get_number_of_sockets(),
 			RTE_MAX_NUMA_NODES);
 #endif
@@ -1205,40 +1241,11 @@ test_memory_flags(void)
 	}
 
-	snprintf(invalid_socket_mem, sizeof(invalid_socket_mem), "--socket-mem=");
-
-	/* add one extra socket */
-	for (i = 0; i < num_sockets + 1; i++) {
-		snprintf(buf, sizeof(buf), "%s%s", invalid_socket_mem, DEFAULT_MEM_SIZE);
-		strlcpy(invalid_socket_mem, buf, sizeof(invalid_socket_mem));
-
-		if (num_sockets + 1 - i > 1) {
-			snprintf(buf, sizeof(buf), "%s,", invalid_socket_mem);
-			strlcpy(invalid_socket_mem, buf,
-				sizeof(invalid_socket_mem));
-		}
-	}
-
-	/* construct a valid socket mask with 2 megs on each existing socket */
-	char valid_socket_mem[SOCKET_MEM_STRLEN];
-
-	snprintf(valid_socket_mem, sizeof(valid_socket_mem), "--socket-mem=");
-
-	/* add one extra socket */
-	for (i = 0; i < num_sockets; i++) {
-		snprintf(buf, sizeof(buf), "%s%s", valid_socket_mem, DEFAULT_MEM_SIZE);
-		strlcpy(valid_socket_mem, buf, sizeof(valid_socket_mem));
-
-		if (num_sockets - i > 1) {
-			snprintf(buf, sizeof(buf), "%s,", valid_socket_mem);
-			strlcpy(valid_socket_mem, buf,
-				sizeof(valid_socket_mem));
-		}
-	}
-
 	/* invalid --socket-mem flag (with extra socket) */
+	char invalid_socket_mem[SOCKET_MEM_STRLEN];
 	const char *argv9[] = {prgname, "-c", "10", "-n", "2",
 			"--file-prefix=" memtest, invalid_socket_mem};
 
 	/* valid --socket-mem flag */
+	char valid_socket_mem[SOCKET_MEM_STRLEN];
 	const char *argv10[] = {prgname, "-c", "10", "-n", "2",
 			"--file-prefix=" memtest, valid_socket_mem};
@@ -1258,4 +1265,7 @@ test_memory_flags(void)
 		return -1;
 	}
+
+	populate_socket_mem_param(num_sockets, "0", "",
+		arg2_socket_mem, sizeof(arg2_socket_mem));
 	if (launch_proc(argv2) != 0) {
 		printf("Error - process failed with valid (zero) --socket-mem!\n");
@@ -1263,27 +1273,39 @@ test_memory_flags(void)
 	}
 
-	if (launch_proc(argv3) == 0) {
-		printf("Error - process run ok with invalid "
+	if (num_sockets > 1) {
+		populate_socket_mem_param(num_sockets - 1, "2", ",",
+			arg3_socket_mem, sizeof(arg3_socket_mem));
+		if (launch_proc(argv3) == 0) {
+			printf("Error - process run ok with invalid "
 				"(incomplete) --socket-mem!\n");
-		return -1;
-	}
+			return -1;
+		}
 
-	if (launch_proc(argv4) == 0) {
-		printf("Error - process run ok with invalid "
+		populate_socket_mem_param(num_sockets - 1, "2", ",Fred",
+			arg4_socket_mem, sizeof(arg4_socket_mem));
+		if (launch_proc(argv4) == 0) {
+			printf("Error - process run ok with invalid "
 				"(mixed with invalid input) --socket-mem!\n");
-		return -1;
-	}
+			return -1;
+		}
 
-	if (launch_proc(argv5) == 0) {
-		printf("Error - process run ok with invalid "
+		populate_socket_mem_param(num_sockets - 1, "2", ",Fred0",
+			arg5_socket_mem, sizeof(arg5_socket_mem));
+		if (launch_proc(argv5) == 0) {
+			printf("Error - process run ok with invalid "
 				"(mixed with invalid input with a numeric value as "
 				"last character) --socket-mem!\n");
-		return -1;
+			return -1;
+		}
 	}
 
-	if (launch_proc(argv6) == 0) {
-		printf("Error - process run ok with invalid "
+	if (num_sockets > 2) {
+		populate_socket_mem_param(num_sockets - 2, "2", ",,2",
+			arg6_socket_mem, sizeof(arg6_socket_mem));
+		if (launch_proc(argv6) == 0) {
+			printf("Error - process run ok with invalid "
 				"(with empty socket) --socket-mem!\n");
-		return -1;
+			return -1;
+		}
 	}
 
@@ -1293,4 +1315,6 @@ test_memory_flags(void)
 	}
 
+	populate_socket_mem_param(num_sockets, "2", "",
+		arg8_socket_mem, sizeof(arg8_socket_mem));
 	if (launch_proc(argv8) == 0) {
 		printf("Error - process run ok with --socket-mem and -m specified!\n");
@@ -1298,4 +1322,6 @@ test_memory_flags(void)
 	}
 
+	populate_socket_mem_param(num_sockets + 1, "2", "",
+		invalid_socket_mem, sizeof(invalid_socket_mem));
 	if (launch_proc(argv9) == 0) {
 		printf("Error - process run ok with extra socket in --socket-mem!\n");
@@ -1303,4 +1329,6 @@ test_memory_flags(void)
 	}
 
+	populate_socket_mem_param(num_sockets, "2", "",
+		valid_socket_mem, sizeof(valid_socket_mem));
 	if (launch_proc(argv10) != 0) {
 		printf("Error - process failed with valid --socket-mem!\n");
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-09-05 10:36:48.926939879 +0100
+++ 0023-test-eal-fix-socket-mem-option.patch	2019-09-05 10:36:47.518700331 +0100
@@ -1 +1 @@
-From ae0976c37bbc2748faa1c2d0cac273c7733f34b8 Mon Sep 17 00:00:00 2001
+From a661dbf0ca7e9ee7b012fe24a0cd4114529e7e28 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit ae0976c37bbc2748faa1c2d0cac273c7733f34b8 ]
+
@@ -11 +12,0 @@
-Cc: stable@dpdk.org
@@ -18 +19 @@
- app/test/test_eal_flags.c | 144 +++++++++++++++++++++++---------------
+ test/test/test_eal_flags.c | 144 ++++++++++++++++++++++---------------
@@ -21,5 +22,5 @@
-diff --git a/app/test/test_eal_flags.c b/app/test/test_eal_flags.c
-index 672ca0a7c..827ea8831 100644
---- a/app/test/test_eal_flags.c
-+++ b/app/test/test_eal_flags.c
-@@ -1251,4 +1251,38 @@ test_file_prefix(void)
+diff --git a/test/test/test_eal_flags.c b/test/test/test_eal_flags.c
+index 775ccd3dd..f70fb07e1 100644
+--- a/test/test/test_eal_flags.c
++++ b/test/test/test_eal_flags.c
+@@ -1134,4 +1134,38 @@ test_file_prefix(void)
@@ -64 +65 @@
-@@ -1278,22 +1312,27 @@ test_memory_flags(void)
+@@ -1161,22 +1195,27 @@ test_memory_flags(void)
@@ -68 +69 @@
- 	const char *argv2[] = {prgname,
+ 	const char *argv2[] = {prgname, "-c", "10", "-n", "2",
@@ -74 +75 @@
- 	const char *argv3[] = {prgname,
+ 	const char *argv3[] = {prgname, "-c", "10", "-n", "2",
@@ -80 +81 @@
- 	const char *argv4[] = {prgname,
+ 	const char *argv4[] = {prgname, "-c", "10", "-n", "2",
@@ -86 +87 @@
- 	const char *argv5[] = {prgname,
+ 	const char *argv5[] = {prgname, "-c", "10", "-n", "2",
@@ -92 +93 @@
- 	const char *argv6[] = {prgname,
+ 	const char *argv6[] = {prgname, "-c", "10", "-n", "2",
@@ -97 +98 @@
-@@ -1302,16 +1341,13 @@ test_memory_flags(void)
+@@ -1185,16 +1224,13 @@ test_memory_flags(void)
@@ -101 +102 @@
- 	const char *argv8[] = {prgname,
+ 	const char *argv8[] = {prgname, "-c", "10", "-n", "2",
@@ -111 +112 @@
- #ifdef RTE_EXEC_ENV_FREEBSD
+ #ifdef RTE_EXEC_ENV_BSDAPP
@@ -119 +120 @@
-@@ -1322,40 +1358,11 @@ test_memory_flags(void)
+@@ -1205,40 +1241,11 @@ test_memory_flags(void)
@@ -155 +156 @@
- 	const char *argv9[] = {prgname,
+ 	const char *argv9[] = {prgname, "-c", "10", "-n", "2",
@@ -160 +161 @@
- 	const char *argv10[] = {prgname,
+ 	const char *argv10[] = {prgname, "-c", "10", "-n", "2",
@@ -162 +163 @@
-@@ -1375,4 +1382,7 @@ test_memory_flags(void)
+@@ -1258,4 +1265,7 @@ test_memory_flags(void)
@@ -170 +171 @@
-@@ -1380,27 +1390,39 @@ test_memory_flags(void)
+@@ -1263,27 +1273,39 @@ test_memory_flags(void)
@@ -224 +225 @@
-@@ -1410,4 +1432,6 @@ test_memory_flags(void)
+@@ -1293,4 +1315,6 @@ test_memory_flags(void)
@@ -231 +232 @@
-@@ -1415,4 +1439,6 @@ test_memory_flags(void)
+@@ -1298,4 +1322,6 @@ test_memory_flags(void)
@@ -238 +239 @@
-@@ -1420,4 +1446,6 @@ test_memory_flags(void)
+@@ -1303,4 +1329,6 @@ test_memory_flags(void)

  parent reply	other threads:[~2019-09-05 10:18 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-05 10:17 [dpdk-stable] patch 'ethdev: avoid getting uninitialized info for bad port' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'vfio: use contiguous mapping for IOVA as VA mode' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'compress/zlib: fix error handling' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'cryptodev: fix typo in comment' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'security: remove duplicated symbols from map file' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'net/i40e: fix RSS hash update for X722 VF' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'net/sfc: fix power of 2 round up when align has smaller type' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'net/sfc: fix align to power of 2 " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'net/sfc: unify power of 2 alignment check macro' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'net/bnxt: fix extended port counter statistics' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'net/bnxt: reduce verbosity of a message' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'net/pcap: fix Rx with small buffers' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'net/pcap: fix Tx return count in error conditions' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'net/avf: fix endless loop' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'net/ixgbe: fix RETA size for VF' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'igb_uio: fix build on Linux 5.3 for fall through' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'distributor: fix livelock on flush' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'app/testpmd: fix eth packet dump for small buffers' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'app/testpmd: rename ambiguous VF config variable' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'examples/ip_frag: remove Tx fast free offload flag' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'examples/ptpclient: fix delay request message' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'test: enable installing app with meson' " Kevin Traynor
2019-09-05 10:17 ` Kevin Traynor [this message]
2019-09-05 10:17 ` [dpdk-stable] patch 'net/virtio: fix build' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'examples/l3fwd: fix unaligned memory access on x86' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'eal: fix control thread affinity with --lcores' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'doc: update features supported by mlx' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'usertools: replace unsafe input function' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'devtools: fix building kernel component tags' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'test/flow_classify: fix undefined behavior' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'acl: fix undefined behavior of bit shifts' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'test: remove link to ixgbe/i40e with meson' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'eal: hide internal function' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'bus/pci: remove unused x86 Linux constant' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'net/dpaa: fix build with 0 headroom' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'bus/fslmc: " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'net/virtio: " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'net/ena: fix L4 checksum Tx offload' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'doc: add co-existence consideration for bnx2x' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'doc: add co-existence consideration for qede' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'net/thunderx: fix crash on detach' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'examples/bpf: fix build' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'net/ixgbe: fix address of first segment' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'net/i40e: " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'net/avf: " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'net/fm10k: " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'net/mlx4: fix crash on info query in secondary process' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'net/mlx5: fix validation of VLAN PCP item' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'net/mlx5: fix VLAN inner type matching on DR/DV' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'net/mlx5: fix link speed info when link is down' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'app/testpmd: fix latency stats deinit on signal' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'net/ixgbe/base: fix product version check' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'eal: increase maximum different hugepage sizes on Arm' " Kevin Traynor
2019-09-05 10:17 ` [dpdk-stable] patch 'usertools: fix input handling in telemetry script' " Kevin Traynor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190905101754.21933-23-ktraynor@redhat.com \
    --to=ktraynor@redhat.com \
    --cc=david.marchand@redhat.com \
    --cc=stable@dpdk.org \
    --cc=vattunuru@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).