From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: Re: [PATCH 2/2] kni: set default carrier state to 'off' Date: Tue, 18 Sep 2018 17:15:48 +0100 Message-ID: <30ebb4b6-cf0e-37d8-00d4-167b46667378@intel.com> References: <20180911232906.18352-1-dg@adax.com> <20180911232906.18352-3-dg@adax.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: Igor Ryzhov , Stephen Hemminger To: Dan Gora , dev@dpdk.org Return-path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id B465F1041 for ; Tue, 18 Sep 2018 18:16:02 +0200 (CEST) In-Reply-To: <20180911232906.18352-3-dg@adax.com> Content-Language: en-US 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 9/12/2018 12:29 AM, 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(). Why setting to no-carrier mode by default? This will change the behavior of interfaces and may effect others. And indeed I didn't get why this is required? > > Signed-off-by: Dan Gora > --- > kernel/linux/kni/kni_misc.c | 2 ++ > kernel/linux/kni/kni_net.c | 2 ++ > 2 files changed, 4 insertions(+) > > diff --git a/kernel/linux/kni/kni_misc.c b/kernel/linux/kni/kni_misc.c > index fa69f8e63..45649499d 100644 > --- a/kernel/linux/kni/kni_misc.c > +++ b/kernel/linux/kni/kni_misc.c > @@ -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; > diff --git a/kernel/linux/kni/kni_net.c b/kernel/linux/kni/kni_net.c > index 7fcfa106c..1f8ba0700 100644 > --- a/kernel/linux/kni/kni_net.c > +++ b/kernel/linux/kni/kni_net.c > @@ -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; >