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 1C754A0526; Tue, 21 Jul 2020 11:35:10 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5C08A1BFE7; Tue, 21 Jul 2020 11:35:09 +0200 (CEST) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by dpdk.org (Postfix) with ESMTP id C7C161BFD1 for ; Tue, 21 Jul 2020 11:35:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1595324107; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=/H/QL4oyRIHMispoieqQgj2krVSUoETZA0FqVIEYM3Q=; b=KHjaQjLVwLcWi/A/q+joO9qnY3RRnSd0vjTuZUOWfatZjO2SxChbpd5od/+AP3QtyrA09y B4IA/wA9uv3K1ek4lA8VCT2KlpNKlLcXN1n82RTR3gXyQAXR2l6/uLMtnZqchdEh9XZmtk xHjZPhe8gjTna+iTyxdjNcSdQDRqmpY= Received: from mail-vk1-f198.google.com (mail-vk1-f198.google.com [209.85.221.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-269-RysJInFBMhegsFlGJoU-JQ-1; Tue, 21 Jul 2020 05:35:03 -0400 X-MC-Unique: RysJInFBMhegsFlGJoU-JQ-1 Received: by mail-vk1-f198.google.com with SMTP id n133so8096317vkc.14 for ; Tue, 21 Jul 2020 02:35:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/H/QL4oyRIHMispoieqQgj2krVSUoETZA0FqVIEYM3Q=; b=YosP7ochiiLuhHHQR/MZU9CtFwKHVnJJ4EGZM2UZETxFcxJEdU/CvZrzpZpxzbDr8r ZLVjGVXsU/E2TXzTe6q/CkFZU0eYzPbKJrN5Ad2Qdn3it++ri1hcWrffHAxiRoT+Ean9 p3nbNko3l3AhQD7mxON5OETHVYsw1Nuo/Sc/3aHoqPu7EaNbuPhRNknsXo/jjUO/9erj HX07KbLG/5WZ8W5Kn/Wy//6BQgFA8rcDvkHHSfvzdeRBsESBofzw97MS5NgovEOqYqU0 K+xH+WyxuMYbG1NPhOBuv00YOZcb7qnFFh8Yi3cleivovR1G1zYmzSxa/AO97/8W3KsL j36g== X-Gm-Message-State: AOAM532xqpP0Lul/MwTCnQpeDVQF+jpmXQR5ZE99oQuivjCy48GjQ5T4 fFpAq9pPDYSYc93cu3WuswuKnAtYDt358qbTkUosYbRDpmCm1WXBpLhHHl0igeFuPPhULh0G9MX oKcFAoKXWdBuNN6q/vAY= X-Received: by 2002:a1f:acc2:: with SMTP id v185mr19171266vke.18.1595324103216; Tue, 21 Jul 2020 02:35:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVAJEB/cfqMjiqZvJqWfSBLmKxnusKlSljzyLLd9epLf5SKwrzhLjngjqg8qrSo0NNdnPXetdE/GQ7llfJ5Uc= X-Received: by 2002:a1f:acc2:: with SMTP id v185mr19171242vke.18.1595324102912; Tue, 21 Jul 2020 02:35:02 -0700 (PDT) MIME-Version: 1.0 References: <20200610171728.89-2-parav@mellanox.com> <20200717134924.922390-3-parav@mellanox.com> <2791231.CMBUAsGlKG@thomas> In-Reply-To: From: David Marchand Date: Tue, 21 Jul 2020 11:34:51 +0200 Message-ID: To: Ori Kam Cc: Thomas Monjalon , Parav Pandit , Ferruh Yigit , dev , Gaetan Rivet , Raslan Darawsheh , Matan Azrad , Joyce Kong X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v7 2/9] eal: introduce RTE common initialization level 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" On Mon, Jul 20, 2020 at 9:30 PM Ori Kam wrote: > > net and vdpa code expect the common code being initialised. > > It is a dependency internal to mlx5 drivers, I see nothing generic. > > > First the idea was to declare a new bus not a PMD. > The issue is not from common code but from loading more than one > device on the same PCI. > So the logic is Mellanox PMD are registering to the new bus, the new bus > register to the PCI one. - Is there a problem with the snippet I sent yesterday that removes the COMMON priority? - Currently in the main branch, the net/mlx5 driver is a pci driver registered to the pci bus driver. This registration happens in a constructor which puts the net/mlx5 pci driver struct (with a populated id map) into the pci driver list. Later (out of constructor context), a probe on the pci bus uses this driver list. A new pci driver is introduced by Mellanox to solve resources dispatching between mlx5 drivers. I'd rather not call this new pci driver a bus, it is not registered as such (no rte_bus object) => no reason its constructor should be called from the RTE_PRIO_BUS priority. This driver not being a bus, I would not put it in drivers/bus/, rather in the common code. If there is a build dependency issue with the pci bus driver, you can probably use the trick from qat (https://git.dpdk.org/dpdk/tree/drivers/Makefile#n17) and write an explicit dependency in drivers/Makefile. meson should be just fine. net/mlx5 and vdpa/mlx5 are not classes => no reason their constructor should be called from the RTE_PRIO_CLASS priority. The only classes we have are ethdev and vdpa. The new pci driver simply serves as a proxy for mlx5 net and vdpa drivers. >From what I see, the new pci driver constructs its pci device id map/drv_flags when registering to the pci bus driver based on what mlx5 net and vdpa drivers registered before. This is where a dependency was created. You can move the id_table/drv_flags construction from RTE_INIT(mlx5_bus_pci) to rte_mlx5_pci_register() itself. This way, net/mlx5 and vdpa/mlx5 will pass their id_map to the mlx5 pci driver whether it is registered to the pci bus or not yet. -- David Marchand