From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id ECD76C312 for ; Tue, 16 Jun 2015 09:35:44 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP; 16 Jun 2015 00:35:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,624,1427785200"; d="scan'208";a="588629575" Received: from kmsmsx153.gar.corp.intel.com ([172.21.73.88]) by orsmga003.jf.intel.com with ESMTP; 16 Jun 2015 00:34:49 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by KMSMSX153.gar.corp.intel.com (172.21.73.88) with Microsoft SMTP Server (TLS) id 14.3.224.2; Tue, 16 Jun 2015 15:33:39 +0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.129]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.246]) with mapi id 14.03.0224.002; Tue, 16 Jun 2015 15:33:37 +0800 From: "Zhang, Helin" To: Vijayakumar Muthuvel Manickam , Thomas Monjalon Thread-Topic: [dpdk-dev] [PATCH v3] kni: Add link status update Thread-Index: AQHQp/9tDI5J+X1K5ECG9FJ30a+80p2uu0dA Date: Tue, 16 Jun 2015 07:33:37 +0000 Message-ID: References: <20150615090904.4b4d45a5@urahara> <1434436794-27636-1-git-send-email-mmvijay@gmail.com> In-Reply-To: <1434436794-27636-1-git-send-email-mmvijay@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH v3] kni: Add link status update X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Jun 2015 07:35:45 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Vijayakumar Muthuvel > Manickam > Sent: Tuesday, June 16, 2015 2:40 PM > To: dev@dpdk.org > Subject: [dpdk-dev] [PATCH v3] kni: Add link status update >=20 > Implement .ndo_change_carrier to enable > DPDK applications to propagate link state changes to kni virtual interfac= es > through sysfs >=20 > Signed-off-by: Vijayakumar Muthuvel Manickam Acked-by: Helin Zhang > --- > Added kernel version check as .ndo_change_carrier is available only in ke= rnel > versions 3.9 and after >=20 > lib/librte_eal/linuxapp/kni/kni_net.c | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) >=20 > diff --git a/lib/librte_eal/linuxapp/kni/kni_net.c > b/lib/librte_eal/linuxapp/kni/kni_net.c > index dd95db5..9f9022b 100644 > --- a/lib/librte_eal/linuxapp/kni/kni_net.c > +++ b/lib/librte_eal/linuxapp/kni/kni_net.c > @@ -632,6 +632,17 @@ static int kni_net_set_mac(struct net_device *netdev= , > void *p) > return 0; > } >=20 > +#if (LINUX_VERSION_CODE >=3D KERNEL_VERSION(3, 9, 0)) static int > +kni_net_change_carrier(struct net_device *dev, bool new_carrier) { > + if (new_carrier) > + netif_carrier_on(dev); > + else > + netif_carrier_off(dev); > + return 0; > +} > +#endif > + > static const struct header_ops kni_net_header_ops =3D { > .create =3D kni_net_header, > .rebuild =3D kni_net_rebuild_header, > @@ -648,6 +659,9 @@ static const struct net_device_ops kni_net_netdev_ops= =3D > { > .ndo_get_stats =3D kni_net_stats, > .ndo_tx_timeout =3D kni_net_tx_timeout, > .ndo_set_mac_address =3D kni_net_set_mac, > +#if (LINUX_VERSION_CODE >=3D KERNEL_VERSION(3, 9, 0)) > + .ndo_change_carrier =3D kni_net_change_carrier, #endif > }; >=20 > void > -- > 1.8.1.4