From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aaron Conole Subject: Re: [PATCH 2.3] tools/dpdk_nic_bind.py: Verbosely warn the user on bind Date: Tue, 26 Jan 2016 14:25:48 -0500 Message-ID: References: <1449850823-29017-1-git-send-email-aconole@redhat.com> Mime-Version: 1.0 Content-Type: text/plain To: dev@dpdk.org Return-path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 84AB78E94 for ; Tue, 26 Jan 2016 20:25:49 +0100 (CET) Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 0412532D3CD for ; Tue, 26 Jan 2016 19:25:49 +0000 (UTC) Received: from aconole-fed23 (dhcp-25-194.bos.redhat.com [10.18.25.194]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u0QJPmSR011385 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 26 Jan 2016 14:25:48 -0500 In-Reply-To: <1449850823-29017-1-git-send-email-aconole@redhat.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Ping... This patch has been sitting^Hrotting for a bit over a month. > DPDK ports are only detected during the EAL initialization. After that, any > new DPDK ports which are bound will not be visible to the application. > > The dpdk_nic_bind.py can be a bit more helpful to let users know that DPDK > enabled applications will not find rebound ports until after they have been > restarted. > > Signed-off-by: Aaron Conole > > --- > tools/dpdk_nic_bind.py | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/tools/dpdk_nic_bind.py b/tools/dpdk_nic_bind.py > index f02454e..ca39389 100755 > --- a/tools/dpdk_nic_bind.py > +++ b/tools/dpdk_nic_bind.py > @@ -344,8 +344,10 @@ def bind_one(dev_id, driver, force): > dev["Driver_str"] = "" # clear driver string > > # if we are binding to one of DPDK drivers, add PCI id's to that driver > + bDpdkDriver = False > if driver in dpdk_drivers: > filename = "/sys/bus/pci/drivers/%s/new_id" % driver > + bDpdkDriver = True > try: > f = open(filename, "w") > except: > @@ -371,12 +373,18 @@ def bind_one(dev_id, driver, force): > try: > f.write(dev_id) > f.close() > + if bDpdkDriver: > + print "Device rebound to dpdk driver." > + print "Remember to restart any application that will use this port." > except: > # for some reason, closing dev_id after adding a new PCI ID to new_id > # results in IOError. however, if the device was successfully bound, > # we don't care for any errors and can safely ignore IOError > tmp = get_pci_device_details(dev_id) > if "Driver_str" in tmp and tmp["Driver_str"] == driver: > + if bDpdkDriver: > + print "Device rebound to dpdk driver." > + print "Remember to restart any application that will use this port." > return > print "Error: bind failed for %s - Cannot bind to driver %s" % (dev_id, driver) > if saved_driver is not None: # restore any previous driver