[dts] [PATCH 1/6] framework: crb :add some parameters and check_Mellanox_pci function to identify mellanox device

Liu, Yong yong.liu at intel.com
Wed Jan 20 10:24:57 CET 2016


Darawsheh, thanks for your input. Our main concern is that crb only support board related operations.
We suppose all NIC special affairs will be handled in nics/related module. 
I think we can also support Mellanox NIC based this concept.

> -----Original Message-----
> From: Raslan Darawsheh [mailto:rasland at mellanox.com]
> Sent: Tuesday, January 19, 2016 5:27 PM
> To: Liu, Yong; Xu, HuilongX; dts at dpdk.org
> Cc: rdarawsheh at asaltech.com; FHamad at asaltech.com; Olga Shern
> Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters and
> check_Mellanox_pci function to identify mellanox device
> 
> Hi,
> The following is a list of incompatibilities of dts:
> 1- when getting the device information - in our CX3 NIC it doesn't have
> Ethernet in it.	 -- pci_devices_information_uncached_linux function.

That's fine, can merged it in.

> 2- Mellanox NIC's don't support NIC binding -- bind_interfaces_linux
DTS can simple skip binding when drivername in execution.cfg is empty.

> 3- For the CX3 NIC it has the same PCI address for the two ports . which
> should change the way of how interface names being retrievrd.

Now all net device object retrieved by GetNicObj function. We can changed this function to return net devices objects list. 
I think it can help on CX3 NIC.

> 4- Mellanox PMD is not enabled by default so I needed to enable it when
> installing DPDK.

It's reasonable to change configurations before validation, I have one idea that enable DTS to change dpdk configuration.
We're still discussion about where to enable it.

