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 CB556C564 for ; Tue, 28 Apr 2015 15:50:10 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP; 28 Apr 2015 06:50:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,663,1422950400"; d="scan'208";a="702121471" Received: from irsmsx107.ger.corp.intel.com ([163.33.3.99]) by fmsmga001.fm.intel.com with ESMTP; 28 Apr 2015 06:49:59 -0700 Received: from irsmsx103.ger.corp.intel.com ([169.254.3.76]) by IRSMSX107.ger.corp.intel.com ([169.254.10.215]) with mapi id 14.03.0224.002; Tue, 28 Apr 2015 14:49:54 +0100 From: "Mcnamara, John" To: Tero Aho , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH 1/3] pcap: utilize underlying real interface properties Thread-Index: AQHQUpNnwKuv8PCljkq0Jlaby5Wl9J1izGRQ Date: Tue, 28 Apr 2015 13:49:53 +0000 Message-ID: References: <1425044560-23397-1-git-send-email-tero.aho@coriant.com> <1425044560-23397-2-git-send-email-tero.aho@coriant.com> In-Reply-To: <1425044560-23397-2-git-send-email-tero.aho@coriant.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 1/3] pcap: utilize underlying real interface properties 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, 28 Apr 2015 13:50:11 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Tero Aho > Sent: Friday, February 27, 2015 1:43 PM > To: dev@dpdk.org > Subject: [dpdk-dev] [PATCH 1/3] pcap: utilize underlying real interface > properties >=20 > These changes set pcap interface mac address to the real underlying > interface address instead of the default one. Also real interface link > status, speed and duplex are reported when eth_link_update is called for > the pcap interface. >=20 > Signed-off-by: Tero Aho > ... > + /* get link status, speed and duplex from the underlying = interface */ > + > + strncpy(ifr.ifr_name, internals->if_name, > sizeof(ifr.ifr_name)-1); > + ifr.ifr_name[sizeof(ifr.ifr_name)-1] =3D 0; > + if (!ioctl(internals->if_fd, SIOCGIFFLAGS, &ifr)) > + dev->data->dev_link.link_status =3D (ifr.ifr_flag= s > + & IFF_UP) ? 1 : 0; > + > + cmd.cmd =3D ETHTOOL_GSET; > + ifr.ifr_data =3D (void *)&cmd; > + if (!ioctl(internals->if_fd, SIOCETHTOOL, &ifr)) { > + dev->data->dev_link.link_speed =3D > ethtool_cmd_speed(&cmd); Hi Tero, I can see the benefit of setting the link status and speed etc. but this me= thod seems a little fragile. What if there isn't an underlying interface, o= r all the interfaces are already bound to DPDK? Also I don't think the etht= ool calls will work on FreeBSD as is. So overall, I think this is a nack for this part of the patch. Perhaps a be= tter approach would be to provide a function so that the calling applicatio= n can set the parameters instead. John