From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f53.google.com (mail-wm0-f53.google.com [74.125.82.53]) by dpdk.org (Postfix) with ESMTP id 8B14E5690 for ; Wed, 20 Apr 2016 14:44:16 +0200 (CEST) Received: by mail-wm0-f53.google.com with SMTP id u206so79459303wme.1 for ; Wed, 20 Apr 2016 05:44:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=1uJ1w9uWHQ5i06omq/Kg5YSkKo/LywxutU6hzD2XlUc=; b=GeKGcM5D8spx2p9/fd92cUr4Njnsn7un3VgxR6u4zrzwopYMg4P/H/NcSH3d3Fxjat w8Fau73C8WxLnjf2iMsIhM5v4k1EFySOIOY6x0mvhTRJcbZ2Km7RxVlhdpvp37lAW19X HaBtEOqqyE7AMkyzbeRxU7YbZOMjJE9ThvxiNi5yMMmVx5Qi9zlkjyWvyZanZStNE1Vb kjAE2s//MtIc78dmsRwcinp4auQxLqoIVuIwGhg3jaBvdHADCx/WAYBoYGPq5UJH8nDW LDH+TDtaQCs4erEGYvup6ak0AANaTvM1/Tlcc9MwlMVc8oncvnSoKv5cZzVwVPWdQmRB CrLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=1uJ1w9uWHQ5i06omq/Kg5YSkKo/LywxutU6hzD2XlUc=; b=I7nb+TimPfQ1RkpBD7BxMZXn1abY6iJkL48Tev4NvRmrR+1Oc8HPBllqgUf0xkljF0 OQALJjzJd6p7zJuZNHrHqEq4RT5mvs8w2oHYVE3Xy5wc8ORvdJTgCAYwOA2Q30A6raPY eXB9ZGuvKm4G0sR2epFv+DaPMt1ETwxuMpd4BmowJVAGBAyAQ3fwSusEEZhk1udrhdOr s/rLiSyPr3q/xKX1Sg73zg7UlHGHepLRTGT3SA8O9MQ+hvbvS3lf/3aDTFjA3KcHOOUw XgaW9CBXER9hQ3T8bXVAyxDunEROZYjPS82G5iKu5JptOOjHExwdrkC1aHyoAmMYXCBU w+Mg== X-Gm-Message-State: AOPr4FVwOkZlxUZkOAx35E5rIFVjREOR0CHuLrZt6824Dd/yS3AIxMY5b1Rxt+Biwc2/T27A X-Received: by 10.194.111.199 with SMTP id ik7mr9659641wjb.150.1461156256394; Wed, 20 Apr 2016 05:44:16 -0700 (PDT) Received: from gloops.dev.6wind.com (144.77.126.78.rev.sfr.net. [78.126.77.144]) by smtp.gmail.com with ESMTPSA id j10sm5428135wjb.46.2016.04.20.05.44.15 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 20 Apr 2016 05:44:15 -0700 (PDT) From: David Marchand To: dev@dpdk.org Cc: thomas.monjalon@6wind.com, stephen@networkplumber.org, bruce.richardson@intel.com, nhorman@tuxdriver.com, pmatilai@redhat.com, christian.ehrhardt@canonical.com Date: Wed, 20 Apr 2016 14:43:55 +0200 Message-Id: <1461156236-25349-13-git-send-email-david.marchand@6wind.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1461156236-25349-1-git-send-email-david.marchand@6wind.com> References: <1453120248-28274-1-git-send-email-david.marchand@6wind.com> <1461156236-25349-1-git-send-email-david.marchand@6wind.com> Subject: [dpdk-dev] [PATCH v3 12/13] drivers: export pci drivers X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Apr 2016 12:44:16 -0000 Signed-off-by: David Marchand --- drivers/net/mlx4/mlx4.c | 1 + drivers/net/mlx5/mlx5.c | 1 + drivers/net/virtio/virtio_ethdev.c | 1 + lib/librte_eal/common/include/rte_pci.h | 7 +++++++ 4 files changed, 10 insertions(+) diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index 0c76e72..14fe9dd 100644 --- a/drivers/net/mlx4/mlx4.c +++ b/drivers/net/mlx4/mlx4.c @@ -5789,6 +5789,7 @@ static struct eth_driver mlx4_driver = { .dev_private_size = sizeof(struct priv) }; +RTE_EAL_PCI_DRIVER_EXPORT(mlx4, mlx4_driver.pci_drv); RTE_INIT(rte_mlx4_pmd_init); static void rte_mlx4_pmd_init(void) diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index f6399fc..975bb3f 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -646,6 +646,7 @@ static struct eth_driver mlx5_driver = { .dev_private_size = sizeof(struct priv) }; +RTE_EAL_PCI_DRIVER_EXPORT(mlx5, mlx5_driver.pci_drv); RTE_INIT(rte_mlx5_pmd_init); static void rte_mlx5_pmd_init(void) diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index ee95cab..587ba60 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -1211,6 +1211,7 @@ static struct eth_driver rte_virtio_pmd = { .dev_private_size = sizeof(struct virtio_hw), }; +RTE_EAL_PCI_DRIVER_EXPORT(virtio, rte_virtio_pmd.pci_drv); RTE_INIT(rte_virtio_pmd_init); static void rte_virtio_pmd_init(void) diff --git a/lib/librte_eal/common/include/rte_pci.h b/lib/librte_eal/common/include/rte_pci.h index 3bb1833..3095f94 100644 --- a/lib/librte_eal/common/include/rte_pci.h +++ b/lib/librte_eal/common/include/rte_pci.h @@ -497,12 +497,19 @@ void rte_eal_pci_dump(FILE *f); void rte_eal_pci_register(struct rte_pci_driver *driver); #define RTE_EAL_PCI_REGISTER(name, d) \ +RTE_EAL_PCI_DRIVER_EXPORT(name, d); \ RTE_INIT(pciinitfn_ ##name); \ static void pciinitfn_ ##name(void) \ { \ rte_eal_pci_register(&d); \ } +#define RTE_EAL_PCI_DRIVER_PREFIX "pcidriver_" + +#define RTE_EAL_PCI_DRIVER_EXPORT(name, d) \ +extern const typeof(d) *pcidriver_ ##name; \ +const typeof(d) *pcidriver_ ##name = &d + /** * Unregister a PCI driver. * -- 1.9.1