From patchwork Wed Aug 23 02:48:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xie RongQiang X-Patchwork-Id: 27734 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 140687CDA; Wed, 23 Aug 2017 04:51:37 +0200 (CEST) Received: from out1.zte.com.cn (out1.zte.com.cn [202.103.147.172]) by dpdk.org (Postfix) with ESMTP id 79FB37CBD for ; Wed, 23 Aug 2017 04:51:34 +0200 (CEST) X-scanvirus: By SEG_CYREN AntiVirus Engine X-scanresult: CLEAN X-MAILFROM: X-RCPTTO: X-FROMIP: 10.30.3.20 X-SEG-Scaned: 1 X-Received: unknown,10.30.3.20,20170823104713 Received: from unknown (HELO mse01.zte.com.cn) (10.30.3.20) by localhost with (AES256-SHA encrypted) SMTP; 23 Aug 2017 02:47:13 -0000 Received: (from root@localhost) by mse01.zte.com.cn id v7N2pSSi009414; Wed, 23 Aug 2017 10:51:28 +0800 (GMT-8) (envelope-from xie.rongqiang@zte.com.cn) Message-Id: <201708230251.v7N2pSSi009414@mse01.zte.com.cn> Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id v7N2mhb8099150; Wed, 23 Aug 2017 10:48:43 +0800 (GMT-8) (envelope-from xie.rongqiang@zte.com.cn) Received: from localhost.localdomain.localdomain ([10.43.166.171]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2017082310484645-555205 ; Wed, 23 Aug 2017 10:48:46 +0800 From: Rongqiang XIE To: bruce.richardson@intel.com Cc: dev@dpdk.org, Rongqiang XIE Date: Wed, 23 Aug 2017 10:48:01 +0800 X-Mailer: git-send-email 1.8.3.1 X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2017-08-23 10:48:46, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2017-08-23 10:48:35, Serialize complete at 2017-08-23 10:48:35 X-MAIL: mse01.zte.com.cn v7N2pSSi009414 X-MSS: AUDITRELEASE@mse01.zte.com.cn X-HQIP: 127.0.0.1 Subject: [dpdk-dev] [PATCH] lib/lib_eal:add mellanox kernel driver type 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" When use bond function in mellanox driver environment, we call the find_port_id_by_pci_addr() function,if we don't add mellanox kernel driver type in enum rte_kernel_driver, the function will return -1 because kdrv unknown, so we add the mellanox driver type, and when scan the pci, fill the kdrv to fix this problem. Signed-off-by: Rongqiang XIE --- lib/librte_eal/common/include/rte_dev.h | 2 ++ lib/librte_eal/linuxapp/eal/eal_pci.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/lib/librte_eal/common/include/rte_dev.h b/lib/librte_eal/common/include/rte_dev.h index 5386d3a..067ad07 100644 --- a/lib/librte_eal/common/include/rte_dev.h +++ b/lib/librte_eal/common/include/rte_dev.h @@ -123,6 +123,8 @@ enum rte_kernel_driver { RTE_KDRV_VFIO, RTE_KDRV_UIO_GENERIC, RTE_KDRV_NIC_UIO, + RTE_KDRV_MLX4, + RTE_KDRV_MLX5, RTE_KDRV_NONE, }; diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c index 8951ce7..31c8ec1 100644 --- a/lib/librte_eal/linuxapp/eal/eal_pci.c +++ b/lib/librte_eal/linuxapp/eal/eal_pci.c @@ -349,6 +349,10 @@ dev->kdrv = RTE_KDRV_IGB_UIO; else if (!strcmp(driver, "uio_pci_generic")) dev->kdrv = RTE_KDRV_UIO_GENERIC; + else if (!strcmp(driver, "mlx4_core")) + dev->kdrv = RTE_KDRV_MLX4; + else if (!strcmp(driver, "mlx5_core")) + dev->kdrv = RTE_KDRV_MLX5; else dev->kdrv = RTE_KDRV_UNKNOWN; } else