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 39B51A0471 for ; Thu, 15 Aug 2019 19:59:26 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 157921BEEB; Thu, 15 Aug 2019 19:59:25 +0200 (CEST) Received: from new4-smtp.messagingengine.com (new4-smtp.messagingengine.com [66.111.4.230]) by dpdk.org (Postfix) with ESMTP id 5B4D51BEEA for ; Thu, 15 Aug 2019 19:59:23 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailnew.nyi.internal (Postfix) with ESMTP id 919CE1D8F; Thu, 15 Aug 2019 13:59:22 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Thu, 15 Aug 2019 13:59:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=mesmtp; bh=BY6Nrgwl6zGlBGUajXJHVCT0p0DbOjUwhOSpnGxIb/8=; b=AHsnCUOiTOVP dF0gu/Bcdt0ncBCHK1/v33Qlfxmy4tXgRmEHl/kLGwdcyrtCgildVCFUTFr/Igrc C0PS//r8MGRhPk43GwQQAtQldiCNeMOuUm8uy9tvlQfLawEL55Z9POO2MTZBpABl KCRAl8JVJG0MShmtkKq0vAQV5mJozwM= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=BY6Nrgwl6zGlBGUajXJHVCT0p0DbOjUwhOSpnGxIb /8=; b=OQD8xpuKMP872b98faqzLf1+IIMv0HzYHuD0uGcXOnKYGJT+dm0EgL7D0 SjtEiSHRvzlROCDj+BD5kGYEK8UmvUP9Q54v3UnOr3FdnrLWlFwkyiQ8XiC7yMvU UzRYAkZcZzHw7Nk3plFxE4A2iqUPX1jt0N7UpQW2xxPxSM4lwHedaMXz/bA2rE2r 5FeZM2THERwut6Othv5zuU8anGyi4rFQgi7cGafsP65sjdZ9UVROQcfvXSz5jaJI z8lcNySe3YofVcTjcIobXeJhhqwim1mnZ/3dcy55hroAqCxNzZ44BI2YuVzl8Xho KWo4IXQ0MewKIgC2wRPw9KlcTKjkA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrudefuddguddukecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc fkphepjeejrddufeegrddvtdefrddukeegnecurfgrrhgrmhepmhgrihhlfhhrohhmpeht hhhomhgrshesmhhonhhjrghlohhnrdhnvghtnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 12542380089; Thu, 15 Aug 2019 13:59:19 -0400 (EDT) From: Thomas Monjalon To: Jerin Jacob Kollanukkaran Cc: Ferruh Yigit , Andrew Rybchenko , "dev@dpdk.org" , Bernard Iremonger , Shahaf Shuler , "E. Scott Daniels" , Wenzhuo Lu , Alex Zelezniak , Ajit Khaparde , Declan Doherty Date: Thu, 15 Aug 2019 19:59:18 +0200 Message-ID: <3065298.OHD6ChtW5A@xps> In-Reply-To: References: <4165509.5enYigmRGf@xps> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [RFC] ethdev: configure SR-IOV VF from host 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" 15/08/2019 17:34, Jerin Jacob Kollanukkaran: > From: Thomas Monjalon > > > > In a virtual environment, the network controller may have to configure some > > SR-IOV VF parameters for security reasons. > > > > When the PF (host port) is drived by DPDK (OVS-DPDK case), we face two > > different cases: > > - driver is bifurcated (Mellanox case), > > so the VF can be configured via the kernel. > > - driver is on top of UIO or VFIO, so DPDK API is required. > > > > This RFC proposes to use generic DPDK API for VF configuration. > > The impacted functions are (can be extended): > > > > - rte_eth_dev_is_valid_port > > - rte_eth_promiscuous_enable > > - rte_eth_promiscuous_disable > > - rte_eth_promiscuous_get > > - rte_eth_allmulticast_enable > > - rte_eth_allmulticast_disable > > - rte_eth_allmulticast_get > > - rte_eth_dev_set_mc_addr_list > > - rte_eth_dev_default_mac_addr_set > > - rte_eth_macaddr_get > > - rte_eth_dev_mac_addr_add > > - rte_eth_dev_mac_addr_remove > > - rte_eth_dev_vlan_filter > > - rte_eth_dev_get_mtu > > - rte_eth_dev_set_mtu > > > > In order to target these functions to a VF (which has no port id in the host), > > the higher bit of port id is reserved: > > > > #define RTE_ETH_VF_PORT_FLAG (1 << 15) > > Instead of changing the port number behavior, How about adding a bit field/ > I think, There is no ABI breakage as the parent type of bit field is uint8_t and there > is still more room. > > --- a/lib/librte_ethdev/rte_ethdev_core.h > +++ b/lib/librte_ethdev/rte_ethdev_core.h > @@ -621,6 +621,7 @@ struct rte_eth_dev_data { > all_multicast : 1, /**< RX all multicast mode ON(1) / OFF(0). */ > dev_started : 1, /**< Device state: STARTED(1) / STOPPED(0). */ > lro : 1; /**< RX LRO is ON(1) / OFF(0) */ > + vf : 1; /**< SR-IOV VF device */ > uint8_t rx_queue_state[RTE_MAX_QUEUES_PER_PORT]; > /**< Queues state: STARTED(1) / STOPPED(0). */ > uint8_t tx_queue_state[RTE_MAX_QUEUES_PER_PORT]; Sorry I don't understand how it can help. We need to specify which VF we want to configure. My proposal is to use the representor port, which is connected to a VF. We distinguish the representor and the VF with a flag in the port id parameter passed to the functions.