DPDK patches and discussions
 help / color / mirror / Atom feed
From: Timothy Redaelli <tredaelli@redhat.com>
To: dev@dpdk.org
Cc: stable@dpdk.org
Subject: [dpdk-dev] [PATCH] usertools: Fix clearing any old data
Date: Fri, 31 May 2019 13:11:26 +0200	[thread overview]
Message-ID: <0c31ecf46994f3c582f14842446c538ebe0622d9.1559301086.git.tredaelli@redhat.com> (raw)

Currently clear_data (dpdk-devbind.py) doesn't work as expected since
"global devices" is missing and so "devices" is considered a local variable.

This commit changes "clear_data" function in order to really clear
devices by adding "global devices".

CC: stable@dpdk.org

Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
---
 usertools/dpdk-devbind.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/usertools/dpdk-devbind.py b/usertools/dpdk-devbind.py
index 9e79f0d28..e6b551d33 100755
--- a/usertools/dpdk-devbind.py
+++ b/usertools/dpdk-devbind.py
@@ -210,6 +210,7 @@ def get_pci_device_details(dev_id, probe_lspci):
 
 def clear_data():
     '''This function clears any old data'''
+    global devices
     devices = {}
 
 def get_device_details(devices_type):
-- 
2.21.0


             reply	other threads:[~2019-05-31 11:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-31 11:11 Timothy Redaelli [this message]
2019-05-31 13:37 ` [dpdk-dev] [dpdk-stable] " Luca Boccassi
2019-06-04  7:20   ` David Marchand
2019-07-04 21:08     ` Thomas Monjalon

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=0c31ecf46994f3c582f14842446c538ebe0622d9.1559301086.git.tredaelli@redhat.com \
    --to=tredaelli@redhat.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    /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).