Re: [iproute2-next 2/2] devlink: remove dl_argv_parse_put

Jiri Pirko
2022-08-19T08:27:08Z

Thu, Aug 18, 2022 at 11:15:21PM CEST, jacob.e.keller@intel.com wrote:
>The dl_argv_parse_put function is used to extract arguments from the
>command line and convert them to the appropriate netlink attributes. This
>function is a combination of calling dl_argv_parse and dl_put_opts.
>
>A future change is going to refactor dl_argv_parse to check the kernel's
>netlink policy for the command. This requires issuing another netlink
>message which requires calling dl_argv_parse before
>mnlu_gen_socket_cmd_prepare. Otherwise, the get policy command issued in
>dl_argv_parse would overwrite the prepared buffer.
>
>This conflicts with dl_argv_parse_put which requires being called after
>mnlu_gen_socket_cmd_prepare.
>
>Remove dl_argv_parse_put and replace it with appropriate calls to
>dl_argv_parse and dl_put_opts. This allows us to ensure dl_argv_parse is
>called before mnlu_gen_socket_cmd_prepare while dl_put_opts is called
>afterwards.
>
>Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>

Reviewed-by: Jiri Pirko <jiri@nvidia.com>