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 15:01:23 -0700 Message-ID: <20180829150123.05d93e27@xeon-e3> References: <20180628224513.18391-1-dg@adax.com> <20180629015508.26599-1-dg@adax.com> <20180629015508.26599-11-dg@adax.com> <06764741-fa78-3bef-f790-a4e8d20a4209@intel.com> 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-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) by dpdk.org (Postfix) with ESMTP id 922672B92 for ; Thu, 30 Aug 2018 00:01:26 +0200 (CEST) Received: by mail-pg1-f195.google.com with SMTP id m4-v6so2903968pgv.12 for ; Wed, 29 Aug 2018 15:01:26 -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 18:10:35 -0300 Dan Gora wrote: > On Wed, Aug 29, 2018 at 8:48 AM, Ferruh Yigit wrote: > > On 6/29/2018 2:55 AM, Dan Gora 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. > > > > Why set carrier off when interface opened? > > A couple of reasons: > > 1) That's the way every other Ethernet driver in the linux kernel does > it that I've seen. > > 2) The DPDK application may not actually be ready for the interface to > be used when it is first created. Things like NetworkManager, etc > will gladly go trying to assign IP addresses to those interfaces, add > them to the routing table, etc as soon as the interface is marked > "up". By making the default be "down", this allows the application to > finish any initialization on the DPDK side of the interface before > allowing it to be used by the kernel. > > > Although I don't see any difference > > in interface state with or without this call. > > Previously in the 'ip addr' output, the 'state' would be 'UNKNOWN' > when the interface was created. After this patch the 'state' in 'ip > addr' is 'DOWN'. > > thanks > dan There is also a better (richer) API for link status on linux via the operstate functions. Those might better match the semantics of a tunnellish interface like KNI.