[dpdk-dev] tools: fix active interface detection in dpdk-devbind.py
diff mbox

Message ID 1483979853-16386-1-git-send-email-yonig@radcom.com
State Superseded, archived
Headers show

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel compilation success Compilation OK

Commit Message

Yoni Gilad Jan. 9, 2017, 4:37 p.m. UTC
When adding crypto devices, the "Active" and "Ssh_if" attributes of
existing network devices were reset. This causes the follwing issues:

- Network interfaces aren't marked as "*Active*" in the --status output.
- Active network interfaces can be unbound without the --force option,
  causing loss of network connection.

The reset was caused by the call to devices[d].update in
get_crypto_details.

This patch prevents the update on non-crypto devices.

Fixes: cb4a1d1 ("tools: bind crypto devices")

CC: stable@dpdk.org

Signed-off-by: Yoni Gilad <yonig@radcom.com>
---
 usertools/dpdk-devbind.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

Comments

Pablo de Lara Jan. 10, 2017, 9:22 a.m. UTC | #1
> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Yoni Gilad
> Sent: Monday, January 09, 2017 4:38 PM
> To: De Lara Guarch, Pablo; Jain, Deepak K
> Cc: dev@dpdk.org; Yoni Gilad; stable@dpdk.org
> Subject: [dpdk-dev] [PATCH] tools: fix active interface detection in dpdk-
> devbind.py
> 
> When adding crypto devices, the "Active" and "Ssh_if" attributes of
> existing network devices were reset. This causes the follwing issues:
> 
> - Network interfaces aren't marked as "*Active*" in the --status output.
> - Active network interfaces can be unbound without the --force option,
>   causing loss of network connection.
> 
> The reset was caused by the call to devices[d].update in
> get_crypto_details.
> 
> This patch prevents the update on non-crypto devices.
> 
> Fixes: cb4a1d1 ("tools: bind crypto devices")
> 
> CC: stable@dpdk.org
> 
> Signed-off-by: Yoni Gilad <yonig@radcom.com>
> ---
>  usertools/dpdk-devbind.py |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/usertools/dpdk-devbind.py b/usertools/dpdk-devbind.py
> index e057b87..1b9c651 100755
> --- a/usertools/dpdk-devbind.py
> +++ b/usertools/dpdk-devbind.py
> @@ -328,6 +328,9 @@ def get_crypto_details():
> 
>      # based on the basic info, get extended text details
>      for d in devices.keys():
> +        if devices[d]["Class"][0:2] != CRYPTO_BASE_CLASS:
> +            continue
> +
>          # get additional info and add it to existing data
>          devices[d] = devices[d].copy()
>          devices[d].update(get_pci_device_details(d).items())
> --
> 1.7.1

Typo in "follwing". Also, the fixline SHA should be " cb4a1d14bf3e", the first 6 bytes.

Apart from this,

Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

Patch
diff mbox

diff --git a/usertools/dpdk-devbind.py b/usertools/dpdk-devbind.py
index e057b87..1b9c651 100755
--- a/usertools/dpdk-devbind.py
+++ b/usertools/dpdk-devbind.py
@@ -328,6 +328,9 @@  def get_crypto_details():
 
     # based on the basic info, get extended text details
     for d in devices.keys():
+        if devices[d]["Class"][0:2] != CRYPTO_BASE_CLASS:
+            continue
+
         # get additional info and add it to existing data
         devices[d] = devices[d].copy()
         devices[d].update(get_pci_device_details(d).items())