From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id C4DF3A09FF; Mon, 28 Dec 2020 14:43:06 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6744EC9FA; Mon, 28 Dec 2020 14:43:05 +0100 (CET) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by dpdk.org (Postfix) with ESMTP id 0BBA7C9D6 for ; Mon, 28 Dec 2020 14:43:04 +0100 (CET) Received: from [192.168.38.17] (aros.oktetlabs.ru [192.168.38.17]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id B6E7D7F511; Mon, 28 Dec 2020 16:43:02 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru B6E7D7F511 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1609162982; bh=0J3TNx9gjWQn8maKdZa4QAwHKmmFWEiexaOQadwZaHU=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=jjCIKA7DycSxo2qtIQlTm4Xm9SXdxPWGFUIusnAXU7KUUVzrylSdzCo+Yc0tIJYSx d/ITHyxI3mkn8J5QfxMo6fkxyNPmv0jp3RVL/GbI+YZhHseraX+gmhsWZ1fIHJhh1t cGiPPZYAIIqMWAmaquaHFlmsMopknool48PaoPew= To: Xueming Li , Viacheslav Ovsiienko , Thomas Monjalon , Ferruh Yigit , Olivier Matz , Matan Azrad Cc: dev@dpdk.org, Asaf Penso References: <1608303356-13089-1-git-send-email-xuemingl@nvidia.com> <1608303356-13089-3-git-send-email-xuemingl@nvidia.com> From: Andrew Rybchenko Organization: OKTET Labs Message-ID: Date: Mon, 28 Dec 2020 16:43:02 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 In-Reply-To: <1608303356-13089-3-git-send-email-xuemingl@nvidia.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [RFC 2/7] ethdev: support multi-host representor X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" On 12/18/20 5:55 PM, Xueming Li wrote: > This patch introduce multi-host controller for ethdev representor > syntax, examples: > > [[c#]pf#]vf#: VF port representor/s, example: pf0vf1 > [[c#]pf#]sf#: SF port representor/s, example: c1pf1sf[0-3] > > c# is controller ID/range in case of multi-host, optional. It is mostly > for SmartNIC attached to multiple hosts in the same rack to allow > routing the packets between PF/SF/VF running on these hosts. There is a big question here what is the controller ID and how to explain it to end-user (e.g. OvS admin) which one is 0 and which one is 1, etc. > > Signed-off-by: Xueming Li > --- > config/rte_config.h | 1 + > lib/librte_ethdev/ethdev_private.c | 13 +++++++++++-- > lib/librte_ethdev/rte_ethdev_driver.h | 4 ++++ > 3 files changed, 16 insertions(+), 2 deletions(-) > > diff --git a/config/rte_config.h b/config/rte_config.h > index a0b5160ff2..23d02d51ef 100644 > --- a/config/rte_config.h > +++ b/config/rte_config.h > @@ -58,6 +58,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 > diff --git a/lib/librte_ethdev/ethdev_private.c b/lib/librte_ethdev/ethdev_private.c > index 2a057c5f36..3e455acea9 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 > - * [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 > */ > int > rte_eth_devargs_parse_representor_ports(char *str, void *data) > @@ -105,6 +105,15 @@ rte_eth_devargs_parse_representor_ports(char *str, void *data) > int ret; > > eth_da->type = RTE_ETH_REPRESENTOR_NONE; > + if (str[0] == 'c') { > + str += 1; > + ret = rte_eth_devargs_process_list(str, eth_da->mh_controllers, > + ð_da->nb_mh_controllers, > + RTE_DIM(eth_da->mh_controllers)); > + if (ret < 0) > + goto err; > + str += ret; > + } > /* parse pf# */ > if (str[0] == 'p' && str[1] == 'f') { > str += 2; > diff --git a/lib/librte_ethdev/rte_ethdev_driver.h b/lib/librte_ethdev/rte_ethdev_driver.h > index edb000cbd4..a7969c9408 100644 > --- a/lib/librte_ethdev/rte_ethdev_driver.h > +++ b/lib/librte_ethdev/rte_ethdev_driver.h > @@ -1203,6 +1203,10 @@ enum rte_eth_representor_type { > > /** Generic Ethernet device arguments */ > 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 contollerss field */ Typo: contollerss > uint16_t ports[RTE_MAX_ETHPORTS]; > /** port/s number to enable on a multi-port single function */ > uint16_t nb_ports; >