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

2018-09-11 Thread Jason Wang
On 2018年09月12日 07:14, Stephen Hemminger wrote: On Tue, 11 Sep 2018 19:07:47 -0300 Dan Gora wrote: On Tue, Sep 11, 2018 at 6:52 PM, Stephen Hemminger wrote: The carrier state has no meaning when device is down, at least for physical devices. Because often the PHY is powered off when the de

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

2018-09-11 Thread Stephen Hemminger
On Tue, 11 Sep 2018 19:07:47 -0300 Dan Gora wrote: > On Tue, Sep 11, 2018 at 6:52 PM, Stephen Hemminger > wrote: > > 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. > > The thing

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

2018-09-11 Thread Dan Gora
On Tue, Sep 11, 2018 at 6:52 PM, Stephen Hemminger wrote: > 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. The thing that caught my attention is that when you mark a kernel ethernet device

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

2018-09-11 Thread Stephen Hemminger
On Tue, 11 Sep 2018 18:45:49 -0300 Dan Gora 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 wr

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

2018-09-11 Thread Dan Gora
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 inter

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

2018-09-05 Thread Stephen Hemminger
On Mon, 3 Sep 2018 21:47:22 -0300 Dan Gora wrote: > Hi All, > > One other problem with using the sysfs method to change the link state > rather than this ioctl method. The sysfs/netdev method to change the > carrier was only introduced in kernel 3.9. For older kernels, we > would just be out o

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

2018-09-03 Thread Dan Gora
Hi All, One other problem with using the sysfs method to change the link state rather than this ioctl method. The sysfs/netdev method to change the carrier was only introduced in kernel 3.9. For older kernels, we would just be out of luck. The ioctl method will work with any kernel version (2.6

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

2018-08-30 Thread Dan Gora
On Thu, Aug 30, 2018 at 7:09 PM, Stephen Hemminger wrote: > On Thu, 30 Aug 2018 18:41:14 -0300 > Dan Gora wrote: > >> On the other hand, the "write to /sys" method is a bit more simple and >> confines the changes to the user space library. If we're confident >> that the /sys ABI is stable and no

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

2018-08-30 Thread Stephen Hemminger
On Thu, 30 Aug 2018 18:41:14 -0300 Dan Gora wrote: > On the other hand, the "write to /sys" method is a bit more simple and > confines the changes to the user space library. If we're confident > that the /sys ABI is stable and not going to be changed going forward > it seems like a valid alterna

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

2018-08-30 Thread Dan Gora
Hi All, So I'm a little unclear as to what to do here moving forward.. Do we all agree at least that there should be some function in DPDK in order to set the link state for KNI interfaces? I'm a strong yes on this point. I don't think that every KNI user should have to implement something like

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

2018-08-30 Thread Igor Ryzhov
Hi again, Forgot to mention netif_carrier_off changes. Your changes are necessary for correct link status management, but netif_carrier_off call should also be added to kni_ioctl_create before the register_netdev call. That's needed for correct link status even before first call to ndo_open. Best

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

2018-08-30 Thread Igor Ryzhov
Hi Dan, We use KNI device exactly the same way you described – with IP addresses, routing, etc. And we also faced the same problem of having the actual link status in Linux kernel. There is a special callback for link state management in net_device_ops for soft-devices like KNI called ndo_change_

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

2018-08-29 Thread Stephen Hemminger
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 fo

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

2018-08-29 Thread Dan Gora
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. >>> >> >

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

2018-08-29 Thread Dan Gora
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 whe

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

2018-08-29 Thread Stephen Hemminger
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

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

2018-08-29 Thread Stephen Hemminger
On Wed, 29 Aug 2018 18:02:06 -0300 Dan Gora wrote: > On Wed, Aug 29, 2018 at 12:54 PM, Stephen Hemminger > wrote: > > On Thu, 28 Jun 2018 18:55:08 -0700 > > Dan Gora wrote: > > > >> Add a new API function to KNI, rte_kni_update_link() to allow DPDK > >> applications to update the link state f

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

2018-08-29 Thread Dan Gora
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 sta

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

2018-08-29 Thread Dan Gora
On Wed, Aug 29, 2018 at 12:54 PM, Stephen Hemminger wrote: > On Thu, 28 Jun 2018 18:55:08 -0700 > 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

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

2018-08-29 Thread Stephen Hemminger
On Thu, 28 Jun 2018 18:55:08 -0700 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 open

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

2018-08-29 Thread Ferruh Yigit
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 ca

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

2018-06-28 Thread Dan Gora
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 --- kernel/linux/kni/kni_misc.c