netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] tools: pynl: make flags argument optional for do()
@ 2023-12-02 21:10 Jakub Kicinski
  2023-12-04 16:45 ` Donald Hunter
  2023-12-06  4:10 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Jakub Kicinski @ 2023-12-02 21:10 UTC (permalink / raw)
  To: dev; +Cc: netdev, davem, edumazet, pabeni, Jakub Kicinski, donald.hunter

Commit 1768d8a767f8 ("tools/net/ynl: Add support for create flags")
added support for setting legacy netlink CRUD flags on netlink
messages (NLM_F_REPLACE, _EXCL, _CREATE etc.).

Most of genetlink won't need these, don't force callers to pass
in an empty argument to each do() call.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
CC: donald.hunter@gmail.com
---
 tools/net/ynl/lib/ynl.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/net/ynl/lib/ynl.py b/tools/net/ynl/lib/ynl.py
index 92995bca14e1..c56dad9593c6 100644
--- a/tools/net/ynl/lib/ynl.py
+++ b/tools/net/ynl/lib/ynl.py
@@ -705,7 +705,7 @@ genl_family_name_to_id = None
 
       return op['do']['request']['attributes'].copy()
 
-    def _op(self, method, vals, flags, dump=False):
+    def _op(self, method, vals, flags=None, dump=False):
         op = self.ops[method]
 
         nl_flags = Netlink.NLM_F_REQUEST | Netlink.NLM_F_ACK
@@ -769,7 +769,7 @@ genl_family_name_to_id = None
             return rsp[0]
         return rsp
 
-    def do(self, method, vals, flags):
+    def do(self, method, vals, flags=None):
         return self._op(method, vals, flags)
 
     def dump(self, method, vals):
-- 
2.43.0


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

* Re: [PATCH net-next] tools: pynl: make flags argument optional for do()
  2023-12-02 21:10 [PATCH net-next] tools: pynl: make flags argument optional for do() Jakub Kicinski
@ 2023-12-04 16:45 ` Donald Hunter
  2023-12-06  4:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Donald Hunter @ 2023-12-04 16:45 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: netdev, davem, edumazet, pabeni

Jakub Kicinski <kuba@kernel.org> writes:

> Commit 1768d8a767f8 ("tools/net/ynl: Add support for create flags")
> added support for setting legacy netlink CRUD flags on netlink
> messages (NLM_F_REPLACE, _EXCL, _CREATE etc.).
>
> Most of genetlink won't need these, don't force callers to pass
> in an empty argument to each do() call.
>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---
> CC: donald.hunter@gmail.com

Reviewed-by: Donald Hunter <donald.hunter@gmail.com>

> ---
>  tools/net/ynl/lib/ynl.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tools/net/ynl/lib/ynl.py b/tools/net/ynl/lib/ynl.py
> index 92995bca14e1..c56dad9593c6 100644
> --- a/tools/net/ynl/lib/ynl.py
> +++ b/tools/net/ynl/lib/ynl.py
> @@ -705,7 +705,7 @@ genl_family_name_to_id = None
>  
>        return op['do']['request']['attributes'].copy()
>  
> -    def _op(self, method, vals, flags, dump=False):
> +    def _op(self, method, vals, flags=None, dump=False):
>          op = self.ops[method]
>  
>          nl_flags = Netlink.NLM_F_REQUEST | Netlink.NLM_F_ACK
> @@ -769,7 +769,7 @@ genl_family_name_to_id = None
>              return rsp[0]
>          return rsp
>  
> -    def do(self, method, vals, flags):
> +    def do(self, method, vals, flags=None):
>          return self._op(method, vals, flags)
>  
>      def dump(self, method, vals):

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

* Re: [PATCH net-next] tools: pynl: make flags argument optional for do()
  2023-12-02 21:10 [PATCH net-next] tools: pynl: make flags argument optional for do() Jakub Kicinski
  2023-12-04 16:45 ` Donald Hunter
@ 2023-12-06  4:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-12-06  4:10 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: dev, netdev, davem, edumazet, pabeni, donald.hunter

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Sat,  2 Dec 2023 13:10:05 -0800 you wrote:
> Commit 1768d8a767f8 ("tools/net/ynl: Add support for create flags")
> added support for setting legacy netlink CRUD flags on netlink
> messages (NLM_F_REPLACE, _EXCL, _CREATE etc.).
> 
> Most of genetlink won't need these, don't force callers to pass
> in an empty argument to each do() call.
> 
> [...]

Here is the summary with links:
  - [net-next] tools: pynl: make flags argument optional for do()
    https://git.kernel.org/netdev/net-next/c/e136735f0c26

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2023-12-06  4:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-02 21:10 [PATCH net-next] tools: pynl: make flags argument optional for do() Jakub Kicinski
2023-12-04 16:45 ` Donald Hunter
2023-12-06  4:10 ` patchwork-bot+netdevbpf

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