[v4,5/9] ethdev: support PF index in representor
Checks
Commit Message
With Kernel bonding, multiple underlying PFs are bonded, VFs come
from different PF, need to identify representor of VFs unambiguously by
adding PF index.
This patch introduces optional 'pf' section to representor devargs
syntax, examples:
representor=pf0vf0 - single VF representor
representor=pf[0-1]sf[0-1023] - SF representors from 2 PFs
Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Acked-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com>
---
doc/guides/prog_guide/poll_mode_drv.rst | 2 ++
lib/librte_ethdev/ethdev_private.c | 13 +++++++++++--
2 files changed, 13 insertions(+), 2 deletions(-)
@@ -382,6 +382,8 @@ parameters to those ports.
-a DBDF,representor=sf[1,3,5]
-a DBDF,representor=sf[0-1023]
-a DBDF,representor=sf[0,2-4,7,9-11]
+ -a DBDF,representor=pf1vf0
+ -a DBDF,representor=pf[0-1]sf[0-127]
Note: PMDs are not required to support the standard device arguments and users
should consult the relevant PMD documentation to see support devargs.
@@ -108,14 +108,22 @@ 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)
{
struct rte_eth_devargs *eth_da = data;
+ if (str[0] == 'p' && str[1] == 'f') {
+ eth_da->type = RTE_ETH_REPRESENTOR_PF;
+ str += 2;
+ str = rte_eth_devargs_process_list(str, eth_da->ports,
+ ð_da->nb_ports, RTE_MAX_ETHPORTS);
+ if (str == NULL)
+ goto err;
+ }
if (str[0] == 'v' && str[1] == 'f') {
eth_da->type = RTE_ETH_REPRESENTOR_VF;
str += 2;
@@ -127,6 +135,7 @@ rte_eth_devargs_parse_representor_ports(char *str, void *data)
}
str = rte_eth_devargs_process_list(str, eth_da->representor_ports,
ð_da->nb_representor_ports, RTE_MAX_ETHPORTS);
+err:
if (str == NULL)
RTE_LOG(ERR, EAL, "wrong representor format: %s\n", str);
return str == NULL ? -1 : 0;