diff mbox series

[iproute2] vdpa: consume device_features parameter

Message ID 20230911180815.820-1-shannon.nelson@amd.com (mailing list archive)
State Accepted
Commit 92eac7e4bf14d97c07632596554fb686338cf323
Delegated to: Stephen Hemminger
Headers show
Series [iproute2] vdpa: consume device_features parameter | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Nelson, Shannon Sept. 11, 2023, 6:08 p.m. UTC
From: Allen Hubbe <allen.hubbe@amd.com>

Consume the parameter to device_features when parsing command line
options.  Otherwise the parameter may be used again as an option name.

 # vdpa dev add ... device_features 0xdeadbeef mac 00:11:22:33:44:55
 Unknown option "0xdeadbeef"

Fixes: a4442ce58ebb ("vdpa: allow provisioning device features")
Signed-off-by: Allen Hubbe <allen.hubbe@amd.com>
Reviewed-by: Shannon Nelson <shannon.nelson@amd.com>
Reviewed-by: Si-Wei Liu <si-wei.liu@oracle.com>
---
 vdpa/vdpa.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Jason Wang Sept. 12, 2023, 3:18 a.m. UTC | #1
On Tue, Sep 12, 2023 at 2:08 AM Shannon Nelson <shannon.nelson@amd.com> wrote:
>
> From: Allen Hubbe <allen.hubbe@amd.com>
>
> Consume the parameter to device_features when parsing command line
> options.  Otherwise the parameter may be used again as an option name.
>
>  # vdpa dev add ... device_features 0xdeadbeef mac 00:11:22:33:44:55
>  Unknown option "0xdeadbeef"
>
> Fixes: a4442ce58ebb ("vdpa: allow provisioning device features")
> Signed-off-by: Allen Hubbe <allen.hubbe@amd.com>
> Reviewed-by: Shannon Nelson <shannon.nelson@amd.com>
> Reviewed-by: Si-Wei Liu <si-wei.liu@oracle.com>

Acked-by: Jason Wang <jasowang@redhat.com>

Thanks

> ---
>  vdpa/vdpa.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/vdpa/vdpa.c b/vdpa/vdpa.c
> index 8bbe452c..6e4a9c11 100644
> --- a/vdpa/vdpa.c
> +++ b/vdpa/vdpa.c
> @@ -353,6 +353,8 @@ static int vdpa_argv_parse(struct vdpa *vdpa, int argc, char **argv,
>                                                 &opts->device_features);
>                         if (err)
>                                 return err;
> +
> +                       NEXT_ARG_FWD();
>                         o_found |= VDPA_OPT_VDEV_FEATURES;
>                 } else {
>                         fprintf(stderr, "Unknown option \"%s\"\n", *argv);
> --
> 2.17.1
>
patchwork-bot+netdevbpf@kernel.org Sept. 12, 2023, 4 p.m. UTC | #2
Hello:

This patch was applied to iproute2/iproute2-next.git (main)
by David Ahern <dsahern@kernel.org>:

On Mon, 11 Sep 2023 11:08:15 -0700 you wrote:
> From: Allen Hubbe <allen.hubbe@amd.com>
> 
> Consume the parameter to device_features when parsing command line
> options.  Otherwise the parameter may be used again as an option name.
> 
>  # vdpa dev add ... device_features 0xdeadbeef mac 00:11:22:33:44:55
>  Unknown option "0xdeadbeef"
> 
> [...]

Here is the summary with links:
  - [iproute2] vdpa: consume device_features parameter
    https://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git/commit/?id=92eac7e4bf14

You are awesome, thank you!
diff mbox series

Patch

diff --git a/vdpa/vdpa.c b/vdpa/vdpa.c
index 8bbe452c..6e4a9c11 100644
--- a/vdpa/vdpa.c
+++ b/vdpa/vdpa.c
@@ -353,6 +353,8 @@  static int vdpa_argv_parse(struct vdpa *vdpa, int argc, char **argv,
 						&opts->device_features);
 			if (err)
 				return err;
+
+			NEXT_ARG_FWD();
 			o_found |= VDPA_OPT_VDEV_FEATURES;
 		} else {
 			fprintf(stderr, "Unknown option \"%s\"\n", *argv);