From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f169.google.com (mail-wi0-f169.google.com [209.85.212.169]) by dpdk.org (Postfix) with ESMTP id 6BD7F5A69 for ; Tue, 24 Feb 2015 14:25:47 +0100 (CET) Received: by mail-wi0-f169.google.com with SMTP id em10so27120652wid.0 for ; Tue, 24 Feb 2015 05:25:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=58o4ZyA2qWFG0zG5v4FUTz7Xvr3fUkXhsiNA8LYVxOg=; b=f0TZguZ3k6oaem2IL+ZUNOD9+Oa1dGBtbAqtJIHtH5ytdCASzTwCFkn4NvlsGZAxIy Dep8iezw1yZ4GPWSfDA3pMb+9+Hc88dUgk9uzOljFYiiEo+PKaszjc9VMZs1SOpEvjr1 yJCPHYw2ntNZOeyNvcpolgUozLHybZhUQAbnc1FhCF8a+2Hi7d9JOKD7lyzKqFof2XsI mqX+pw05igQuoe8UH+nav7+kR/txousS0/KNSmxemCLYunCkJ+dnrGQjB31uAL3OefTM Nm0JXWrHuaSFlNX2MTD8Oa65GEPcyRXOpF8giZq2I7wiCVgwWDrgPk0TlRMHuu7M6AMH mRww== X-Gm-Message-State: ALoCoQn+6b1ATE/wO9qEyqlg9LutLqbIrjdqLOjk25gshQHB20HtfFnae4fhlS4Ycmf3SH+azpY5 MIME-Version: 1.0 X-Received: by 10.194.24.103 with SMTP id t7mr31890265wjf.15.1424784347262; Tue, 24 Feb 2015 05:25:47 -0800 (PST) Received: by 10.194.185.204 with HTTP; Tue, 24 Feb 2015 05:25:47 -0800 (PST) In-Reply-To: <1424753389-29864-13-git-send-email-mukawa@igel.co.jp> References: <1424060073-23484-2-git-send-email-mukawa@igel.co.jp> <1424753389-29864-1-git-send-email-mukawa@igel.co.jp> <1424753389-29864-13-git-send-email-mukawa@igel.co.jp> Date: Tue, 24 Feb 2015 14:25:47 +0100 Message-ID: From: Maxime Leroy To: Tetsuya Mukawa Content-Type: text/plain; charset=UTF-8 Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v13 12/13] 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: Tue, 24 Feb 2015 13:25:47 -0000 Hi Tetsuya, On Tue, Feb 24, 2015 at 5:49 AM, Tetsuya Mukawa wrote: > These functions are used for attaching or detaching a port. [...] > +static int > +rte_eal_vdev_init(const char *name, const char *args) > +{ > + struct rte_driver *driver; > + > + if (name == NULL) > + return -EINVAL; > + > + TAILQ_FOREACH(driver, &dev_driver_list, next) { > + if (driver->type != PMD_VDEV) > + continue; > + > + /* > + * search a driver prefix in virtual device name. > + * For example, if the driver is pcap PMD, driver->name > + * will be "eth_pcap", but "name" will be "eth_pcapN". > + * So use strncmp to compare. > + */ > + if (!strncmp(driver->name, name, strlen(driver->name))) > + return driver->init(name, args); > + } > + > + if (driver == NULL) { This test is not needed anymore. You should remove it. > + RTE_LOG(ERR, EAL, "no driver found for %s\n", name); > + return -EINVAL; > + } > + return 0; > +} [...] > } > + > +/* So far, DPDK hotplug function only supports linux */ > +#ifdef RTE_LIBRTE_EAL_HOTPLUG > +static int > +rte_eal_vdev_uninit(const char *name) > +{ > + struct rte_driver *driver; > + > + if (name == NULL) > + return -EINVAL; > + > + TAILQ_FOREACH(driver, &dev_driver_list, next) { > + if (driver->type != PMD_VDEV) > + continue; > + > + /* > + * search a driver prefix in virtual device name. > + * For example, if the driver is pcap PMD, driver->name > + * will be "eth_pcap", but "name" will be "eth_pcapN". > + * So use strncmp to compare. > + */ > + if (!strncmp(driver->name, name, strlen(driver->name))) > + return driver->uninit(name); > + } > + > + if (driver == NULL) { This test is not needed anymore . You should remove it. > + RTE_LOG(ERR, EAL, "no driver found for %s\n", name); > + return -EINVAL; > + } > + return 0; > +} > + [...] > diff --git a/lib/librte_eal/linuxapp/eal/Makefile b/lib/librte_eal/linuxapp/eal/Makefile > index e117cec..b59b201 100644 > --- 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 to add librte_mbuf into EAL Makefile ? > CFLAGS += -I$(RTE_SDK)/lib/librte_ether > CFLAGS += -I$(RTE_SDK)/lib/librte_ivshmem > CFLAGS += -I$(RTE_SDK)/lib/librte_pmd_ring > diff --git a/lib/librte_eal/linuxapp/eal/eal_pci.c b/lib/librte_eal/linuxapp/eal/eal_pci.c [...] > -- > 1.9.1 > Except these 3 points, ack for this patch. Regards, Maxime