[v3,4/9] ethdev: support PF index in representor
Checks
Commit Message
To support representor in bonding, this patch introduces 'pf' section
to representor devargs syntax:
[pf#]vf#: VF port representor/s, example: vf3, pf0vf3
[pf#]sf#: SF port representor/s, example: sf2, pf1sf2
pf# is optional for SF and VF representor, indicates owner PF device of
SF or VF.
Signed-off-by: Xueming Li <xuemingl@nvidia.com>
---
doc/guides/prog_guide/poll_mode_drv.rst | 1 +
lib/librte_ethdev/ethdev_private.c | 15 +++++++++++++--
lib/librte_ethdev/rte_ethdev_driver.h | 1 +
3 files changed, 15 insertions(+), 2 deletions(-)
@@ -378,6 +378,7 @@ parameters to those ports.
-a DBDF,representor=vf[0,4,6,9]
-a DBDF,representor=vf[0-31]
-a DBDF,representor=sf[0-1023]
+ -a DBDF,representor=pf[0-1]sf[0-1023]
Note: PMDs are not required to support the standard device arguments and users
should consult the relevant PMD documentation to see support devargs.
@@ -95,8 +95,8 @@ rte_eth_devargs_process_list(char *str, uint16_t *list, uint16_t *len_list,
/*
* representor format:
* #: range or single number of VF representor - legacy
- * vf#: VF port representor/s
- * sf#: SF port representor/s
+ * [pf#]vf#: VF port representor/s
+ * [pf#]sf#: SF port representor/s
*/
int
rte_eth_devargs_parse_representor_ports(char *str, void *data)
@@ -105,6 +105,16 @@ rte_eth_devargs_parse_representor_ports(char *str, void *data)
int ret;
eth_da->type = RTE_ETH_REPRESENTOR_NONE;
+ /* Parse pf# */
+ if (str[0] == 'p' && str[1] == 'f') {
+ eth_da->type = RTE_ETH_REPRESENTOR_PF;
+ str += 2;
+ ret = rte_eth_devargs_process_list(str, eth_da->ports,
+ ð_da->nb_ports, RTE_MAX_ETHPORTS);
+ if (ret < 0)
+ goto err;
+ str += ret;
+ }
/* Parse vf# and sf#, number # alone implies VF */
if (str[0] == 'v' && str[1] == 'f') {
eth_da->type = RTE_ETH_REPRESENTOR_VF;
@@ -117,6 +127,7 @@ rte_eth_devargs_parse_representor_ports(char *str, void *data)
}
ret = rte_eth_devargs_process_list(str, eth_da->representor_ports,
ð_da->nb_representor_ports, RTE_MAX_ETHPORTS);
+err:
if (ret < 0)
RTE_LOG(ERR, EAL, "wrong representor format: %s\n", str);
return ret < 0 ? ret : 0;
@@ -1198,6 +1198,7 @@ enum rte_eth_representor_type {
RTE_ETH_REPRESENTOR_NONE, /* not a representor */
RTE_ETH_REPRESENTOR_VF, /* representor of VF */
RTE_ETH_REPRESENTOR_SF, /* representor of SF */
+ RTE_ETH_REPRESENTOR_PF, /* representor of host PF */
};
/** Generic Ethernet device arguments */