From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 588CFA2EFC for ; Sat, 21 Sep 2019 20:16:35 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BEC1F1ED1D; Sat, 21 Sep 2019 20:16:34 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id E2CDC1C23A for ; Sat, 21 Sep 2019 20:16:32 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x8LIGV8A021973 for ; Sat, 21 Sep 2019 11:16:31 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0818; bh=tMsTeahC1tbQBOr2NbvwrkxqWBwR+zmbHxOmf+fSTCA=; b=KFR1lGWkEqXahQhomE+xsYo4BqBPwxRUm5cnESlfRWkYhMauygtAKEGdLELrCssedB2m TBcdv7A1q8Ds0MAHQ267qqAjQ9Q2st5fM5tMs0mTIgoL4YT2UXzlk8WVaq7wIT8cboam xiawzyHJMyF+4kA4Us4Y4O5Z9p+DvmwVT4IIyqvA5rjUgi1dDQF/n5R906xJwliERW+1 1NBP5ZgOrr39iGa0psmtw3sPFVNC4CsJlz6KTC+WNmfX7soh0ucHgHnrpZmcqCf3p6Fr cf+50g+F3vuMNcC9PQJFoLX/h/cfDfx4oDDl/uRAzeCbCgTQAb63xT14B7EnQb+zKTj1 pA== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0a-0016f401.pphosted.com with ESMTP id 2v5h7q97bg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Sat, 21 Sep 2019 11:16:31 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Sat, 21 Sep 2019 11:16:30 -0700 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Sat, 21 Sep 2019 11:16:30 -0700 Received: from BG-LT7430.marvell.com (unknown [10.28.17.12]) by maili.marvell.com (Postfix) with ESMTP id 60E583F703F; Sat, 21 Sep 2019 11:16:28 -0700 (PDT) From: To: CC: , Pavan Nikhilesh , "Phanendra Vukkisala" Date: Sat, 21 Sep 2019 23:46:26 +0530 Message-ID: <20190921181626.13034-1-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.70,1.0.8 definitions=2019-09-21_08:2019-09-20,2019-09-21 signatures=0 Subject: [dpdk-dev] [PATCH] usertools: enhance device bind script module detection X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Pavan Nikhilesh Some kernel modules have '-' in their name when populated in '/sys/bus/pci/drivers/' where as the kernel always populates '/sys/modules/' with '_'. Replace '-' in module name with '_' to avoid script complaining that module not loaded. Signed-off-by: Phanendra Vukkisala Signed-off-by: Pavan Nikhilesh --- usertools/dpdk-devbind.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/usertools/dpdk-devbind.py b/usertools/dpdk-devbind.py index 7b5cbc12c..b1d149876 100755 --- a/usertools/dpdk-devbind.py +++ b/usertools/dpdk-devbind.py @@ -153,6 +153,9 @@ def check_output(args, stderr=None): def module_is_loaded(module): global loaded_modules + if module == 'vfio_pci': + module = 'vfio-pci' + if loaded_modules: return module in loaded_modules @@ -520,7 +523,7 @@ def bind_all(dev_list, driver, force=False): pass # check if we're attempting to bind to a driver that isn't loaded - if not module_is_loaded(driver): + if not module_is_loaded(driver.replace('-','_')): sys.exit("Error: Driver '%s' is not loaded." % driver) try: -- 2.17.1