test suite reviews and discussions
 help / color / mirror / Atom feed
From: Angela Czubak <aczubak@caviumnetworks.com>
To: dts@dpdk.org, "Liu, Yong" <yong.liu@intel.com>
Subject: [dts] Fwd: Re: [PATCH v2 02/28] framework dut and project_dpdk: using correct available binding scripts
Date: Tue, 18 Apr 2017 16:01:28 +0200	[thread overview]
Message-ID: <dcb6d5d0-3ecf-a752-59b5-98bad270f502@caviumnetworks.com> (raw)
In-Reply-To: <789e7895-275d-c674-fac6-47076f8705d3@caviumnetworks.com>

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

           reply	other threads:[~2017-04-18 14:01 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <789e7895-275d-c674-fac6-47076f8705d3@caviumnetworks.com>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dcb6d5d0-3ecf-a752-59b5-98bad270f502@caviumnetworks.com \
    --to=aczubak@caviumnetworks.com \
    --cc=dts@dpdk.org \
    --cc=yong.liu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).