@@ -57,6 +57,7 @@
#define RTE_MAX_QUEUES_PER_PORT 1024
#define RTE_ETHDEV_QUEUE_STAT_CNTRS 16 /* max 256 */
#define RTE_ETHDEV_RXTX_CALLBACKS 1
+#define RTE_MAX_MULTI_HOST_CTRLS 4
/* cryptodev defines */
#define RTE_CRYPTO_MAX_DEVS 64
@@ -1222,6 +1222,10 @@ rte_eth_switch_domain_free(uint16_t domain_id);
* One type of representor each structure.
*/
struct rte_eth_devargs {
+ uint16_t mh_controllers[RTE_MAX_MULTI_HOST_CTRLS];
+ /** controller/s number in case of multi-host */
+ uint16_t nb_mh_controllers;
+ /** number of controllers in multi-host controllers field */
uint16_t ports[RTE_MAX_ETHPORTS];
/** port/s number to enable on a multi-port single function */
uint16_t nb_ports;
@@ -118,8 +118,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
- * [pf#]vf#: VF port representor/s
- * [pf#]sf#: SF port representor/s
+ * [[c#]pf#]vf#: VF port representor/s
+ * [[c#]pf#]sf#: SF port representor/s
*
* Examples of #:
* 2 - single
@@ -131,6 +131,14 @@ rte_eth_devargs_parse_representor_ports(char *str, void *data)
{
struct rte_eth_devargs *eth_da = data;
+ if (str[0] == 'c') {
+ str += 1;
+ str = rte_eth_devargs_process_list(str, eth_da->mh_controllers,
+ ð_da->nb_mh_controllers,
+ RTE_DIM(eth_da->mh_controllers));
+ if (str == NULL)
+ goto err;
+ }
if (str[0] == 'p' && str[1] == 'f') {
eth_da->type = RTE_ETH_REPRESENTOR_PF;
str += 2;
@@ -146,8 +154,9 @@ rte_eth_devargs_parse_representor_ports(char *str, void *data)
eth_da->type = RTE_ETH_REPRESENTOR_SF;
str += 2;
} else {
- /* Don't mix legacy syntax with 'pf' section. */
- if (eth_da->type == RTE_ETH_REPRESENTOR_PF) {
+ /* Don't mix legacy syntax with 'pf' and 'c' section. */
+ if (eth_da->type == RTE_ETH_REPRESENTOR_PF ||
+ eth_da->nb_mh_controllers > 0) {
str = NULL;
goto err;
}
@@ -156,6 +165,14 @@ 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_DIM(eth_da->representor_ports));
+ if (str == NULL)
+ goto err;
+ /* "pf" must sit in middle of "c" and "vf"/"sf". */
+ if (eth_da->nb_representor_ports > 0 && eth_da->nb_mh_controllers > 0 &&
+ eth_da->nb_ports == 0) {
+ RTE_LOG(ERR, EAL, "'pf' section missing: %s\n", str);
+ return -1;
+ }
err:
if (str == NULL)
RTE_LOG(ERR, EAL, "wrong representor format: %s\n", str);