DPDK patches and discussions
 help / color / mirror / Atom feed
From: "De Lara Guarch, Pablo" <pablo.de.lara.guarch@intel.com>
To: "Breen, Eoin" <eoin.breen@intel.com>,
	"Jain, Deepak K" <deepak.k.jain@intel.com>,
	"Trahe, Fiona" <fiona.trahe@intel.com>,
	"Griffin, John" <john.griffin@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, "Breen, Eoin" <eoin.breen@intel.com>
Subject: Re: [dpdk-dev] [PATCH v2] tools: add crypto device details
Date: Tue, 13 Sep 2016 22:50:29 +0000	[thread overview]
Message-ID: <E115CCD9D858EF4F90C690B0DCB4D8973C9E4797@IRSMSX108.ger.corp.intel.com> (raw)
In-Reply-To: <1472133122-77377-1-git-send-email-eoin.breen@intel.com>


> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Eoin Breen
> Sent: Thursday, August 25, 2016 6:52 AM
> To: Jain, Deepak K; Trahe, Fiona; Griffin, John
> Cc: dev@dpdk.org; Breen, Eoin
> Subject: [dpdk-dev] [PATCH v2] tools: add crypto device details
> 
> Adding the support to bind/unbind crypto devices with
> dpdk-devbind.py script, as now it is not restricted
> to network devices anymore.
> 
> Signed-off-by: Eoin Breen <eoin.breen@intel.com>
> ---
> Changes since v1:
> * Resolved coding issues
> 
>  tools/dpdk-devbind.py | 107
> ++++++++++++++++++++++++++++++++++++++++++++++----
>  1 file changed, 99 insertions(+), 8 deletions(-)
> 
> diff --git a/tools/dpdk-devbind.py b/tools/dpdk-devbind.py
> index b69ca2a..c7576b9 100755
> --- a/tools/dpdk-devbind.py
> +++ b/tools/dpdk-devbind.py

...

> +    # check what is the interface if any for an ssh connection if
> +    # any to this host, so we can mark it later.
> +    ssh_if = []
> +    route = check_output(["ip", "-o", "route"])
> +    # filter out all lines for 169.254 routes
> +    route = "\n".join(filter(lambda ln: not ln.startswith("169.254"),
> +                             route.decode().splitlines()))
> +    rt_info = route.split()
> +    for i in range(len(rt_info) - 1):
> +        if rt_info[i] == "dev":
> +            ssh_if.append(rt_info[i+1])

This is relevant only to network devices, so it should not be included here.
> +
> +    # based on the basic info, get extended text details
> +    for d in devices.keys():
> +        # get additional info and add it to existing data
> +        devices[d] = devices[d].copy()
> +        devices[d].update(get_pci_device_details(d).items())
> +
> +        for _if in ssh_if:
> +            if _if in devices[d]["Interface"].split(","):
> +                devices[d]["Ssh_if"] = True
> +                devices[d]["Active"] = "*Active*"
> +                break

Same here.

