From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id BEFBEA0A03; Tue, 19 Jan 2021 08:15:57 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D9630140D66; Tue, 19 Jan 2021 08:15:49 +0100 (CET) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by mails.dpdk.org (Postfix) with ESMTP id DF7E5140D57 for ; Tue, 19 Jan 2021 08:15:46 +0100 (CET) Received: from Internal Mail-Server by MTLPINE1 (envelope-from xuemingl@nvidia.com) with SMTP; 19 Jan 2021 09:15:42 +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 10J7FfYc003537; Tue, 19 Jan 2021 09:15:41 +0200 From: Xueming Li To: Cc: dev@dpdk.org, Viacheslav Ovsiienko , xuemingl@nvidia.com, Asaf Penso , Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko Date: Tue, 19 Jan 2021 07:14:55 +0000 Message-Id: <1611040501-11666-3-git-send-email-xuemingl@nvidia.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1611040501-11666-1-git-send-email-xuemingl@nvidia.com> References: <1611040501-11666-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 v5 3/9] ethdev: support new VF representor syntax 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" 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 Acked-by: Viacheslav Ovsiienko Acked-by: Thomas Monjalon --- doc/guides/prog_guide/poll_mode_drv.rst | 7 ++++--- lib/librte_ethdev/ethdev_private.c | 5 ++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/doc/guides/prog_guide/poll_mode_drv.rst b/doc/guides/prog_guide/poll_mode_drv.rst index 239ec820ea..0117c2af07 100644 --- a/doc/guides/prog_guide/poll_mode_drv.rst +++ b/doc/guides/prog_guide/poll_mode_drv.rst @@ -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. diff --git a/lib/librte_ethdev/ethdev_private.c b/lib/librte_ethdev/ethdev_private.c index e87636f665..20e48a48be 100644 --- a/lib/librte_ethdev/ethdev_private.c +++ b/lib/librte_ethdev/ethdev_private.c @@ -119,7 +119,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 @@ -132,6 +133,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, ð_da->nb_representor_ports, RTE_MAX_ETHPORTS); if (str == NULL) -- 2.25.1