On Wed, 29 Aug 2018 18:10:35 -0300 Dan Gora <d...@adax.com> wrote: > On Wed, Aug 29, 2018 at 8:48 AM, Ferruh Yigit <ferruh.yi...@intel.com> 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.