DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: "Stephen Hemminger" <stephen@networkplumber.org>,
	"Morten Brørup" <mb@smartsharesystems.com>,
	"Olivier Matz" <olivier.matz@6wind.com>
Subject: [PATCH v3 1/4] test: remove some strings from cmdline_etheraddr tests
Date: Tue,  3 Oct 2023 13:29:06 -0700	[thread overview]
Message-ID: <20231003202909.391330-2-stephen@networkplumber.org> (raw)
In-Reply-To: <20231003202909.391330-1-stephen@networkplumber.org>

Some of the ethernet address formats which were invalid will
now become valid inputs when rte_ether_unformat_addr is modified
to allow leading zeros.

Also, make local variables static.

Acked-by: Morten Brørup <mb@smartsharesystems.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 app/test/test_cmdline_etheraddr.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/app/test/test_cmdline_etheraddr.c b/app/test/test_cmdline_etheraddr.c
index 9691c32ba250..74953dea6cb9 100644
--- a/app/test/test_cmdline_etheraddr.c
+++ b/app/test/test_cmdline_etheraddr.c
@@ -20,7 +20,7 @@ struct ether_addr_str {
 };
 
 /* valid strings */
-const struct ether_addr_str ether_addr_valid_strs[] = {
+static const struct ether_addr_str ether_addr_valid_strs[] = {
 		{"01:23:45:67:89:AB", 0xAB8967452301ULL},
 		{"4567:89AB:CDEF", 0xEFCDAB896745ULL},
 };
@@ -30,7 +30,7 @@ const struct ether_addr_str ether_addr_valid_strs[] = {
  * end of token, which is either space chars, null char or
  * a hash sign.
  */
-const char * ether_addr_garbage_strs[] = {
+static const char * const ether_addr_garbage_strs[] = {
 		"00:11:22:33:44:55\0garbage",
 		"00:11:22:33:44:55#garbage",
 		"00:11:22:33:44:55 garbage",
@@ -46,14 +46,13 @@ const char * ether_addr_garbage_strs[] = {
 #define GARBAGE_ETHERADDR 0x554433221100ULL /* corresponding address */
 
 
-const char * ether_addr_invalid_strs[] = {
+static const char * const ether_addr_invalid_strs[] = {
 		/* valid chars, invalid syntax */
 		"0123:45:67:89:AB",
 		"01:23:4567:89:AB",
 		"01:23:45:67:89AB",
 		"012:345:678:9AB",
 		"01:23:45:67:89:ABC",
-		"01:23:45:67:89:A",
 		"01:23:45:67:89",
 		"01:23:45:67:89:AB:CD",
 		/* invalid chars, valid syntax */
@@ -61,7 +60,6 @@ const char * ether_addr_invalid_strs[] = {
 		"INVA:LIDC:HARS",
 		/* misc */
 		"01 23 45 67 89 AB",
-		"01.23.45.67.89.AB",
 		"01,23,45,67,89,AB",
 		"01:23:45\0:67:89:AB",
 		"01:23:45#:67:89:AB",
-- 
2.39.2


  reply	other threads:[~2023-10-03 20:29 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-29 16:36 [RFC] rte_ether_unformat: accept more inputs Stephen Hemminger
2023-09-29 19:35 ` Morten Brørup
2023-09-29 23:08   ` Stephen Hemminger
2023-10-02 18:37 ` [PATCH v2 0/3] rte_ether_unformat_addr changes Stephen Hemminger
2023-10-02 18:37   ` [PATCH v2 1/3] test: remove some strings from cmdline_etheraddr tests Stephen Hemminger
2023-10-03 10:47     ` Ferruh Yigit
2023-10-03 10:59       ` Ferruh Yigit
2023-10-03 16:38         ` Stephen Hemminger
2023-10-03 16:36       ` Stephen Hemminger
2023-10-03 16:50         ` Ferruh Yigit
2023-10-03 17:18           ` Stephen Hemminger
2023-10-02 18:37   ` [PATCH v2 2/3] rte_ether_unformat: accept more inputs Stephen Hemminger
2023-10-02 18:37   ` [PATCH v2 3/3] test: add tests for rte_ether routines Stephen Hemminger
2023-10-03  6:17   ` [PATCH v2 0/3] rte_ether_unformat_addr changes Morten Brørup
2023-10-03 10:44   ` Ferruh Yigit
2023-10-03 16:27     ` Stephen Hemminger
2023-10-03 16:34     ` Stephen Hemminger
2023-10-03 20:29 ` [PATCH v3 0/4] rte_ether_unformat_addr related changes Stephen Hemminger
2023-10-03 20:29   ` Stephen Hemminger [this message]
2023-10-03 20:29   ` [PATCH v3 2/4] rte_ether_unformat: accept more inputs Stephen Hemminger
2023-10-03 20:29   ` [PATCH v3 3/4] test: add tests for rte_ether routines Stephen Hemminger
2023-10-03 20:29   ` [PATCH v3 4/4] net/tap: use rte_ether_unformat_address Stephen Hemminger
2023-10-11 14:25     ` Ferruh Yigit
2023-10-04 11:48   ` [PATCH v3 0/4] rte_ether_unformat_addr related changes Ferruh Yigit

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=20231003202909.391330-2-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=mb@smartsharesystems.com \
    --cc=olivier.matz@6wind.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).