Skip to contentSkip to conversation

doc: announce kvargs API change

PATCH Superseded Thomas Monjalon 5 participants 8 messages Nov 21, 2018 – Nov 24, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 doc: announce kvargs API change

In some usages, kvlist is processed one time in rte_kvargs_process(), and it is processed a second time if need to check whether it was matched. In order to simplify implementation of kvargs checks, a new callback may be used for "no match" cases.

The change of the function prototype would be as below:

int
rte_kvargs_process(const struct rte_kvargs *kvlist,
const char *key_match,
- arg_handler_t handler,
+ arg_handler_t match_handler,
+ arg_handler_t no_match_handler,
void *opaque_arg)

---
 doc/guides/rel_notes/deprecation.rst | 4 ++++
 1 file changed, 4 insertions(+)
doc/guides/rel_notes/deprecation.rst +4 -0
index 34b28234c..7af65cd4b 100644
@@ -11,6 +11,10 @@ API and ABI deprecation notices are to be posted here.
 Deprecation Notices
 -------------------
 
+* kvargs: The function ``rte_kvargs_process`` will get a new parameter
+  for a function pointer called in case of no match of the key.
+  It will ease implementation of default values or check for mandatory keys.
+
 * eal: both declaring and identifying devices will be streamlined in v18.11.
   New functions will appear to query a specific port from buses, classes of
   device and device drivers. Device declaration will be made coherent with the
Signature · 1 line
2.19.0
#1 lore raw

PATCH v2 1/1 doc: announce kvargs API change

After processing a kvlist in rte_kvargs_process(), it may be needed to loop again over kvlist in order to know whether the key is matched or not.
In order to simplify implementation of kvargs checks, a new pointer parameter may be used to get the match count.

The change of the function prototype would be as below:

int
rte_kvargs_process(const struct rte_kvargs *kvlist,
const char *key_match,
+ int *match_count,
arg_handler_t handler,
void *opaque_arg)

---
v1: callback for no-match
v2: integer for match count (Olivier suggestion)

---
 doc/guides/rel_notes/deprecation.rst | 3 +++
 1 file changed, 3 insertions(+)
doc/guides/rel_notes/deprecation.rst +3 -0
index 34b28234c..dccf7bee6 100644
@@ -11,6 +11,9 @@ API and ABI deprecation notices are to be posted here.
 Deprecation Notices
 -------------------
 
+* kvargs: The function ``rte_kvargs_process`` will get a new parameter
+  for returning key match count. It will ease handling of no-match case.
+
 * eal: both declaring and identifying devices will be streamlined in v18.11.
   New functions will appear to query a specific port from buses, classes of
   device and device drivers. Device declaration will be made coherent with the
Signature · 1 line
2.19.0
Acked-by on v2 1/1
#2 lore raw
Quoted 15 lines · Thomas Monjalon

After processing a kvlist in rte_kvargs_process(), it may be needed to loop again over kvlist in order to know whether the key is matched or not.
In order to simplify implementation of kvargs checks, a new pointer parameter may be used to get the match count.

The change of the function prototype would be as below:

int
rte_kvargs_process(const struct rte_kvargs *kvlist,

(quoted diff) +1 -0
 		const char *key_match,
+		int *match_count,
 		arg_handler_t handler,
 		void *opaque_arg)
Quoted 1 line

Maybe "unsigned int" instead of "int".

Apart from this,

#3 lore raw

22/11/2018 14:22, Olivier Matz:

Quoted 16 lines · Thomas Monjalon
Quoted 15 lines

After processing a kvlist in rte_kvargs_process(), it may be needed to loop again over kvlist in order to know whether the key is matched or not.
In order to simplify implementation of kvargs checks, a new pointer parameter may be used to get the match count.

The change of the function prototype would be as below:

int
rte_kvargs_process(const struct rte_kvargs *kvlist,

(quoted diff) +1 -0
 		const char *key_match,
+		int *match_count,
 		arg_handler_t handler,
 		void *opaque_arg)
Quoted 3 lines
Quoted 1 line

Maybe "unsigned int" instead of "int".

Yes we will discuss such detail during review of the code patch.

Quoted 2 lines

Apart from this,

Thanks
I will consider the deprecation notice as approved when there will be 3 acks.

