From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH v2 10/10] kni: add API to set link status on kernel interface Date: Wed, 29 Aug 2018 16:10:43 -0700 Message-ID: <20180829161043.11bb2434@xeon-e3> References: <20180628224513.18391-1-dg@adax.com> <20180629015508.26599-1-dg@adax.com> <20180629015508.26599-11-dg@adax.com> <20180829085410.4411c07e@xeon-e3> <20180829150014.0ae59128@xeon-e3> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Ferruh Yigit , dev@dpdk.org To: Dan Gora Return-path: Received: from mail-pl1-f194.google.com (mail-pl1-f194.google.com [209.85.214.194]) by dpdk.org (Postfix) with ESMTP id 560A0231E for ; Thu, 30 Aug 2018 01:10:47 +0200 (CEST) Received: by mail-pl1-f194.google.com with SMTP id d12-v6so2957727pls.4 for ; Wed, 29 Aug 2018 16:10:47 -0700 (PDT) In-Reply-To: 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 Wed, 29 Aug 2018 19:41:23 -0300 Dan Gora wrote: > On Wed, Aug 29, 2018 at 7:12 PM, Dan Gora wrote: > > On Wed, Aug 29, 2018 at 7:00 PM, Stephen Hemminger > > wrote: > >>> >> Add a new API function to KNI, rte_kni_update_link() to allow DPDK > >>> >> applications to update the link state for the KNI network interfaces > >>> >> in the linux kernel. > >>> >> > >>> >> Note that the default carrier state is set to off when the interface > >>> >> is opened. > >>> >> > >>> >> Signed-off-by: Dan Gora > >>> > > >>> > Do you really need a special ioctl for this? > >>> > There is already ability to set link state via sysfs or netlink. > >>> > >>> I think yes.. AFAIK sysfs does not constitute a stable API; > >> > >> It is a stable API on Linux. > > > > Actually this does not seem to be completely true... > > From Documentation/admin-guide/sysfs-rules.rst: > > Rules on how to access information in sysfs > =========================================== > > The kernel-exported sysfs exports internal kernel implementation details > and depends on internal kernel structures and layout. It is agreed upon > by the kernel developers that the Linux kernel does not provide a stable > internal API. Therefore, there are aspects of the sysfs interface that > may not be stable across kernel releases. > > > > - devices are only "devices" > There is no such thing like class-, bus-, physical devices, > interfaces, and such that you can rely on in userspace. Everything is > just simply a "device". Class-, bus-, physical, ... types are just > kernel implementation details which should not be expected by > applications that look for devices in sysfs. > > The properties of a device are: > > - devpath (``/devices/pci0000:00/0000:00:1d.1/usb2/2-2/2-2:1.0``) > > > - kernel name (``sda``, ``tty``, ``0000:00:1f.2``, ...) > > > - subsystem (``block``, ``tty``, ``pci``, ...) > > > - driver (``tg3``, ``ata_piix``, ``uhci_hcd``) > > > - attributes > > > Everything else is just a kernel driver-core implementation detail > that should not be assumed to be stable across kernel releases. Network device sysfs is stable. No one ever got around to putting it in documentation I wouldn't worry, once anything in /sys/class/net is added it is not going to change without major breakage in many many tools.