From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Richardson, Bruce" Subject: Re: SR-IOV: API to tell VF from PF Date: Thu, 5 Nov 2015 15:51:09 +0000 Message-ID: <59AF69C657FD0841A61C55336867B5B035969499@IRSMSX103.ger.corp.intel.com> References: <2E654B490240B7449C846A96A8D8FE0CC43A4C67@ILMB2.corp.radware.com> <20151105095052.GA15324@bricha3-MOBL3> <745DB4B8861F8E4B9849C970520ABBF1497577D1@ORSMSX102.amr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: "dev@dpdk.org" To: "Polehn, Mike A" , Shaham Fridenberg Return-path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 27E848DB5 for ; Thu, 5 Nov 2015 16:51:24 +0100 (CET) In-Reply-To: <745DB4B8861F8E4B9849C970520ABBF1497577D1@ORSMSX102.amr.corp.intel.com> Content-Language: en-US List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > -----Original Message----- > From: Polehn, Mike A > Sent: Thursday, November 5, 2015 3:43 PM > To: Richardson, Bruce ; Shaham Fridenberg > > Cc: dev@dpdk.org > Subject: RE: [dpdk-dev] SR-IOV: API to tell VF from PF >=20 > I can think of a very good reason to want to know if the device is VF or > PF. >=20 > The VF has to go through a layer 2 switch, not allowing it to just receiv= e > anything coming across the Ehternet. >=20 > The PF can receive all the packets, including packets with different NIC > addresses. This allow the packets to be just data and allows the > processing of data without needing to be adjusting each NIC L2 address > before sending through to the Ehternet. So data can be moved through a > series of NICs between systems without the extra processing. Not doing > unnecessary processing leaves more clock cycles to do high value > processing. >=20 > Mike >=20 Yes, the capabilities of the different types of devices are different. However, is a better solution not to provide the ability to query a NIC if = it supports promiscuous mode, rather than set up a specific query for a VF?= What if (hypothetically) you get a PF that doesn't support promiscuous mod= e, for instance, or a bifurcated driver where the kernel part prevents the = userspace part from enabling promiscuous mode? In both these cases have a d= irect feature query works better than asking about PF/VF. Regards, /Bruce > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson > Sent: Thursday, November 5, 2015 1:51 AM > To: Shaham Fridenberg > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] SR-IOV: API to tell VF from PF >=20 > On Thu, Nov 05, 2015 at 09:39:19AM +0000, Shaham Fridenberg wrote: > > Hey all, > > > > Is there some API to tell VF from PF? > > > > Only way I found so far is deducing that from driver name in the > rte_eth_devices struct. > > > > Thanks, > > Shaham >=20 > Hi Shaham, >=20 > yes, checking the driver name is probably the only way to do so. However, > why do you need or want to know this? If you want to know the capabilitie= s > of a device basing it on a list of known device types is probably not the > best way. >=20 > Regards, > /Bruce