From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f46.google.com (mail-wm0-f46.google.com [74.125.82.46]) by dpdk.org (Postfix) with ESMTP id E7BEB567E for ; Tue, 27 Jun 2017 18:11:42 +0200 (CEST) Received: by mail-wm0-f46.google.com with SMTP id w126so29207537wme.0 for ; Tue, 27 Jun 2017 09:11:42 -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 :in-reply-to:references; bh=YP98/Fb4yMgO5W0Q4gfrczskwJS4F26har65KsESt+4=; b=VmGB+5kiKpwtuJr5018pw0C9y9dYnRUHeWdVnxA7bpvxhXnRlY9sXXdh5zcq8w4tnR DtvlStaPjZ6ZTA+LSvlRMAWU8UaIZ2R7s/xcfayumVHP/wo9UbKWxXqqz5yKzbR0xoHc 5+U4isL6MpFtGz+A9aDbQmCvmzMZ/0gVYZ3G4YS0YJk3t2FkynuVNpga9IkddBKdlecx oZVNjCg62/DGv5yuVLlVONBwXtjOGYNdppnIZwFxrco4Co2p5OMVf2/gBgoaWQlIMWEI +VdQL/e1URbLyh7LNOgHs9O2sAFJQV0+HNyCTDbkkccU4mP3Z+Qv4e1GP/oPwvkQvodW 3e4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=YP98/Fb4yMgO5W0Q4gfrczskwJS4F26har65KsESt+4=; b=Dycr4K55M0JnOHE452o8eijuLSBokWtcWVGOaEotkdvTkshIuHHDdzloDguf+wWBZW l9x3elP77Xpzqx0gJ4Jk8cZYByquvG/X0S7bmAEiUqWDUEnzulA3QUOWaV0U8dBG9Pq4 x5fcPP+40r43tr++xEcFdptnt7lI9xwJ77fmzhiHNNZe1YDxp2Zlo/R/UhWI/cJ4sc3N pwK8322fNPQi6FV6cZME3DnCkJDNRtV+qrk8EGuRRkWsSKrQYmmdbEhZQSGAZR5Sb9M9 9EKOI7m+Qs225LCjXkqwBvBR3tDttiKUMExcu3XH/Zd3O5F8JWZwE6PE6Nq5M6SE4HQV 2bbg== X-Gm-Message-State: AKS2vOx8d7Gu2EkGT21fd6urmZLWsiXdt8EfukSvzfcfbY9r8wXlx+XM uBUKczCgsAisdFvGCyU= X-Received: by 10.28.35.201 with SMTP id j192mr4209235wmj.103.1498579902084; Tue, 27 Jun 2017 09:11:42 -0700 (PDT) Received: from bidouze.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id v13sm4080465wmd.5.2017.06.27.09.11.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 27 Jun 2017 09:11:41 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Tue, 27 Jun 2017 18:11:15 +0200 Message-Id: <1235be297d11d9d2f589d60455f8ae205cad3923.1498577192.git.gaetan.rivet@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v6 08/11] vdev: use standard bus registration function 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: Tue, 27 Jun 2017 16:11:43 -0000 Signed-off-by: Gaetan Rivet --- lib/librte_eal/common/eal_common_vdev.c | 18 +----------------- lib/librte_eal/common/include/rte_vdev.h | 2 ++ 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/lib/librte_eal/common/eal_common_vdev.c b/lib/librte_eal/common/eal_common_vdev.c index f5c557f..93a0ebe 100644 --- a/lib/librte_eal/common/eal_common_vdev.c +++ b/lib/librte_eal/common/eal_common_vdev.c @@ -54,14 +54,10 @@ static struct vdev_device_list vdev_device_list = struct vdev_driver_list vdev_driver_list = TAILQ_HEAD_INITIALIZER(vdev_driver_list); -static void rte_vdev_bus_register(void); - /* register a driver */ void rte_vdev_register(struct rte_vdev_driver *driver) { - rte_vdev_bus_register(); - TAILQ_INSERT_TAIL(&vdev_driver_list, driver, next); } @@ -400,16 +396,4 @@ static struct rte_bus rte_vdev_bus = { .unplug = vdev_unplug, }; -RTE_INIT(rte_vdev_bus_register); - -static void rte_vdev_bus_register(void) -{ - static int registered; - - if (registered) - return; - - registered = 1; - rte_vdev_bus.name = RTE_STR(virtual); - rte_bus_register(&rte_vdev_bus); -} +RTE_REGISTER_BUS(VIRTUAL_BUS_NAME, rte_vdev_bus); diff --git a/lib/librte_eal/common/include/rte_vdev.h b/lib/librte_eal/common/include/rte_vdev.h index e6b678e..2d02c68 100644 --- a/lib/librte_eal/common/include/rte_vdev.h +++ b/lib/librte_eal/common/include/rte_vdev.h @@ -41,6 +41,8 @@ extern "C" { #include #include +#define VIRTUAL_BUS_NAME "virtual" + struct rte_vdev_device { TAILQ_ENTRY(rte_vdev_device) next; /**< Next attached vdev */ struct rte_device device; /**< Inherit core device */ -- 2.1.4