From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 89BD8A0542; Mon, 29 Aug 2022 09:58:11 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 505914069D; Mon, 29 Aug 2022 09:58:10 +0200 (CEST) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by mails.dpdk.org (Postfix) with ESMTP id F394C40694 for ; Mon, 29 Aug 2022 09:58:08 +0200 (CEST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 973B25C0053; Mon, 29 Aug 2022 03:58:06 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Mon, 29 Aug 2022 03:58:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; t=1661759886; x= 1661846286; bh=GmInN/TpbbbRGs9hwlHf7XfKCPp0PGhnPDepGKBaISM=; b=R lNa1SJW2qOucwdP7O0Q01xas0dLNtM6+R7c9r/9jzoZMWRYT2oDt7trQad+bLmhO 1W3A31xRTGBOIc8vPsWwhfqdJFJvVdBCV+XltnZq0BN+9CxwvsaC0mSlvI1PNdds F6Zxl2W03BjEDyDXoQ5GSpq9ItwUUAABjINEOjL78TsJOp5pmRrPJfndIM3afqb2 EMIJXUfJlUCPaUsJDX/iO6PqDvLnvdGG5S0Yd/j6kFR+z24uNE5UQCw7CO0/2kWi +uV/ddJ65VSZlb4uoTl/rOIdKQZ3UEMlIwwU29cvTO+eg6riGNtiQTkInuuEM41e CqsIi0pmUeWyukNoQuT3A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1661759886; x= 1661846286; bh=GmInN/TpbbbRGs9hwlHf7XfKCPp0PGhnPDepGKBaISM=; b=R Lo6uIK397v/CR7Ca4WM8iY7Y9i1XxMli+ZgzlozaOtB/dKWpDTmpm2/WDkfZy3eR S0rfJdJxJkARVzdfDpfTgiZrNeppbsXIXfHleK5qRSXKc0LNlDaQa9RQiOWeEP6w WAESvh67kfOE+LCQ8DtqC/lbE0PumPcVnfrtp2izzhCJgCPvj9v98szoe+8tqG56 /sCLMVo/EVqgkiymiigHXkb9tM3XVvfUhl11BMXU65npHCWrTW9tsOsBekgkTLVU TfitZMXgRx5JiAtdxFiEi91m/llMdJo/Ny8nqncElyM1qa9BOBPNIDqCp1agrVVq 3QoR1fFO4VjiH0n14YTlQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvdektddguddvjecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvfevufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhho mhgrshcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqne cuggftrfgrthhtvghrnheptdejieeifeehtdffgfdvleetueeffeehueejgfeuteeftddt ieekgfekudehtdfgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 29 Aug 2022 03:58:05 -0400 (EDT) From: Thomas Monjalon To: Ferruh Yigit , Long Li Cc: David Marchand , "dev@dpdk.org" , Ajay Sharma , Stephen Hemminger , Viacheslav Ovsiienko , Matan Azrad Subject: Re: [Patch v4 01/17] net/mana: add basic driver, build environment and doc Date: Mon, 29 Aug 2022 09:58:03 +0200 Message-ID: <1857175.eGJsNajkDb@thomas> In-Reply-To: References: <1657324171-31369-1-git-send-email-longli@linuxonhyperv.com> <0443d4db-0fe3-60d6-b62f-14976965f1a7@xilinx.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 22/08/2022 20:27, Long Li: > > Subject: Re: [Patch v4 01/17] net/mana: add basic driver, build environment > > and doc > > > > On 8/22/2022 4:03 PM, Ferruh Yigit wrote: > > >> + struct rte_pci_device *pci_dev, > > >> + struct rte_ether_addr *mac_addr) { > > >> + struct ibv_device **ibv_list; > > >> + int ibv_idx; > > >> + struct ibv_context *ctx; > > >> + struct ibv_device_attr_ex dev_attr; > > >> + int num_devices; > > >> + int ret = 0; > > >> + uint8_t port; > > >> + struct mana_priv *priv = NULL; > > >> + struct rte_eth_dev *eth_dev = NULL; > > >> + bool found_port; > > >> + > > >> + ibv_list = ibv_get_device_list(&num_devices); > > >> + for (ibv_idx = 0; ibv_idx < num_devices; ibv_idx++) { > > >> + struct ibv_device *ibdev = ibv_list[ibv_idx]; > > >> + struct rte_pci_addr pci_addr; > > >> + > > >> + DRV_LOG(INFO, "Probe device name %s dev_name %s > > >> ibdev_path %s", > > >> + ibdev->name, ibdev->dev_name, > > >> +ibdev->ibdev_path); > > >> + > > >> + if (mana_ibv_device_to_pci_addr(ibdev, &pci_addr)) > > >> + continue; > > >> + > > >> + /* Ignore if this IB device is not this PCI device */ > > >> + if (pci_dev->addr.domain != pci_addr.domain || > > >> + pci_dev->addr.bus != pci_addr.bus || > > >> + pci_dev->addr.devid != pci_addr.devid || > > >> + pci_dev->addr.function != pci_addr.function) > > >> + continue; > > >> + > > > > > > As far as I understand, intention of this loop is to find 'ibdev' > > > matching this device, code gooes through all "ibv device list" for > > > this, I wonder if there is a easy way for doing this, like a sysfs > > > entry to help getting this information? > > > And how mlx4/5 does this? > > > > Since there are multiple RDMA devices now, does it make sense to have > > RDMA bus driver, which can hide some PCIe details under bus, and driver can > > get PCI and ibdev information during probe? > > Mellanox drivers use a similar way to go through the list of IB devices. > > Matan, Viacheslav, what are your thoughts on implementing a bus for RDMA devices? These are PCI devices first. Is it a good idea to have a bus driver on top of another one? What would be the responsibility of such a bus driver?