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 E0F93A057B; Wed, 1 Apr 2020 11:53:36 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 823321BE9B; Wed, 1 Apr 2020 11:53:36 +0200 (CEST) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by dpdk.org (Postfix) with ESMTP id 3F3651BE99 for ; Wed, 1 Apr 2020 11:53:35 +0200 (CEST) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id B217D5C03C3; Wed, 1 Apr 2020 05:53:34 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Wed, 01 Apr 2020 05:53:34 -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=9Iw321dZOmECHh0pwt2V4SzFnrvqXWE67L1OPRf1kXA=; b=qSBseLRYsDkr BfjYgfHsN9U3hoMsBQtmfbzE7s6wBz7IExeCIhRykEnuyMwF5jS/MCzTGY85ho2M GrzILJ9pnAjN/weVnaIyehzHnYN9g/kN/fLrL7QtrPAfllid1wg6eJ6lsivCQFMj TlLs5Z9ZVkmpHHQromoYYwqp1EC8cxE= 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=fm2; bh=9Iw321dZOmECHh0pwt2V4SzFnrvqXWE67L1OPRf1k XA=; b=NZ3Nu850Flk1A9Oq1hd5vcCI6oXpBhDou14otAUJfOPEkvhkNHcYZ1I0g 0zC2s/02bHG8/X/FTF3Z4Z6z6+0IjA2/GeyONvzIUHqSwkVjH7kG2ZmnwQw6f/1V 3U5Gg5v6FbQOMdSELkBxG0WxA5YaH23z/aF/lGO8PTXh/9NCFwkMagwI9GS+NLLl Zykcpr8iUSfAg+JvKzsZhL7MWV0OO6iiyf6TIYssmay3aUo9/9vWSatcDQQJ7HD3 XYtrOWB+8msTgHyak/wsPYomB+s+ArevX5pvGOBF4ge5YchUcd7tz3TwRv83Fgem WM2SUii4XxFqHcJvtlz7ZTnH1PZOg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrtddvgddvvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkjghfggfgtgesthhqredttddtudenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucffoh hmrghinhepughpughkrdhorhhgnecukfhppeejjedrudefgedrvddtfedrudekgeenucev lhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrsh esmhhonhhjrghlohhnrdhnvght 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 7009E306CC71; Wed, 1 Apr 2020 05:53:33 -0400 (EDT) From: Thomas Monjalon To: Ferruh Yigit , Andrew Rybchenko , Morten =?ISO-8859-1?Q?Br=F8rup?= Cc: dev@dpdk.org, Matan Azrad , "Benoit Ganne (bganne)" Date: Wed, 01 Apr 2020 11:53:32 +0200 Message-ID: <2254486.aKNjEaI27c@xps> In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35C60F2D@smartserver.smartshare.dk> References: <98CBD80474FA8B44BF855DF32C47DC35C60F2D@smartserver.smartshare.dk> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" Subject: Re: [dpdk-dev] [RFC] ethdev: use special speed for virtual Ethernet devices 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" 01/04/2020 11:33, Morten Br=F8rup: > Thomas, Ferruh, Andrew (Ethernet API Maintainers), >=20 > A command line option was recently added to set which speed a vNIC report= s when the link is up. This makes sense for Spanning Tree and other protoco= ls which depend on link speed. Please could you reference the patch? > However, I suspect that this workaround rarely reflects the physical trut= h, and suggest that the application should handle it instead. I don't understand why we need to define some speed for virtual devices. > In other words... Instead of faking it in the virtual Ethernet drivers, I= suggest that rte_ethdev.h defines a special speed value for vNICs which re= ally don't have a physical link speed: >=20 > #define ETH_SPEED_NUM_NONE 0 /**< Not defined */ The only issue with this constant is the lack of RTE_ prefix :-) Otherwise I think "0 - NONE - not defined" fits well with virtual device ca= se. > +#define ETH_SPEED_NUM_UNKNOWN 1 /**< Unknown (virtual device) */ 1 means 1 Mbps > #define ETH_SPEED_NUM_10M 10 /**< 10 Mbps */ >=20 > Alternatively, we could expand the meaning of ETH_SPEED_NUM_NONE: >=20 > -#define ETH_SPEED_NUM_NONE 0 /**< Not defined */ > +#define ETH_SPEED_NUM_NONE 0 /**< Not defined or unknown (virtua= l device) */ Yes I agree with extending the comment for NONE. > The special value could also be used in cases like this: > http://inbox.dpdk.org/dev/AM0PR0502MB401907ADE7CEA27DC642DF35D2CB0@AM0PR0= 502MB4019.eurprd05.prod.outlook.com/T/#t Yes, if speed is unknown, it should be reported as 0.