From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id EA3741B199 for ; Fri, 28 Sep 2018 10:03:10 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Sep 2018 01:03:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,314,1534834800"; d="scan'208";a="261154582" Received: from fyigit-mobl.ger.corp.intel.com (HELO [10.252.3.51]) ([10.252.3.51]) by orsmga005.jf.intel.com with ESMTP; 28 Sep 2018 01:03:07 -0700 To: Dan Gora Cc: dev@dpdk.org, Igor Ryzhov , Stephen Hemminger References: <20180911232906.18352-1-dg@adax.com> <20180919195549.5585-1-dg@adax.com> <20180919195549.5585-2-dg@adax.com> <671135e5-a666-4254-c5c6-672c3863146b@intel.com> <61731242-db6c-0c5d-bcab-e82b45e324d7@intel.com> <846eed94-2ed7-7b89-5a3e-696ec3674a26@intel.com> From: Ferruh Yigit Openpgp: preference=signencrypt Message-ID: <7811a241-524d-21fd-4852-b63e2bba7332@intel.com> Date: Fri, 28 Sep 2018 09:03:06 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v2 1/5] kni: add API to set link status on kernel interface 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: , X-List-Received-Date: Fri, 28 Sep 2018 08:03:11 -0000 On 9/28/2018 12:51 AM, Dan Gora wrote: > On Thu, Sep 27, 2018 at 8:44 PM, Ferruh Yigit wrote: >>> Well, yes the link_status (link up, link down) _is_ applied to the KNI >>> interface. When that occurs, most people want to know what the link >>> speed is that the link came up at. >> >> +1 to this, people would like to know link speed of the interface. >> Are you printing link speed of interface? You are printing whatever user pass to >> API. > > There is no such thing as "link speed of the interface". The link > speed is the speed of the underlying Ethernet link that the interface > corresponds to. This is true for all other ethernet interfaces in the > kernel. This is an API to set link status of KNI interface, KNI interface is a virtual interface and no need to be backed by a physical interface at all. Only kni sample application uses it in a way to match a physical interface to a KNI interface, but please check KNI PMD where you can have multiple KNI interface without any physical device at all. > >> I guess you trust to user to provide correct values there, but since only link >> up & down matters, what prevents user to leave other fields, like speed, just >> random values? > > Nothing. What prevents anyone from providing random values for > anything? The point of the API was to make it super simple, just: > > rte_eth_link_get_nowait(portid, &link); > rte_kni_update_link(p[portid]->kni[i], &link); You are only thinking about this use case. Normally the input to API should be verified right, for this case there is no way to verify it and vales are not used at all, it is just printed in API. OK to print link information but please do so in sample application before calling API, not in API please. > > No messing around with the link info retrieved from > rte_eth_link_get(_nowait), just dump in the struct that was returned. >