[dpdk-dev] [PATCH v2 10/10] kni: add API to set link status on kernel interface

Stephen Hemminger stephen at networkplumber.org
Tue Sep 11 23:52:48 CEST 2018


On Tue, 11 Sep 2018 18:45:49 -0300
Dan Gora <dg at adax.com> wrote:

> Hi All,
> 
> So I implemented the "write to /sys/devices/virtual/net/*/carrier"
> method to change the link status, but there is one more minor thing
> that I wanted to point out about this approach.  The problem is that
> you cannot read or write the '/sys/devices/virtual/net/*/carrier' file
> while the interface is marked 'down'.  This means that link status
> changes can only be performed by the DPDK application while the
> interface is in the "up" state.  With the ioctl method, you can change
> the carrier state at pretty much any time.
> 
> Is this a problem?  It's not a huge one, I guess, but it is something
> else to consider.
> 
> Please let me know what you all think.
> 
> thanks
> dan

The carrier state has no meaning when device is down, at least for physical
devices. Because often the PHY is powered off when the device is marked down.


More information about the dev mailing list