From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com [209.85.212.179]) by dpdk.org (Postfix) with ESMTP id 270626949 for ; Thu, 10 Apr 2014 16:53:25 +0200 (CEST) Received: by mail-wi0-f179.google.com with SMTP id z2so5153918wiv.0 for ; Thu, 10 Apr 2014 07:55:02 -0700 (PDT) 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:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=oU/UdqEomRYDsSXDyw8JphkXY+LRZjmI20cnGbvvaik=; b=Pm5LeYGa7YStEoLaKh6xFfRWh0jaqPJQR9mDhqS/+on9l0VFgwwx6JOahT/+YT3TRj 8XIW1sMTxwkLuhOO52y23n7ougKW6ZQDKTAB/IviK4bvmpccCeWpHCbBihwgtdvW/6Or LT3O7fPtE7SnM3w9oe2WXFibzvqz6CPd8os7hT2UMaoBj3/bews3oLt70jsQv9SO7CFx c1Nwmg95NcvEvDZXV7MV1xpYj9shxbwRLTNNXzo40oQPwirVObQ1FfYToMwn+QIPrY4H M/gUBgftcAvFI5gYnbzLIz/fNQvD4Jyd4Pwzk1JeX81nEbc0dsGNbPsn1JqfCyOXPK2s PhsQ== X-Gm-Message-State: ALoCoQkKbI8wlCq/zn80ZAPoWng1ptZG/EJkKaBRxGQRc4ojWR7uNOV/nqMLcwxMq+xJlPoGVuTQ X-Received: by 10.180.87.233 with SMTP id bb9mr15839526wib.10.1397141702156; Thu, 10 Apr 2014 07:55:02 -0700 (PDT) Received: from xps13.localnet (6wind.net2.nerim.net. [213.41.180.237]) by mx.google.com with ESMTPSA id dr2sm7552879wid.2.2014.04.10.07.55.00 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Apr 2014 07:55:01 -0700 (PDT) From: Thomas Monjalon To: Olivier Matz Date: Thu, 10 Apr 2014 07:55:01 -0700 (PDT) Message-ID: <1460632.jOzC6OEr8u@xps13> Organization: 6WIND User-Agent: KMail/4.12.3 (Linux/3.13.7-1-ARCH; KDE/4.12.3; x86_64; ; ) In-Reply-To: <1393608350-4431-8-git-send-email-olivier.matz@6wind.com> References: <1393608350-4431-1-git-send-email-olivier.matz@6wind.com> <1393608350-4431-8-git-send-email-olivier.matz@6wind.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH 07/11] vdev: allow external registration of virtual device 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: Thu, 10 Apr 2014 14:53:25 -0000 2014-02-28 18:25, Olivier Matz: > Instead of having a list of virtual device drivers in EAL code, add an > API to register drivers. Thanks to this change: > - we don't need to reference pmd_ring, pmd_pcap and pmd_xenvirt in EAL code > - it is now possible to provide a virtual device driver as a shared > library. > > The registration is done in an init function flaged with > __attribute__((constructor)). The new convention is to name this > function rte_pmd_xyz_init(). The per-device init function is renamed > rte_pmd_xyz_devinit(). > > By the way the internal PMDs are now also .so/standalone ready. Let's do > it later on. It will be required to ease maintenance. > > Signed-off-by: Olivier Matz > --- a/lib/librte_eal/linuxapp/eal/eal.c > +++ b/lib/librte_eal/linuxapp/eal/eal.c > @@ -1039,10 +1039,8 @@ rte_eal_init(int argc, char **argv) > > rte_eal_mcfg_complete(); > > - if (rte_eal_vdev_init() < 0) > - rte_panic("Cannot init virtual devices\n"); > - > TAILQ_FOREACH(solib, &solib_list, next) { > + RTE_LOG(INFO, EAL, "open shared lib %s\n", solib->name); > solib->lib_handle = dlopen(solib->name, RTLD_NOW); > if ((solib->lib_handle == NULL) && (solib->name[0] != '/')) { > /* relative path: try again with "./" prefix */ > @@ -1054,6 +1052,9 @@ rte_eal_init(int argc, char **argv) > RTE_LOG(WARNING, EAL, "%s\n", dlerror()); > } > > + if (rte_eal_vdev_init() < 0) > + rte_panic("Cannot init virtual devices\n"); > + > RTE_LOG(DEBUG, EAL, "Master core %u is ready (tid=%x)\n", > rte_config.master_lcore, (int)thread_id); > Could you explain this move? It seems allowing vdev as external library. Maybe it should be in another commit. > --- a/lib/librte_pmd_pcap/rte_eth_pcap.h > +++ b/lib/librte_pmd_pcap/rte_eth_pcap.h > @@ -45,8 +45,6 @@ extern "C" { > #undef PCAP_CAN_SEND > #endif > > -#define RTE_ETH_PCAP_PARAM_NAME "eth_pcap" > - > /* struct args_dict is declared in rte_eth_pcap_args_parser.h */ > struct args_dict; > > @@ -64,12 +62,6 @@ int rte_eth_from_pcaps_n_dumpers(pcap_t * const > rx_queues[], const unsigned numa_node, > struct args_dict *dict); > > -/** > - * For use by the EAL only. Called as part of EAL init to set up any dummy > NICs - * configured on command line. > - */ > -int rte_pmd_pcap_init(const char *name, const char *params); > - > #ifdef __cplusplus > } > #endif After having rebased on HEAD, do we still need a header file for pmd_pcap? Thanks -- Thomas