* [dts] Fwd: Re: [PATCH v2 02/28] framework dut and project_dpdk: using correct available binding scripts
[not found] <789e7895-275d-c674-fac6-47076f8705d3@caviumnetworks.com>
@ 2017-04-18 14:01 ` Angela Czubak
0 siblings, 0 replies; only message in thread
From: Angela Czubak @ 2017-04-18 14:01 UTC (permalink / raw)
To: dts, Liu, Yong
Hi,
do you want me to change the approach? I could choose the script based
on the rte_version.h, however, right now it seems to be more complicated
as the preprocessor constants' names change with the version (once it
was for instance RTE_VER_MAJOR, RTE_VER_MINOR, RTE_VER_PATCH_LEVEL and
currently it is RTE_VER_YEAR, RTE_VER_MONTH, RTE_VER_MINOR). I do not
use the version number anywhere, just want to find exisiting binding
scripts. Will the knowledge of the version number be useful in the
future? Or is there any other reason to change that piece of code?
Thanks,
Angela
On 17.04.2017 08:35, Liu, Yong wrote:
> Hi Angela,
> I guess you're trying to make DTS compact with different versions of DPDK. Normally we handle that by creating tag on DTS code.
> There's alternative way to do that. We can get dpdk version from rte_version.h and then tools name will be explicit.
>
> Thanks,
> Marvin
>
>
>> -----Original Message-----
>> From: dts [mailto:dts-bounces@dpdk.org] On Behalf Of Angela Czubak
>> Sent: Tuesday, April 11, 2017 1:09 AM
>> To:dts@dpdk.org
>> Cc: Angela Czubak<aczubak@caviumnetworks.com>
>> Subject: [dts] [PATCH v2 02/28] framework dut and project_dpdk: using
>> correct available binding scripts
>>
>> Below patch makes scripts look for correct DPDK binding script,
>> checking whether 'usertools' or 'tools' directory is present and which
>> script exist in 'tools' directory ('dpdk-devbind.py' or
>> 'dpdk_nic_bind.py')
>>
>> Signed-off-by: Angela Czubak <aczubak at caviumnetworks.com>
>> ---
>> framework/dut.py | 21 ++++++++++++++++++---
>> framework/project_dpdk.py | 20 ++++++++++++++++++--
>> 2 files changed, 36 insertions(+), 5 deletions(-)
>>
>> diff --git a/framework/dut.py b/framework/dut.py
>> index 9cbdaf7..4ce5c3a 100644
>> --- a/framework/dut.py
>> +++ b/framework/dut.py
>> @@ -377,8 +377,15 @@ class Dut(Crb):
>> if current_nic == 0:
>> self.logger.info("Not nic need bind driver: %s" % driver)
>> return
>> -
>> - self.send_expect('usertools/dpdk-devbind.py %s' % binding_list,
>> '# ')
>> + op = self.send_command("ls")
>> + if "usertools" in op:
>> + self.send_expect('usertools/dpdk-devbind.py %s' %
>> binding_list, '# ')
>> + else:
>> + op = self.send_command("ls tools")
>> + if "dpdk_nic_bind.py" in op:
>> + self.send_expect('tools/dpdk_nic_bind.py %s' %
>> binding_list, '# ')
>> + else:
>> + self.send_expect('tools/dpdk-devbind.py %s' %
>> binding_list, '# ')
>>
>> def unbind_interfaces_linux(self, nics_to_bind=None):
>> """
>> @@ -402,7 +409,15 @@ class Dut(Crb):
>> self.logger.info("Not nic need unbind driver")
>> return
>>
>> - self.send_expect('usertools/dpdk-devbind.py %s' % binding_list,
>> '# ', 30)
>> + op = self.send_command("ls")
>> + if "usertools" in op:
>> + self.send_expect('usertools/dpdk-devbind.py %s' %
>> binding_list, '# ')
>> + else:
>> + op = self.send_command("ls tools")
>> + if "dpdk_nic_bind.py" in op:
>> + self.send_expect('tools/dpdk_nic_bind.py %s' %
>> binding_list, '# ')
>> + else:
>> + self.send_expect('tools/dpdk-devbind.py %s' %
>> binding_list, '# ')
>>
>> def get_ports(self, nic_type='any', perf=None, socket=None):
>> """
>> diff --git a/framework/project_dpdk.py b/framework/project_dpdk.py
>> index a0cb4c2..50740f8 100644
>> --- a/framework/project_dpdk.py
>> +++ b/framework/project_dpdk.py
>> @@ -314,7 +314,15 @@ class DPDKdut(Dut):
>> binding_list += '%s ' % (port_info['pci'])
>> current_nic += 1
>>
>> - self.send_expect('usertools/dpdk-devbind.py %s' % binding_list,
>> '# ')
>> + op = self.send_command("ls")
>> + if "usertools" in op:
>> + self.send_expect('usertools/dpdk-devbind.py %s' %
>> binding_list, '# ')
>> + else:
>> + op = self.send_command("ls tools")
>> + if "dpdk_nic_bind.py" in op:
>> + self.send_expect('tools/dpdk_nic_bind.py %s' %
>> binding_list, '# ')
>> + else:
>> + self.send_expect('tools/dpdk-devbind.py %s' %
>> binding_list, '# ')
>>
>> def unbind_interfaces_linux(self, nics_to_bind=None):
>> """
>> @@ -329,7 +337,15 @@ class DPDKdut(Dut):
>> binding_list += '%s ' % (port_info['pci'])
>> current_nic += 1
>>
>> - self.send_expect('usertools/dpdk-devbind.py %s' % binding_list,
>> '# ', 30)
>> + op = self.send_command("ls")
>> + if "usertools" in op:
>> + self.send_expect('usertools/dpdk-devbind.py %s' %
>> binding_list, '# ')
>> + else:
>> + op = self.send_command("ls tools")
>> + if "dpdk_nic_bind.py" in op:
>> + self.send_expect('tools/dpdk_nic_bind.py %s' %
>> binding_list, '# ')
>> + else:
>> + self.send_expect('tools/dpdk-devbind.py %s' %
>> binding_list, '# ')
>>
>> def build_dpdk_apps(self, folder, extra_options=''):
>> """
>> --
>> 2.7.4
^ permalink raw reply [flat|nested] only message in thread