DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] doc: announce kvargs API change
@ 2018-11-21 15:45 Thomas Monjalon
  2018-11-22 10:32 ` [dpdk-dev] [PATCH v2] " Thomas Monjalon
  2018-11-23 13:17 ` [dpdk-dev] [PATCH] " Maxime Coquelin
  0 siblings, 2 replies; 8+ messages in thread
From: Thomas Monjalon @ 2018-11-21 15:45 UTC (permalink / raw)
  To: dev; +Cc: olivier.matz

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)

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 doc/guides/rel_notes/deprecation.rst | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 34b28234c..7af65cd4b 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -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
-- 
2.19.0

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

* [dpdk-dev] [PATCH v2] doc: announce kvargs API change
  2018-11-21 15:45 [dpdk-dev] [PATCH] doc: announce kvargs API change Thomas Monjalon
@ 2018-11-22 10:32 ` Thomas Monjalon
  2018-11-22 13:22   ` Olivier Matz
  2018-11-23 13:17 ` [dpdk-dev] [PATCH] " Maxime Coquelin
  1 sibling, 1 reply; 8+ messages in thread
From: Thomas Monjalon @ 2018-11-22 10:32 UTC (permalink / raw)
  To: olivier.matz; +Cc: dev

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)

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
v1: callback for no-match
v2: integer for match count (Olivier suggestion)
---
 doc/guides/rel_notes/deprecation.rst | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 34b28234c..dccf7bee6 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -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
-- 
2.19.0

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

* Re: [dpdk-dev] [PATCH v2] doc: announce kvargs API change
  2018-11-22 10:32 ` [dpdk-dev] [PATCH v2] " Thomas Monjalon
@ 2018-11-22 13:22   ` Olivier Matz
  2018-11-22 14:02     ` Thomas Monjalon
  2018-11-22 17:08     ` Ferruh Yigit
  0 siblings, 2 replies; 8+ messages in thread
From: Olivier Matz @ 2018-11-22 13:22 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev

On Thu, Nov 22, 2018 at 11:32:23AM +0100, Thomas Monjalon wrote:
> 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)
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>

Maybe "unsigned int" instead of "int".

Apart from this,
Acked-by: Olivier Matz <olivier.matz@6wind.com>

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

* Re: [dpdk-dev] [PATCH v2] doc: announce kvargs API change
  2018-11-22 13:22   ` Olivier Matz
@ 2018-11-22 14:02     ` Thomas Monjalon
  2018-11-22 17:08     ` Ferruh Yigit
  1 sibling, 0 replies; 8+ messages in thread
From: Thomas Monjalon @ 2018-11-22 14:02 UTC (permalink / raw)
  To: Olivier Matz
  Cc: dev, anatoly.burakov, ferruh.yigit, arybchenko, jerin.jacob,
	hemant.agrawal, gaetan.rivet

22/11/2018 14:22, Olivier Matz:
> On Thu, Nov 22, 2018 at 11:32:23AM +0100, Thomas Monjalon wrote:
> > 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)
> > 
> > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> 
> Maybe "unsigned int" instead of "int".

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

> Apart from this,
> Acked-by: Olivier Matz <olivier.matz@6wind.com>

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

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

* Re: [dpdk-dev] [PATCH v2] doc: announce kvargs API change
  2018-11-22 13:22   ` Olivier Matz
  2018-11-22 14:02     ` Thomas Monjalon
@ 2018-11-22 17:08     ` Ferruh Yigit
  2018-11-23 16:31       ` Jerin Jacob
  1 sibling, 1 reply; 8+ messages in thread
From: Ferruh Yigit @ 2018-11-22 17:08 UTC (permalink / raw)
  To: Olivier Matz, Thomas Monjalon; +Cc: dev

On 11/22/2018 1:22 PM, Olivier Matz wrote:
> On Thu, Nov 22, 2018 at 11:32:23AM +0100, Thomas Monjalon wrote:
>> 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)
>>
>> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> 
> Maybe "unsigned int" instead of "int".
> 
> Apart from this,
> Acked-by: Olivier Matz <olivier.matz@6wind.com>
> 

Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>

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

