ethdev: support new VF representor syntax
authorXueming Li <xuemingl@nvidia.com>
Thu, 11 Mar 2021 13:13:26 +0000 (13:13 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 16 Mar 2021 19:15:29 +0000 (20:15 +0100)
Current VF representor syntax:
 representor=2          - single representor
 representor=[0-3]      - single range

To prepare for more representor types, this patch adds compatible VF
representor devargs syntax:

vf#:
 representor=vf2          - single representor
 representor=vf[1,3,5]    - single list
 representor=vf[0-3]      - single range
 representor=vf[0,1,4-7]  - list with singles and range

For backwards compatibility, representor "#" is interpreted as "vf#".

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
doc/guides/prog_guide/poll_mode_drv.rst
doc/guides/rel_notes/release_21_05.rst
lib/librte_ethdev/ethdev_private.c

index 239ec82..0117c2a 100644 (file)
@@ -374,9 +374,10 @@ parameters to those ports.
   this argument allows user to specify which switch ports to enable port
   representors for.::
 
-   -a DBDF,representor=0
-   -a DBDF,representor=[0,4,6,9]
-   -a DBDF,representor=[0-31]
+   -a DBDF,representor=vf0
+   -a DBDF,representor=vf[0,4,6,9]
+   -a DBDF,representor=vf[0-31]
+   -a DBDF,representor=vf[0,2-4,7,9-11]
 
 Note: PMDs are not required to support the standard device arguments and users
 should consult the relevant PMD documentation to see support devargs.
index 1d9ac0a..ff96ad8 100644 (file)
@@ -58,6 +58,9 @@ New Features
 * **Enhanced ethdev representor syntax.**
 
   * Introduced representor type of VF.
+  * Supported representor syntax::
+
+      representor=#            [0,2-4]      /* Legacy VF compatible.         */
 
 * **Updated Broadcom bnxt driver.**
 
index d5ef05e..4bb3879 100644 (file)
@@ -117,7 +117,8 @@ rte_eth_devargs_process_list(char *str, uint16_t *list, uint16_t *len_list,
  * Parse representor ports from a single value or lists.
  *
  * Representor format:
- *   #: range or single number of VF representor
+ *   #: range or single number of VF representor - legacy
+ *   vf#: VF port representor/s
  *
  * Examples of #:
  *  2               - single
@@ -130,6 +131,8 @@ rte_eth_devargs_parse_representor_ports(char *str, void *data)
        struct rte_eth_devargs *eth_da = data;
 
        eth_da->type = RTE_ETH_REPRESENTOR_VF;
+       if (str[0] == 'v' && str[1] == 'f')
+               str += 2;
        str = rte_eth_devargs_process_list(str, eth_da->representor_ports,
                &eth_da->nb_representor_ports,
                RTE_DIM(eth_da->representor_ports));