]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
devlink: Fix setting parent for 'rate add'
authorMichal Wilczynski <michal.wilczynski@intel.com>
Thu, 1 Dec 2022 10:18:10 +0000 (11:18 +0100)
committerStephen Hemminger <stephen@networkplumber.org>
Sun, 4 Dec 2022 17:56:35 +0000 (09:56 -0800)
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>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
devlink/devlink.c

index 150b4e63ead1dbe17586a36a4360f99f34266c7a..11daf0c36e5d847e1769674e098eb02ff9495e56 100644 (file)
@@ -5049,7 +5049,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;