From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 55C0A2C72 for ; Mon, 15 Feb 2016 02:57:49 +0100 (CET) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP; 14 Feb 2016 17:57:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,448,1449561600"; d="scan'208";a="902606132" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga001.fm.intel.com with ESMTP; 14 Feb 2016 17:57:49 -0800 Received: from fmsmsx112.amr.corp.intel.com (10.18.116.6) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 14 Feb 2016 17:57:48 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.110.14) by FMSMSX112.amr.corp.intel.com (10.18.116.6) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 14 Feb 2016 17:57:47 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.249]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.218]) with mapi id 14.03.0248.002; Mon, 15 Feb 2016 09:57:45 +0800 From: "Xu, HuilongX" To: "Liu, Yong" , "dts@dpdk.org" Thread-Topic: [dts] [PATCH v3 3/4] nics: support jumbo setting in net_device module Thread-Index: AQHRZH3RAbT/EsNivUSkydXJTqrh5J8sXwCg Date: Mon, 15 Feb 2016 01:57:45 +0000 Message-ID: References: <1455161950-21059-1-git-send-email-yong.liu@intel.com> <1455161950-21059-3-git-send-email-yong.liu@intel.com> In-Reply-To: <1455161950-21059-3-git-send-email-yong.liu@intel.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 Subject: Re: [dts] [PATCH v3 3/4] nics: support jumbo setting in net_device module X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Feb 2016 01:57:49 -0000 Hi yong, Some comments as below? > -----Original Message----- > From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Yong Liu > Sent: Thursday, February 11, 2016 11:39 AM > To: dts@dpdk.org > Subject: [dts] [PATCH v3 3/4] nics: support jumbo setting in net_device > module >=20 > Signed-off-by: Marvin Liu >=20 > diff --git a/nics/net_device.py b/nics/net_device.py > index 9d9e1ac..73750f5 100644 > --- a/nics/net_device.py > +++ b/nics/net_device.py > @@ -38,10 +38,13 @@ import time >=20 > import settings > from crb import Crb > -from settings import TIMEOUT > +from settings import TIMEOUT, HEADER_SIZE > +from utils import RED >=20 > NICS_LIST =3D [] # global list for save nic objects >=20 All NIC min MTU is 68, maybe 1G and 10G NIC is 64? > +MIN_MTU =3D 68 > + >=20 > class NetDevice(object): >=20 > @@ -770,7 +773,22 @@ class NetDevice(object): > """ > nic_pci_num =3D ':'.join(['0000', bus_id, devfun_id]) > cmd =3D "echo %s > /sys/bus/pci/devices/0000\:%s\:%s/driver/unbi= nd" > - self.send_expect(cmd % (nic_pci_num, bus_id, devfun_id), "# ") > + self.__send_expect(cmd % (nic_pci_num, bus_id, devfun_id), "# ") > + > + def _cal_mtu(self, framesize): > + return framesize - HEADER_SIZE['eth'] > + > + def enable_jumbo(self, framesize=3D0): > + if self.intf_name =3D=3D "N/A": > + print RED("Enable jumbo must based on kernel interface!!!") > + return > + if framesize < MIN_MTU: > + print RED("Enable jumbo must over %d !!!" % MIN_MTU) > + return > + > + mtu =3D self._cal_mtu(framesize) > + cmd =3D "ifconfig %s mtu %d" > + self.__send_expect(cmd % (self.intf_name, mtu), "# ") >=20 >=20 > def get_pci_id(crb, bus_id, devfun_id): > -- > 1.9.3