From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-we0-f176.google.com (mail-we0-f176.google.com [74.125.82.176]) by dpdk.org (Postfix) with ESMTP id 76855B598 for ; Thu, 19 Feb 2015 13:10:46 +0100 (CET) Received: by wevk48 with SMTP id k48so6940720wev.0 for ; Thu, 19 Feb 2015 04:10:46 -0800 (PST) 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=Wt4GGsGd3rftJ+cnlsEIwxcQGqrqmLEgq5g+St7icrc=; b=jrRl0l/EZFYWYn85MMKfCdSpLlyj2LpPNJLbdgXndcjTzesVSQuNtZTU4flJSB3B31 ShGoQXpMKziAU2enzUrhIqXKKEADdRSi6PnKdwslhq9L/OCyc89vzD5wd82TXf2twmAD 62nsAaXyXq3u/NgoLPAYr1TmgJOyC+D3FG6+p9Cpso0jVobC/wI+uJNlhvGIf6xaJCZr 0AMU4RBWAu92lDD4LWQm3mB1yxtvkik4OkHKiko4qgWsczxhbGp8wui02nnkyr3esJNM /mjow2t4ouuwasP8+AtOfQc4V12nvGD3ngj5UDEp4C3bQ9w2PWwjPfAtEVXmQ1rNwsPo yMiA== X-Gm-Message-State: ALoCoQkgMMgxWTzSkwuCCfFVfrU/vbmDeU2FcqZqDAMFAEKSnpay2o2i+nsWaoJO6YUXkmtvxsFM X-Received: by 10.194.83.98 with SMTP id p2mr8126302wjy.125.1424347846321; Thu, 19 Feb 2015 04:10:46 -0800 (PST) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by mx.google.com with ESMTPSA id dj4sm37138031wjc.13.2015.02.19.04.10.44 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Feb 2015 04:10:45 -0800 (PST) From: Thomas Monjalon To: Tetsuya Mukawa Date: Thu, 19 Feb 2015 13:10:16 +0100 Message-ID: <10399957.vsF1Tt8fsr@xps13> Organization: 6WIND User-Agent: KMail/4.14.4 (Linux/3.18.4-1-ARCH; KDE/4.14.4; x86_64; ; ) In-Reply-To: <1424314187-25177-14-git-send-email-mukawa@igel.co.jp> References: <1424060073-23484-12-git-send-email-mukawa@igel.co.jp> <1424314187-25177-1-git-send-email-mukawa@igel.co.jp> <1424314187-25177-14-git-send-email-mukawa@igel.co.jp> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v9 13/14] eal/pci: Add rte_eal_dev_attach/detach() functions 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, 19 Feb 2015 12:10:46 -0000 2015-02-19 11:49, Tetsuya Mukawa: > +/* attach the new virtual device, then store port_id of the device */ > +static int > +rte_eal_dev_attach_vdev(const char *vdevargs, uint8_t *port_id) > +{ > + char *args; > + uint8_t new_port_id; > + struct rte_eth_dev devs[RTE_MAX_ETHPORTS]; > + > + if ((vdevargs == NULL) || (port_id == NULL)) > + goto err0; > + > + args = strdup(vdevargs); > + if (args == NULL) > + goto err0; > + > + /* save current port status */ > + if (rte_eth_dev_save(devs, sizeof(devs))) > + goto err1; > + /* add the vdevargs to devargs_list */ > + if (rte_eal_devargs_add(RTE_DEVTYPE_VIRTUAL, args)) > + goto err1; Could you explain why you store devargs in a list? > + /* parse vdevargs, then retrieve device name */ > + get_vdev_name(args); > + /* walk around dev_driver_list to find the driver of the device, > + * then invoke probe function o the driver */ > + if (rte_eal_vdev_find_and_init(args)) TODO: get port_id from init. > + goto err2; > + /* get port_id enabled by above procedures */ > + if (rte_eth_dev_get_changed_port(devs, &new_port_id)) > + goto err2; [...] > --- a/lib/librte_eal/common/include/rte_dev.h > +++ b/lib/librte_eal/common/include/rte_dev.h > @@ -47,6 +47,7 @@ extern "C" { > #endif > > #include > +#include > > /** Double linked list of device drivers. */ > TAILQ_HEAD(rte_driver_list, rte_driver); > @@ -57,6 +58,11 @@ TAILQ_HEAD(rte_driver_list, rte_driver); > typedef int (rte_dev_init_t)(const char *name, const char *args); > > /** > + * Uninitilization function called for each device driver once. > + */ > +typedef int (rte_dev_uninit_t)(const char *name); Why using name as parameter and not port_id? [...] > --- a/lib/librte_eal/linuxapp/eal/Makefile > +++ b/lib/librte_eal/linuxapp/eal/Makefile > @@ -45,6 +45,7 @@ CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common/include > CFLAGS += -I$(RTE_SDK)/lib/librte_ring > CFLAGS += -I$(RTE_SDK)/lib/librte_mempool > CFLAGS += -I$(RTE_SDK)/lib/librte_malloc > +CFLAGS += -I$(RTE_SDK)/lib/librte_mbuf Why do you need mbuf? [...] > --- a/lib/librte_eal/linuxapp/eal/rte_eal_version.map > +++ b/lib/librte_eal/linuxapp/eal/rte_eal_version.map > @@ -21,6 +21,8 @@ DPDK_2.0 { > rte_eal_alarm_cancel; > rte_eal_alarm_set; > rte_eal_dev_init; > + rte_eal_dev_attach; > + rte_eal_dev_detach; Please keep alphabetical order.