[dts] [PATCH v3 3/4] nics: support jumbo setting in net_device module

Liu, Yong yong.liu at intel.com
Mon Feb 15 03:30:36 CET 2016


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 at dpdk.org
> Subject: RE: [dts] [PATCH v3 3/4] nics: support jumbo setting in
> net_device module
> 
> Hi yong,
> Some comments as below?
> 
> > -----Original Message-----
> > From: dts [mailto:dts-bounces at dpdk.org] On Behalf Of Yong Liu
> > Sent: Thursday, February 11, 2016 11:39 AM
> > To: dts at dpdk.org
> > Subject: [dts] [PATCH v3 3/4] nics: support jumbo setting in net_device
> > module
> >
> > Signed-off-by: Marvin Liu <yong.liu at intel.com>
> >
> > 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 = []      # global list for save nic objects
> >
>    All NIC min MTU is 68, maybe 1G and 10G NIC is 64?
> > +MIN_MTU = 68
> > +
> >
> >  class NetDevice(object):
> >
> > @@ -770,7 +773,22 @@ class NetDevice(object):
> >          """
> >          nic_pci_num = ':'.join(['0000', bus_id, devfun_id])
> >          cmd = "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=0):
> > +        if self.intf_name == "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 = self._cal_mtu(framesize)
> > +        cmd = "ifconfig %s mtu %d"
> > +        self.__send_expect(cmd % (self.intf_name, mtu), "# ")
> >
> >
> >  def get_pci_id(crb, bus_id, devfun_id):
> > --
> > 1.9.3



More information about the dts mailing list