From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f43.google.com (mail-wm0-f43.google.com [74.125.82.43]) by dpdk.org (Postfix) with ESMTP id 439917CC9 for ; Wed, 23 Aug 2017 10:04:35 +0200 (CEST) Received: by mail-wm0-f43.google.com with SMTP id b189so9880170wmd.0 for ; Wed, 23 Aug 2017 01:04:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=H019yEdV4s8Jk4jPxUqa+6IDgcr8dGGAA0q53URqlK8=; b=bytmY+1kE1E4BQquY4vz784o1MailV8pUXthlehd0WdLDKgJbBPkMJJqthysDCjYKt ANXrMSh4GBxJtbsVrFY3cNcaQbEAqy6B9A5Qkz30Vn3cJFFViVLr7T6memFYl77/jFoJ WVy0Nwo3x9HZQe/d5nJC/VfMo6pA+TXOWTnmFd6QNFzpS4ZVceXjmtd6066pZ1+FuFC/ 4yU2MKCpIiC7vWZfc8PfYrXuT0PH71msadtlWnvwHVwLHoTjL8ASQ0VMdJTI6+wrHsad haYW/HJ7IeVLPsTplnM4cf8LhaFP/r83JhhpKHFUhWd5+FSu4sxPDBixxqJrhMMwWWiN ajDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=H019yEdV4s8Jk4jPxUqa+6IDgcr8dGGAA0q53URqlK8=; b=DlTYqEpuDC7sgJRfNywVGZ1rl7dBezImU+aPM00RAddsof7GhPhPvy+Kf0qv+jDzHQ J226sJSXgghY4rBpzdopiUQs0pwRT9TYNzf3ECsOrCryh9fSLGJjxWZhYJweuhWSpjpE KhLdUhIZI5QzfWlVTpeeZoluzA99tRwSIxxbCdUQJeRrvvKHeVpvtahKNYk05wvhvcli ccEBwvw4BZoQSkYKS5eDYJrxvez7DaGjcHbyyds82yKUqR1Da3C0iJnt/USOuYQBR78y SsrnPoKAajS5gy2GR+OuXuXUTzndDRRIANRx3WksS8peHks/7OyZohVQP5lNkS93RdNa 4olQ== X-Gm-Message-State: AHYfb5iJWUrblQet1fMscEcIfZTpl7NEBKZMwtcrCewRSL2491z8KDdS 4mwLIa7skR9FIc1aM/Y= X-Received: by 10.28.218.199 with SMTP id r190mr1221723wmg.88.1503475474649; Wed, 23 Aug 2017 01:04:34 -0700 (PDT) Received: from bidouze.vm.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id u101sm2130637wrc.40.2017.08.23.01.04.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Aug 2017 01:04:33 -0700 (PDT) Date: Wed, 23 Aug 2017 10:04:24 +0200 From: =?iso-8859-1?Q?Ga=EBtan?= Rivet To: Rongqiang XIE Cc: bruce.richardson@intel.com, dev@dpdk.org Message-ID: <20170823080424.GY8124@bidouze.vm.6wind.com> References: <201708230251.v7N2pSSi009414@mse01.zte.com.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <201708230251.v7N2pSSi009414@mse01.zte.com.cn> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [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: , X-List-Received-Date: Wed, 23 Aug 2017 08:04:35 -0000 Hi, On Wed, Aug 23, 2017 at 10:48:01AM +0800, Rongqiang XIE wrote: > 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. > The issue is not that MLX devices are not properly represented, but that the find_port_id_by_pci_addr function has a crappy way to recognize PCI devices. The find_device bus operator should be used to find a device having a specific rte_pci_addr. I described something similar not too long ago[1]. This matching function would benefit from being properly rewritten. [1]: http://dpdk.org/ml/archives/dev/2017-July/072172.html > 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 > -- > 1.8.3.1 > > -- Gaëtan Rivet 6WIND