diff mbox series

[iproute2-next,1/5] devlink: Fix setting parent for 'rate add'

Message ID 20221125123421.36297-2-michal.wilczynski@intel.com (mailing list archive)
State Superseded
Delegated to: Stephen Hemminger
Headers show
Series Implement new netlink attributes for devlink-rate in iproute2 | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Wilczynski, Michal Nov. 25, 2022, 12:34 p.m. UTC
Setting a parent during creation of the node doesn't work, despite
documentation [1] clearly saying that it should.

[1] man/man8/devlink-rate.8

Example:
$ devlink port function rate add pci/0000:4b:00.0/node_custom parent node_0
  Unknown option "parent"

Fix this by passing DL_OPT_PORT_FN_RATE_PARENT as an argument to
dl_argv_parse() when it gets called from cmd_port_fn_rate_add().

Fixes: 6c70aca76ef2 ("devlink: Add port func rate support")
Signed-off-by: Michal Wilczynski <michal.wilczynski@intel.com>
Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>
---
 devlink/devlink.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

David Ahern Nov. 28, 2022, 2:38 a.m. UTC | #1
On 11/25/22 5:34 AM, Michal Wilczynski wrote:
> Setting a parent during creation of the node doesn't work, despite
> documentation [1] clearly saying that it should.
> 
> [1] man/man8/devlink-rate.8
> 
> Example:
> $ devlink port function rate add pci/0000:4b:00.0/node_custom parent node_0
>   Unknown option "parent"
> 
> Fix this by passing DL_OPT_PORT_FN_RATE_PARENT as an argument to
> dl_argv_parse() when it gets called from cmd_port_fn_rate_add().
> 
> Fixes: 6c70aca76ef2 ("devlink: Add port func rate support")

so this is a bug fix that needs to go in main branch first?


> Signed-off-by: Michal Wilczynski <michal.wilczynski@intel.com>
> Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>
> ---
>  devlink/devlink.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/devlink/devlink.c b/devlink/devlink.c
> index 8aefa101b2f8..5cff018a2471 100644
> --- a/devlink/devlink.c
> +++ b/devlink/devlink.c
> @@ -5030,7 +5030,8 @@ static int cmd_port_fn_rate_add(struct dl *dl)
>  	int err;
>  
>  	err = dl_argv_parse(dl, DL_OPT_PORT_FN_RATE_NODE_NAME,
> -			    DL_OPT_PORT_FN_RATE_TX_SHARE | DL_OPT_PORT_FN_RATE_TX_MAX);
> +			    DL_OPT_PORT_FN_RATE_TX_SHARE | DL_OPT_PORT_FN_RATE_TX_MAX |
> +			    DL_OPT_PORT_FN_RATE_PARENT);
>  	if (err)
>  		return err;
>
Wilczynski, Michal Nov. 28, 2022, 9:51 a.m. UTC | #2
On 11/28/2022 3:38 AM, David Ahern wrote:
> On 11/25/22 5:34 AM, Michal Wilczynski wrote:
>> Setting a parent during creation of the node doesn't work, despite
>> documentation [1] clearly saying that it should.
>>
>> [1] man/man8/devlink-rate.8
>>
>> Example:
>> $ devlink port function rate add pci/0000:4b:00.0/node_custom parent node_0
>>   Unknown option "parent"
>>
>> Fix this by passing DL_OPT_PORT_FN_RATE_PARENT as an argument to
>> dl_argv_parse() when it gets called from cmd_port_fn_rate_add().
>>
>> Fixes: 6c70aca76ef2 ("devlink: Add port func rate support")
> so this is a bug fix that needs to go in main branch first?

I'm fine with this going to main branch first.
Would you like me to re-send this patch separately targeting iproute2 instead
of iproute2-next ?

Thanks,
Michał

>
>
>> Signed-off-by: Michal Wilczynski <michal.wilczynski@intel.com>
>> Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>
>> ---
>>  devlink/devlink.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/devlink/devlink.c b/devlink/devlink.c
>> index 8aefa101b2f8..5cff018a2471 100644
>> --- a/devlink/devlink.c
>> +++ b/devlink/devlink.c
>> @@ -5030,7 +5030,8 @@ static int cmd_port_fn_rate_add(struct dl *dl)
>>  	int err;
>>  
>>  	err = dl_argv_parse(dl, DL_OPT_PORT_FN_RATE_NODE_NAME,
>> -			    DL_OPT_PORT_FN_RATE_TX_SHARE | DL_OPT_PORT_FN_RATE_TX_MAX);
>> +			    DL_OPT_PORT_FN_RATE_TX_SHARE | DL_OPT_PORT_FN_RATE_TX_MAX |
>> +			    DL_OPT_PORT_FN_RATE_PARENT);
>>  	if (err)
>>  		return err;
>>
diff mbox series

Patch

diff --git a/devlink/devlink.c b/devlink/devlink.c
index 8aefa101b2f8..5cff018a2471 100644
--- a/devlink/devlink.c
+++ b/devlink/devlink.c
@@ -5030,7 +5030,8 @@  static int cmd_port_fn_rate_add(struct dl *dl)
 	int err;
 
 	err = dl_argv_parse(dl, DL_OPT_PORT_FN_RATE_NODE_NAME,
-			    DL_OPT_PORT_FN_RATE_TX_SHARE | DL_OPT_PORT_FN_RATE_TX_MAX);
+			    DL_OPT_PORT_FN_RATE_TX_SHARE | DL_OPT_PORT_FN_RATE_TX_MAX |
+			    DL_OPT_PORT_FN_RATE_PARENT);
 	if (err)
 		return err;