Acked-by
#4 lore raw
In reply to Olivier Matz
Quoted 16 lines · Olivier Matz
Quoted 15 lines · Thomas Monjalon

After processing a kvlist in rte_kvargs_process(), it may be needed to loop again over kvlist in order to know whether the key is matched or not.
In order to simplify implementation of kvargs checks, a new pointer parameter may be used to get the match count.

The change of the function prototype would be as below:

int
rte_kvargs_process(const struct rte_kvargs *kvlist,

(quoted diff) +1 -0
 		const char *key_match,
+		int *match_count,
 		arg_handler_t handler,
 		void *opaque_arg)
Quoted 7 lines
Quoted 1 line

Maybe "unsigned int" instead of "int".

Apart from this,

Acked-by on v1 1/1
#7 lore raw
In reply to Thomas Monjalon
Quoted 26 lines · Thomas Monjalon

In some usages, kvlist is processed one time in rte_kvargs_process(), and it is processed a second time if need to check whether it was matched. In order to simplify implementation of kvargs checks, a new callback may be used for "no match" cases.

The change of the function prototype would be as below:

int
rte_kvargs_process(const struct rte_kvargs *kvlist,
const char *key_match,

(quoted diff) +2 -1
-		arg_handler_t handler,
+		arg_handler_t match_handler,
+		arg_handler_t no_match_handler,
  		void *opaque_arg)
---
  doc/guides/rel_notes/deprecation.rst | 4 ++++
  1 file changed, 4 insertions(+)
doc/guides/rel_notes/deprecation.rst +0 -0
index 34b28234c..7af65cd4b 100644

doc/guides/rel_notes/deprecation.rst API and ABI deprecation notices are to be posted here. · line 20

Quoted 10 lines
doc/guides/rel_notes/deprecation.rst +4 -0
@@ -11,6 +11,10 @@ API and ABI deprecation notices are to be posted here.
  Deprecation Notices
  -------------------
 
+* kvargs: The function ``rte_kvargs_process`` will get a new parameter
+  for a function pointer called in case of no match of the key.
+  It will ease implementation of default values or check for mandatory keys.
+
  * eal: both declaring and identifying devices will be streamlined in v18.11.
    New functions will appear to query a specific port from buses, classes of
    device and device drivers. Device declaration will be made coherent with the
Acked-by
#5 lore raw
In reply to Ferruh Yigit

-----Original Message-----

Quoted 29 lines

Date: Thu, 22 Nov 2018 17:08:56 +0000
From: Ferruh Yigit <[email protected]>
To: Olivier Matz <[email protected]>, Thomas Monjalon
<[email protected]>
CC: [email protected]
Subject: Re: [dpdk-dev] [PATCH v2] doc: announce kvargs API change
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101
Thunderbird/60.3.1

Quoted 18 lines · Olivier Matz
Quoted 16 lines · Thomas Monjalon

After processing a kvlist in rte_kvargs_process(), it may be needed to loop again over kvlist in order to know whether the key is matched or not.
In order to simplify implementation of kvargs checks, a new pointer parameter may be used to get the match count.

The change of the function prototype would be as below:

int
rte_kvargs_process(const struct rte_kvargs *kvlist,
const char *key_match,
+ int *match_count,
arg_handler_t handler,
void *opaque_arg)

Quoted 7 lines
Quoted 5 lines

Maybe "unsigned int" instead of "int".

Apart from this,

author Applied
#6 lore raw

23/11/2018 17:31, Jerin Jacob:

Quoted 22 lines

From: Ferruh Yigit <[email protected]>

Quoted 21 lines · Olivier Matz
Quoted 20 lines · Thomas Monjalon
Quoted 8 lines

After processing a kvlist in rte_kvargs_process(), it may be needed to loop again over kvlist in order to know whether the key is matched or not.
In order to simplify implementation of kvargs checks, a new pointer parameter may be used to get the match count.

The change of the function prototype would be as below:

Quoted 8 lines

int
rte_kvargs_process(const struct rte_kvargs *kvlist,
const char *key_match,
+ int *match_count,
arg_handler_t handler,
void *opaque_arg)

Maybe "unsigned int" instead of "int".

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

Apart from this,

Applied