* Re: [dpdk-dev] [PATCH] doc: announce kvargs API change
  2018-11-21 15:45 [dpdk-dev] [PATCH] doc: announce kvargs API change Thomas Monjalon
  2018-11-22 10:32 ` [dpdk-dev] [PATCH v2] " Thomas Monjalon
@ 2018-11-23 13:17 ` Maxime Coquelin
  1 sibling, 0 replies; 8+ messages in thread
From: Maxime Coquelin @ 2018-11-23 13:17 UTC (permalink / raw)
  To: Thomas Monjalon, dev; +Cc: olivier.matz



On 11/21/18 4:45 PM, Thomas Monjalon wrote:
> 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)
> 
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
>   doc/guides/rel_notes/deprecation.rst | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
> index 34b28234c..7af65cd4b 100644
> --- a/doc/guides/rel_notes/deprecation.rst
> +++ b/doc/guides/rel_notes/deprecation.rst
> @@ -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: Maxime Coquelin <maxime.coquelin@redhat.com>

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

* Re: [dpdk-dev] [PATCH v2] doc: announce kvargs API change
  2018-11-22 17:08     ` Ferruh Yigit
@ 2018-11-23 16:31       ` Jerin Jacob
  2018-11-24 17:12         ` Thomas Monjalon
  0 siblings, 1 reply; 8+ messages in thread
From: Jerin Jacob @ 2018-11-23 16:31 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: Olivier Matz, Thomas Monjalon, dev

-----Original Message-----
> Date: Thu, 22 Nov 2018 17:08:56 +0000
> From: Ferruh Yigit <ferruh.yigit@intel.com>
> To: Olivier Matz <olivier.matz@6wind.com>, Thomas Monjalon
>  <thomas@monjalon.net>
> CC: dev@dpdk.org
> 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
> 
> 
> On 11/22/2018 1:22 PM, Olivier Matz wrote:
> > On Thu, Nov 22, 2018 at 11:32:23AM +0100, Thomas Monjalon wrote:
> >> 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)
> >>
> >> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> >
> > Maybe "unsigned int" instead of "int".
> >
> > Apart from this,
> > Acked-by: Olivier Matz <olivier.matz@6wind.com>
> >
> 
> Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>

Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

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

* Re: [dpdk-dev] [PATCH v2] doc: announce kvargs API change
  2018-11-23 16:31       ` Jerin Jacob
@ 2018-11-24 17:12         ` Thomas Monjalon
  0 siblings, 0 replies; 8+ messages in thread
From: Thomas Monjalon @ 2018-11-24 17:12 UTC (permalink / raw)
  To: dev; +Cc: Jerin Jacob, Ferruh Yigit, Olivier Matz

23/11/2018 17:31, Jerin Jacob:
> From: Ferruh Yigit <ferruh.yigit@intel.com>
> > On 11/22/2018 1:22 PM, Olivier Matz wrote:
> > > On Thu, Nov 22, 2018 at 11:32:23AM +0100, Thomas Monjalon wrote:
> > >> 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)
> > >>
> > >> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> > >
> > > Maybe "unsigned int" instead of "int".
> > >
> > > Apart from this,
> > > Acked-by: Olivier Matz <olivier.matz@6wind.com>
> > >
> > 
> > Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
> 
> Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

Applied

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

end of thread, other threads:[~2018-11-24 17:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-21 15:45 [dpdk-dev] [PATCH] doc: announce kvargs API change Thomas Monjalon
2018-11-22 10:32 ` [dpdk-dev] [PATCH v2] " Thomas Monjalon
2018-11-22 13:22   ` Olivier Matz
2018-11-22 14:02     ` Thomas Monjalon
2018-11-22 17:08     ` Ferruh Yigit
2018-11-23 16:31       ` Jerin Jacob
2018-11-24 17:12         ` Thomas Monjalon
2018-11-23 13:17 ` [dpdk-dev] [PATCH] " Maxime Coquelin

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).