From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (xvm-189-124.dc0.ghst.net [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E0796A09FF; Wed, 6 Jan 2021 17:19:00 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 49A89140E37; Wed, 6 Jan 2021 17:18:15 +0100 (CET) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by mails.dpdk.org (Postfix) with ESMTP id 64DCF140E06 for ; Wed, 6 Jan 2021 17:18:05 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from xuemingl@nvidia.com) with SMTP; 6 Jan 2021 18:18:00 +0200 Received: from nvidia.com (pegasus05.mtr.labs.mlnx [10.210.16.100]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 106GI0Mj017451; Wed, 6 Jan 2021 18:18:00 +0200 From: Xueming Li To: Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko , Olivier Matz , Viacheslav Ovsiienko Cc: dev@dpdk.org, xuemingl@nvidia.com, Asaf Penso Date: Wed, 6 Jan 2021 16:17:30 +0000 Message-Id: <1609949855-23817-5-git-send-email-xuemingl@nvidia.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1609949855-23817-1-git-send-email-xuemingl@nvidia.com> References: <1609949855-23817-1-git-send-email-xuemingl@nvidia.com> In-Reply-To: <1608303356-13089-2-git-send-email-xuemingl@nvidia.com> References: <1608303356-13089-2-git-send-email-xuemingl@nvidia.com> Subject: [dpdk-dev] [PATCH v2 4/9] ethdev: support PF index in representor X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- 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(-) diff --git a/doc/guides/prog_guide/poll_mode_drv.rst b/doc/guides/prog_guide/poll_mode_drv.rst index 831d620c8d..87f23c4f49 100644 --- a/doc/guides/prog_guide/poll_mode_drv.rst +++ b/doc/guides/prog_guide/poll_mode_drv.rst @@ -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. diff --git a/lib/librte_ethdev/ethdev_private.c b/lib/librte_ethdev/ethdev_private.c index 551a43738a..ccc638ec49 100644 --- a/lib/librte_ethdev/ethdev_private.c +++ b/lib/librte_ethdev/ethdev_private.c @@ -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; diff --git a/lib/librte_ethdev/rte_ethdev_driver.h b/lib/librte_ethdev/rte_ethdev_driver.h index 086d64223a..edb000cbd4 100644 --- a/lib/librte_ethdev/rte_ethdev_driver.h +++ b/lib/librte_ethdev/rte_ethdev_driver.h @@ -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 */ -- 2.25.1