From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 353EF5A9F for ; Mon, 15 Feb 2016 03:30:47 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 14 Feb 2016 18:30:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,448,1449561600"; d="scan'208";a="884894890" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga001.jf.intel.com with ESMTP; 14 Feb 2016 18:30:40 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 14 Feb 2016 18:30:39 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.218]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.209]) with mapi id 14.03.0248.002; Mon, 15 Feb 2016 10:30:37 +0800 From: "Liu, Yong" To: "Xu, HuilongX" , "dts@dpdk.org" Thread-Topic: [dts] [PATCH v3 3/4] nics: support jumbo setting in net_device module Thread-Index: AQHRZ5REa2UdykNYvE+ATq/QFl+FT58sYauA Date: Mon, 15 Feb 2016 02:30:36 +0000 Message-ID: <86228AFD5BCD8E4EBFD2B90117B5E81E144E1C64@SHSMSX103.ccr.corp.intel.com> References: <1455161950-21059-1-git-send-email-yong.liu@intel.com> <1455161950-21059-3-git-send-email-yong.liu@intel.com> In-Reply-To: Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYTQxMDZhM2ItZTgxZi00MDhhLThmZDYtYWQ4ZThjYjliNzI1IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjQuMTAuMTkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiS0lYMnFnazJCYU5cL3VuVEwwXC8xTDJkeGZOSndqWEFGdklacklZTURMMGFRPSJ9 x-ctpclassification: CTP_IC 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 02:30:47 -0000 Huilong, MTU is not equal to Ethernet packet size, minimum MTU should be 60 + 8 byte= (min fragment size). More details please reference to https://tools.ietf.org/html/rfc791. > -----Original Message----- > From: Xu, HuilongX > Sent: Monday, February 15, 2016 9:58 AM > To: Liu, Yong; dts@dpdk.org > Subject: RE: [dts] [PATCH v3 3/4] nics: support jumbo setting in > net_device module >=20 > Hi yong, > Some comments as below? >=20 > > -----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 > > > > Signed-off-by: Marvin Liu > > > > 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 > > > > import settings > > from crb import Crb > > -from settings import TIMEOUT > > +from settings import TIMEOUT, HEADER_SIZE > > +from utils import RED > > > > NICS_LIST =3D [] # global list for save nic objects > > > All NIC min MTU is 68, maybe 1G and 10G NIC is 64? > > +MIN_MTU =3D 68 > > + > > > > class NetDevice(object): > > > > @@ -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/unbind" > > - 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), "# ") > > > > > > def get_pci_id(crb, bus_id, devfun_id): > > -- > > 1.9.3