> +
> +        # add igb_uio to list of supporting modules if needed
> +        if "Module_str" in devices[d]:
> +            for driver in dpdk_drivers:
> +                if driver not in devices[d]["Module_str"]:
> +                    devices[d]["Module_str"] = \
> +                        devices[d]["Module_str"] + ",%s" % driver
> +        else:
> +            devices[d]["Module_str"] = ",".join(dpdk_drivers)
> +
> +        # make sure the driver and module strings do not have any duplicates
> +        if has_driver(d):
> +            modules = devices[d]["Module_str"].split(",")
> +            if devices[d]["Driver_str"] in modules:
> +                modules.remove(devices[d]["Driver_str"])
> +                devices[d]["Module_str"] = ",".join(modules)
> +
> +
>  def dev_id_from_dev_name(dev_name):
>      '''Take a device "name" - a string passed in by user to identify a NIC
>      device, and determine the device id - i.e. the domain:bus:slot.func - for
> @@ -480,15 +546,16 @@ def show_status():
>      dpdk_drv = []
>      no_drv = []
> 
> -    # split our list of devices into the three categories above
> +    # split our list of network devices into the three categories above
>      for d in devices.keys():
> -        if not has_driver(d):
> -            no_drv.append(devices[d])
> -            continue
> -        if devices[d]["Driver_str"] in dpdk_drivers:
> -            dpdk_drv.append(devices[d])
> -        else:
> -            kernel_drv.append(devices[d])
> +        if (NETWORK_BASE_CLASS in devices[d]["Class"]):
> +            if not has_driver(d):
> +                no_drv.append(devices[d])
> +                continue
> +            if devices[d]["Driver_str"] in dpdk_drivers:
> +                dpdk_drv.append(devices[d])
> +            else:
> +                kernel_drv.append(devices[d])
> 
>      # print each category separately, so we can clearly see what's used by
> DPDK
>      display_devices("Network devices using DPDK-compatible driver",
> dpdk_drv,
> @@ -498,6 +565,28 @@ def show_status():
>                      "unused=%(Module_str)s %(Active)s")
>      display_devices("Other network devices", no_drv,
> "unused=%(Module_str)s")
> 
> +    # split our list of crypto devices into the three categories above
> +    kernel_drv = []
> +    dpdk_drv = []
> +    no_drv = []
> +
> +    for d in devices.keys():
> +        if (CRYPTO_BASE_CLASS in devices[d]["Class"]):
> +            if not has_driver(d):
> +                no_drv.append(devices[d])
> +                continue
> +            if devices[d]["Driver_str"] in dpdk_drivers:
> +                dpdk_drv.append(devices[d])
> +            else:
> +                kernel_drv.append(devices[d])
> +
> +    display_devices("Crypto devices using DPDK-compatible driver",
> dpdk_drv,
> +                    "drv=%(Driver_str)s unused=%(Module_str)s")
> +    display_devices("Crypto devices using kernel driver", kernel_drv,
> +                    "if=%(Interface)s drv=%(Driver_str)s "
> +                    "unused=%(Module_str)s %(Active)s")
> +    display_devices("Other crypto devices", no_drv,
> "unused=%(Module_str)s")
> +
> 
>  def parse_args():
>      '''Parses the command-line arguments given by the user and takes the
> @@ -562,6 +651,7 @@ def do_arg_actions():
>      if status_flag:
>          if b_flag is not None:
>              get_nic_details()  # refresh if we have changed anything
> +            get_crypto_details()  # refresh if we have changed anything
>          show_status()
> 
> 
> @@ -570,6 +660,7 @@ def main():
>      parse_args()
>      check_modules()
>      get_nic_details()
> +    get_crypto_details()
>      do_arg_actions()
> 
>  if __name__ == "__main__":
> --
> 2.5.5
> 

  parent reply	other threads:[~2016-09-13 22:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-25 10:04 [dpdk-dev] [PATCH] " Eoin Breen
2016-08-25 10:32 ` Mcnamara, John
2016-08-25 13:52 ` [dpdk-dev] [PATCH v2] " Eoin Breen
2016-08-25 20:31   ` Jain, Deepak K
2016-09-13 22:50   ` De Lara Guarch, Pablo [this message]
2016-09-15 23:57   ` [dpdk-dev] [PATCH v3] " Pablo de Lara
2016-09-20  0:05     ` [dpdk-dev] [PATCH v4] " Pablo de Lara
2016-09-21 10:04       ` Jain, Deepak K
2016-09-21 18:56         ` De Lara Guarch, Pablo

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=E115CCD9D858EF4F90C690B0DCB4D8973C9E4797@IRSMSX108.ger.corp.intel.com \
    --to=pablo.de.lara.guarch@intel.com \
    --cc=deepak.k.jain@intel.com \
    --cc=dev@dpdk.org \
    --cc=eoin.breen@intel.com \
    --cc=fiona.trahe@intel.com \
    --cc=john.griffin@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).