[v2,2/5] kni: set default carrier state to 'off'
Checks
Commit Message
Set the carrier state to 'off' when the interface is instantiated
or when it is marked 'up' or 'down'. This is necessary to set the
interface to a known operational state until the carrier state is
changed with rte_kni_update_link().
Signed-off-by: Dan Gora <dg@adax.com>
---
kernel/linux/kni/kni_misc.c | 2 ++
kernel/linux/kni/kni_net.c | 2 ++
2 files changed, 4 insertions(+)
Comments
On 9/19/2018 8:55 PM, Dan Gora wrote:
> Set the carrier state to 'off' when the interface is instantiated
> or when it is marked 'up' or 'down'. This is necessary to set the
> interface to a known operational state until the carrier state is
> changed with rte_kni_update_link().
>
> Signed-off-by: Dan Gora <dg@adax.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
@@ -466,6 +466,8 @@ kni_ioctl_create(struct net *net, uint32_t ioctl_num,
return -ENODEV;
}
+ netif_carrier_off(net_dev);
+
ret = kni_run_thread(knet, kni, dev_info.force_bind);
if (ret != 0)
return ret;
@@ -133,6 +133,7 @@ kni_net_open(struct net_device *dev)
struct kni_dev *kni = netdev_priv(dev);
netif_start_queue(dev);
+ netif_carrier_off(dev);
memset(&req, 0, sizeof(req));
req.req_id = RTE_KNI_REQ_CFG_NETWORK_IF;
@@ -152,6 +153,7 @@ kni_net_release(struct net_device *dev)
struct kni_dev *kni = netdev_priv(dev);
netif_stop_queue(dev); /* can't transmit any more */
+ netif_carrier_off(dev);
memset(&req, 0, sizeof(req));
req.req_id = RTE_KNI_REQ_CFG_NETWORK_IF;