From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f51.google.com (mail-pa0-f51.google.com [209.85.220.51]) by dpdk.org (Postfix) with ESMTP id 888505697 for ; Fri, 7 Aug 2015 04:26:02 +0200 (CEST) Received: by pabyb7 with SMTP id yb7so44101270pab.0 for ; Thu, 06 Aug 2015 19:26:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=KAKPshbPuIqQ9qjFzSeV1pBvCFyFHrOtNQUBTs+f3kQ=; b=aP7irqNflpKl4gToRI6lLOhDqPoqvREO6osDGDBIKIg4i+2SUDwI9Wp31BmMTxqqtx 8AfML9jQvZX2dsibyYki9B86uRafTh34ACOg0BJKUS2F912McvfuccasRE7Qt2+r/8+p ANxOySKkOPoL3Vl7+jvr1uRS63VahasPg9LubE0YXwcDcXycKstsQH4My8y4jsgMHBTs RoOK81iMBIFsk9OcZySzZF+9WCURdPK5foQwQdm4st0uqYKMqTZ5t/Uzfn8jNpEcls2W arKWv6PBV9/23b1iNHU1+Kmk+ufe8kQ9Vq3m7EOgjjrNL9NVoh5Xz1lvzVrnEBKx5BfY MX1g== X-Gm-Message-State: ALoCoQlVH8g48m1dFb6nBDWIXEbZqlytxEWsQtJ/7invrcdlbq8NQYOlLvnMslpAiiJbDhaYEmaj X-Received: by 10.66.144.40 with SMTP id sj8mr9429291pab.55.1438914361724; Thu, 06 Aug 2015 19:26:01 -0700 (PDT) Received: from [10.16.129.101] (napt.igel.co.jp. [219.106.231.132]) by smtp.googlemail.com with ESMTPSA id or7sm8074982pdb.9.2015.08.06.19.25.59 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Aug 2015 19:26:00 -0700 (PDT) Message-ID: <55C41735.1030405@igel.co.jp> Date: Fri, 07 Aug 2015 11:25:57 +0900 From: Tetsuya Mukawa User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Ravi Kerur , dev@dpdk.org, Thomas Monjalon References: <1438884241-15599-1-git-send-email-rkerur@gmail.com> In-Reply-To: <1438884241-15599-1-git-send-email-rkerur@gmail.com> Content-Type: text/plain; charset=iso-2022-jp Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v1] Change rte_eal_vdev_init to update port_id 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: Fri, 07 Aug 2015 02:26:03 -0000 On 2015/08/07 3:04, Ravi Kerur wrote: > diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c > index 8280cea..472ef5a 100644 > --- a/drivers/net/enic/enic_ethdev.c > +++ b/drivers/net/enic/enic_ethdev.c > @@ -36,8 +36,8 @@ > #include > #include > > -#include > #include > +#include > #include > #include Hi Ravi, Do we need this fixing? > > diff --git a/drivers/net/mpipe/mpipe_tilegx.c b/drivers/net/mpipe/mpipe_tilegx.c > index 743feef..6e3e304 100644 > --- a/drivers/net/mpipe/mpipe_tilegx.c > +++ b/drivers/net/mpipe/mpipe_tilegx.c > @@ -1582,6 +1582,7 @@ rte_pmd_mpipe_devinit(const char *ifname, > if (!eth_dev) { > RTE_LOG(ERR, PMD, "%s: Failed to allocate device.\n", ifname); > rte_free(priv); > + return -ENOMEM; How about separating this fixing from the patch, and put it as an one of cleanup patch series? > } > > RTE_LOG(INFO, PMD, "%s: Initialized mpipe device" > diff --git a/lib/librte_eal/common/eal_common_dev.c b/lib/librte_eal/common/eal_common_dev.c > index 4089d66..82d5693 100644 > --- a/lib/librte_eal/common/eal_common_dev.c > +++ b/lib/librte_eal/common/eal_common_dev.c > > RTE_LOG(ERR, EAL, "no driver found for %s\n", name); > @@ -94,6 +99,7 @@ rte_eal_dev_init(void) > { > struct rte_devargs *devargs; > struct rte_driver *driver; > + uint8_t port_id; > > /* > * Note that the dev_driver_list is populated here > @@ -108,7 +114,7 @@ rte_eal_dev_init(void) > continue; > > if (rte_eal_vdev_init(devargs->virtual.drv_name, > - devargs->args)) { > + devargs->args, &port_id)) { After this line, 'port_id' is actually not used by anywhere in this function. Also, I guess we will not use port_id in this function in the future. How about fixing rte_eal_vdev_init() to handle NULL value correctly to remove port_id from this function? But I agree your current implementation is also one of choice. > diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c > index 5fe1906..355d709 100644 > --- a/lib/librte_ether/rte_ethdev.c > +++ b/lib/librte_ether/rte_ethdev.c > +int > +rte_eth_dev_get_port_by_addr(const struct rte_pci_addr *addr, uint8_t *port_id) > +{ > + int i; > + struct rte_pci_device *pci_dev = NULL; > + > + if (addr == NULL || port_id == NULL) { > + PMD_DEBUG_TRACE("Null pointer is specified\n"); > + return -EINVAL; > + } > + > + *port_id = RTE_MAX_ETHPORTS; > + > + for (i = 0; i < RTE_MAX_ETHPORTS; i++) { > + > + pci_dev = rte_eth_devices[i].pci_dev; > + > + if (pci_dev != NULL && > + pci_dev->addr.domain == addr->domain && > + pci_dev->addr.bus == addr->bus && > + pci_dev->addr.devid == addr->devid && > + pci_dev->addr.function == addr->function) { You can use rte_eal_compare_pci_addr() here. > + > + *port_id = i; > + return 0; > + } > + } > + return -ENODEV; > +} > diff --git a/lib/librte_ether/rte_ether_version.map b/lib/librte_ether/rte_ether_version.map > index 8345a6c..3d5cb23 100644 > --- a/lib/librte_ether/rte_ether_version.map > +++ b/lib/librte_ether/rte_ether_version.map > @@ -125,5 +125,7 @@ DPDK_2.1 { > rte_eth_timesync_enable; > rte_eth_timesync_read_rx_timestamp; > rte_eth_timesync_read_tx_timestamp; > + rte_eth_dev_get_port_by_name; > + rte_eth_dev_get_port_by_addr; > > } DPDK_2.0; Hi Thomas, Could you please make sure API consistency? Is it ok to add above functions to DPDK_2.1 even though we are in RC phase, or need to add to DPDK_2.2? Thanks, Tetsuya