> I also added Mellanox in the list of supported NICS. So I have 6 patches :
> 
> [dts] [PATCH 1/6] framework: crb :add some parameters and
> 	check_Mellanox_pci function to identify mellanox device
> [dts] [PATCH 2/6] framework:dut : excluding mellanox NICs from	beeing
> binded
> [dts] [PATCH 3/6] framework:settings :adding new defines for
> 	ConnectX_3_Pro and ConnectX_4 and there drivers
> [dts] [PATCH 4/6] framewark:project_dpdk : Enable MLX4 and MLX5	PMD's
> before compiling and disable binding
> [dts] [PATCH 5/6] framework:net_device : adding function
> 	get_interface_name_Mellanox to get the ConnectX_3_Pro interfaces
> [dts] [PATCH 6/6] framework:tester: adding ConnectX_3_Pro second	port to
> the list of ports
> 
> 
> Kindest regards
> Raslan Darawsheh
> -----Original Message-----
> From: Liu, Yong [mailto:yong.liu at intel.com]
> Sent: Tuesday, January 19, 2016 8:05 AM
> To: Raslan Darawsheh <rasland at mellanox.com>; Xu, HuilongX
> <huilongx.xu at intel.com>; dts at dpdk.org
> Cc: rdarawsheh at asaltech.com
> Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters and
> check_Mellanox_pci function to identify mellanox device
> 
> Hi Darawsheh,
> We have some questions about your patches. In your patch, crb module will
> check whether Mellanox nic on board.
> Crb module focus on board operations in dts design and we do not want to
> involve any NIC concept.
> For those special NICs, we have created one folder named "nics" for place
> special nic modules.
> 
> Could you please list what's the incompatibilities of dts, we hope to
> merge in your patch without change framework design.
> 
> 
> > -----Original Message-----
> > From: dts [mailto:dts-bounces at dpdk.org] On Behalf Of Raslan Darawsheh
> > Sent: Monday, January 18, 2016 7:18 PM
> > To: Xu, HuilongX; dts at dpdk.org
> > Cc: rdarawsheh at asaltech.com
> > Subject: Re: [dts] [PATCH 1/6] framework: crb :add some parameters and
> > check_Mellanox_pci function to identify mellanox device
> >
> > Hi  Xu, HuilongX ,
> >
> > This is  a remainder of my patches to support Mellanox NICs in DTS.
> > What should I be done with them ?
> >
> > Kindest regards
> > Raslan Darawsheh
> >
> > -----Original Message-----
> > From: Raslan Darawsheh
> > Sent: Tuesday, November 10, 2015 8:33 AM
> > To: Xu, HuilongX <huilongx.xu at intel.com>; dts at dpdk.org
> > Cc: rdarawsheh at asaltech.com
> > Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters and
> > check_Mellanox_pci function to identify mellanox device
> >
> > Hi  Xu, HuilongX ,
> >
> > When do you think you will apply the patches?
> >
> > Kindest regards
> > Raslan Darawsheh
> >
> >
> > -----Original Message-----
> > From: Xu, HuilongX [mailto:huilongx.xu at intel.com]
> > Sent: Thursday, October 29, 2015 12:10 PM
> > To: Raslan Darawsheh; dts at dpdk.org
> > Cc: rdarawsheh at asaltech.com
> > Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters and
> > check_Mellanox_pci function to identify mellanox device
> >
> > Hi Darawsheh,
> > I am very sorry, I am too careless.
> > Your changed in function " pci_devices_information_uncached_linux", so
> > it's no problem Thanks a lot
> > > -----Original Message-----
> > > From: Raslan Darawsheh [mailto:rasland at mellanox.com]
> > > Sent: Thursday, October 29, 2015 5:58 PM
> > > To: Xu, HuilongX; dts at dpdk.org
> > > Cc: rdarawsheh at asaltech.com
> > > Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters
> > > and check_Mellanox_pci function to identify mellanox device
> > >
> > > Hi Xu, HuilongX,
> > >
> > > I think you need to double check the patch, since in this patch it
> > > doesn't change anything to this function.
> > >
> > > Kindest regards
> > > Raslan Darawsheh
> > >
> > > -----Original Message-----
> > > From: Xu, HuilongX [mailto:huilongx.xu at intel.com]
> > > Sent: Thursday, October 29, 2015 10:48 AM
> > > To: Raslan Darawsheh <rasland at mellanox.com>; dts at dpdk.org
> > > Cc: rdarawsheh at asaltech.com
> > > Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters
> > > and check_Mellanox_pci function to identify mellanox device
> > >
> > > Hi Darawsheh,
> > > Your changed can't work on FreeBSD OS, but function
> "get_session_output"
> > > in crb.py need work on FreeBSD os.
> > > Thanks a lot
> > >
> > > > -----Original Message-----
> > > > From: Raslan Darawsheh [mailto:rasland at mellanox.com]
> > > > Sent: Thursday, October 29, 2015 4:05 PM
> > > > To: Xu, HuilongX; dts at dpdk.org
> > > > Cc: rdarawsheh at asaltech.com
> > > > Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters
> > > > and check_Mellanox_pci function to identify mellanox device
> > > >
> > > > Hi Xu, HuilongX ,
> > > >
> > > > From what I changed it seems that it's only executed over the linux
> OS.
> > > > And there are an already "lspci" command executed inside the
> function.
> > > > Can you explain more ?
> > > > Kindest regards
> > > > Raslan Darawsheh
> > > >
> > > > -----Original Message-----
> > > > From: Xu, HuilongX [mailto:huilongx.xu at intel.com]
> > > > Sent: Thursday, October 29, 2015 4:01 AM
> > > > To: Raslan Darawsheh <rasland at mellanox.com>; dts at dpdk.org
> > > > Cc: rdarawsheh at asaltech.com
> > > > Subject: RE: [dts] [PATCH 1/6] framework: crb :add some parameters
> > > > and check_Mellanox_pci function to identify mellanox device
> > > >
> > > >
> > > > Hi darawsheh,
> > > > Pls see my comments as below., thanks  a lot
> > > > > -----Original Message-----
> > > > > From: dts [mailto:dts-bounces at dpdk.org] On Behalf Of Raslan
> > > > > Darawsheh
> > > > > Sent: Tuesday, October 27, 2015 2:08 PM
> > > > > To: dts at dpdk.org
> > > > > Cc: rdarawsheh at asaltech.com
> > > > > Subject: [dts] [PATCH 1/6] framework: crb :add some parameters
> > > > > and check_Mellanox_pci function to identify mellanox device
> > > > >
> > > > > From: Raslsn Darawsheh <rdarawsheh at asaltech.com>
> > > > >
> > > > > Signed-off-by: Raslsn Darawsheh <rdarawsheh at asaltech.com>
> > > > > ---
> > > > >  framework/crb.py | 23 ++++++++++++++++++++++-
> > > > >  1 file changed, 22 insertions(+), 1 deletion(-)
> > > > >
> > > > > diff --git a/framework/crb.py b/framework/crb.py index
> > > > > fcbd7d9..0acec3b 100644
> > > > > --- a/framework/crb.py
> > > > > +++ b/framework/crb.py
> > > > > @@ -33,7 +33,7 @@ import time
> > > > >  import dts
> > > > >  import re
> > > > >  import os
> > > > > -from settings import TIMEOUT, IXIA
> > > > > +from settings import TIMEOUT, IXIA, NICS
> > > > >
> > > > >  """
> > > > >  CRB (customer reference board) basic functions and handlers @@
> > > > > -54,6
> > > > > +54,9 @@ class Crb(object):
> > > > >          self.skip_setup = False
> > > > >          self.serializer = serializer
> > > > >          self.ports_info = None
> > > > > +        self.isMellanox = False
> > > > > +        self.mellanoxPortCount = 0
> > > > > +        self.mellanoxCardType = None
> > > > >
> > > > >      def send_expect(self, cmds, expected, timeout=TIMEOUT,
> > > > >                      alt_session=False, verify=False):
> > > > > @@ -79,6 +82,19 @@ class Crb(object):
> > > > >
> > > > >          return self.session.send_command(cmds, timeout)
> > > > >
> > > > > +    def check_Mellanox_pci(self,pci_bus,pci_id):
> > > > > +        """
> > > > > +        check if the PCI is Mellanox device or not
> > > > > +        its used to set a flag to handle Mellanox ports
> differently
> > > > > +        """
> > > > > +        out = self.send_expect("lspci -nn | grep -i "  +
> > > > > + pci_bus, "#
> > > ")
> > > > > +        if "Mell" in out:
> > > > > +            self.isMellanox =True
> > > > > +            if NICS['ConnectX_4'] in out:
> > > > > +                self.mellanoxCardType = "cx4"
> > > > > +            else:
> > > > > +                self.mellanoxCardType = "cx3"
> > > > > +
> > > > >      def get_session_output(self, timeout=TIMEOUT):
> > > > >          """
> > > > >          Get session output message before timeout @@ -196,6
> > > > > +212,11 @@ class Crb(object):
> > > > >          rexp = r"([\da-f]{2}:[\da-f]{2}.\d{1}) .*Eth.*?ernet
> > > > > .*?([\da- f]{4}:[\da-f]{4})"
> > > > >          pattern = re.compile(rexp)
> > > > >          match = pattern.findall(out)
> > > > Could you not changed this function? because it not about dts
> > > > feature It only a ssh session function, when you exec "lspci"
> > > > command, freebsd os not support.
> > > > So some  case will failed on freebesd.
> > > > > +        out = self.send_expect(
> > > > > +                        "lspci -nn ", "# ", alt_session=True)
> > > > > +        rexp = r"([\da-f]{2}:[\da-f]{2}.\d{1}) Network
> > > > > + .*?([\da-
> > > > > f]{4}:[\da-f]{4})"
> > > > > +        pattern = re.compile(rexp)
> > > > > +        match += pattern.findall(out)
> > > > >          self.pci_devices_info = []
> > > > >          for i in range(len(match)):
> > > > >              self.pci_devices_info.append((match[i][0],
> > > > > match[i][1]))
> > > > > --
> > > > > 1.8.3.1



More information about the dts mailing list