From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <mukawa@igel.co.jp>
Received: from mail-ig0-f181.google.com (mail-ig0-f181.google.com
 [209.85.213.181]) by dpdk.org (Postfix) with ESMTP id E9DD15A55
 for <dev@dpdk.org>; Tue, 24 Feb 2015 15:29:39 +0100 (CET)
Received: by mail-ig0-f181.google.com with SMTP id hn18so27105824igb.2
 for <dev@dpdk.org>; Tue, 24 Feb 2015 06:29:39 -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=9S0x0rMODhmCizSMul+2EFtwRJbgUiwoBxmM8yS0kqM=;
 b=m6LMupq4cJVRn7AOMTZxQZV2wfNm9AigISyG4TEGg+MOWitlBBV4fp58DCcMBKNC0M
 RFpOu8ljrtvYzHNdL1Vb8sV5n/7Vtou8gWpokFapivsS8OCyR7SHdQgeuZHRADOGDjx/
 HYuxu3F9ixmZkFcup7qzX9sbbaIGMUP3zjx8R52JGOB/AqlGroFtD6PsEw1CKIbMxUjl
 4NpDLhgOie2ELJVsyEFawqz1RfqgmghEfbWaVvv3+4lirTESU4fm17C/l0ia6E0DKVVQ
 nM7gn7nJviA+JXtjb76i0jZ4646+gn01Amo5aGmK1Gbo/zdT0tfsMH4hdAJ24C2oBGA4
 khvw==
X-Gm-Message-State: ALoCoQkHC4knEp5/nuA5Y1+R5wdSeZRuIuXl/o6pv/ZIZKz+sO55MC28+mU0StXaCO9koIdFP5Eu
MIME-Version: 1.0
X-Received: by 10.107.130.25 with SMTP id e25mr21272329iod.49.1424788179184;
 Tue, 24 Feb 2015 06:29:39 -0800 (PST)
Received: by 10.64.15.5 with HTTP; Tue, 24 Feb 2015 06:29:39 -0800 (PST)
In-Reply-To: <CAEykdvrsDMMgPYu42v=zpUSe3CTpYo5aJT13dNwK4V3OVdMYYQ@mail.gmail.com>
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>
 <CAEykdvrsDMMgPYu42v=zpUSe3CTpYo5aJT13dNwK4V3OVdMYYQ@mail.gmail.com>
Date: Tue, 24 Feb 2015 23:29:39 +0900
Message-ID: <CAKU8wkd3NFq_pq3Au2JRFSvX_daP4N2qXFZVWmn-hbpHozR_Rg@mail.gmail.com>
From: Tetsuya Mukawa <mukawa@igel.co.jp>
To: Maxime Leroy <maxime.leroy@6wind.com>
Content-Type: text/plain; charset=UTF-8
Cc: "dev@dpdk.org" <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 <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Tue, 24 Feb 2015 14:29:40 -0000

2015-02-24 22:25 GMT+09:00 Maxime Leroy <maxime.leroy@6wind.com>:
> Hi Tetsuya,
>
> On Tue, Feb 24, 2015 at 5:49 AM, Tetsuya Mukawa <mukawa@igel.co.jp> 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.
>

Sure I will.

>> +               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.
>

I will.

>> +               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 ?
>

I need to call some ethdev library APIs like rte_eth_dev_is_detachable().
So rte_ethdev.h is needed to be included.
Also, rte_mbuf.h is included in rte_ethdev.h.
This is because, I need to refer librte_mbuf library also.

I am out of office now, so I will submit new patches tomorrow.

Regards,
Tetsuya


>>  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