From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail04.ics.ntt-tx.co.jp (mail05.ics.ntt-tx.co.jp [210.232.35.69]) by dpdk.org (Postfix) with ESMTP id 89D291B615 for ; Mon, 26 Nov 2018 05:14:08 +0100 (CET) Received: from gwchk03.silk.ntt-tx.co.jp (gwchk03.silk.ntt-tx.co.jp [10.107.0.111]) by mail04.ics.ntt-tx.co.jp (unknown) with ESMTP id wAQ4E6qf024067; Mon, 26 Nov 2018 13:14:06 +0900 Received: (from root@localhost) by gwchk03.silk.ntt-tx.co.jp (unknown) id wAQ4E6vo015036; Mon, 26 Nov 2018 13:14:06 +0900 Received: from gwchk.silk.ntt-tx.co.jp [10.107.0.110] by gwchk03.silk.ntt-tx.co.jp with ESMTP id PAA15035; Mon, 26 Nov 2018 13:14:06 +0900 Received: from imss06.silk.ntt-tx.co.jp (localhost [127.0.0.1]) by ccmail04.silk.ntt-tx.co.jp (unknown) with ESMTP id wAQ4E5EO017625; Mon, 26 Nov 2018 13:14:06 +0900 Received: from imss06.silk.ntt-tx.co.jp (localhost [127.0.0.1]) by imss06.silk.ntt-tx.co.jp (unknown) with ESMTP id wAQ4E5Vu008551; Mon, 26 Nov 2018 13:14:05 +0900 Received: from ccmail04 (smtp03.silk.ntt-tx.co.jp [10.107.0.135]) by imss06.silk.ntt-tx.co.jp (unknown) with SMTP id wAQ4E5V9008548; Mon, 26 Nov 2018 13:14:05 +0900 Date: Mon, 26 Nov 2018 13:12:42 +0900 From: Hideyuki Yamashita In-Reply-To: <6eb5d6a7-af80-1158-f395-c95207634c70@juno.ocn.ne.jp> References: <201811210652.wAL6qKJe011052@imss04.silk.ntt-tx.co.jp> <6eb5d6a7-af80-1158-f395-c95207634c70@juno.ocn.ne.jp> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver. 2.74 [ja] X-CCMail7: CC-Mail-V7.0.2-Client-Relayed Message-Id: <201811260413.wAQ4DjJj017385@ccmail04.silk.ntt-tx.co.jp> X-TM-AS-MML: No X-CC-Mail-RelayStamp: CC-Mail-V5.14-Server To: Yasufumi Ogawa Cc: x-fn-spp@sl.ntt-tx.co.jp, ferruh.yigit@intel.com, ogawa.yasufumi@lab.ntt.co.jp, spp@dpdk.org Subject: Re: [spp] [spp 03664] Re: [PATCH v2 1/6] shared: add dev_attach_by_devargs X-BeenThere: spp@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Soft Patch Panel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Nov 2018 04:14:09 -0000 Hello Yasufumi-san, Thanks for your following comments on 4 patches in my patch set. https://mails.dpdk.org/archives/spp/2018-November/000959.html https://mails.dpdk.org/archives/spp/2018-November/000960.html https://mails.dpdk.org/archives/spp/2018-November/000961.html https://mails.dpdk.org/archives/spp/2018-November/000962.html (It is odd that only one mail received to me.) Anyway, I applogize my mistakes on those. Of cource solution you indicated in above comments are agreeable from my side. It is welcome that you kindly provide updated patch set. I think it is faster and more reliable. Thanks and BR, Hideyuki Yamashita NTT TechnoCross > > SPP uses deprecated APIs removed in DPDK v18.11. Using rte_eth_hotplug_add() > > is recommended instead of rte_eth_dev_attach()[1]. This patch is to add > > dev_attach_by_devargs() to shared directory so that spp_primary, spp_nfv, > > spp_vm and spp_vf can refer this new function. > Hideyuki, > > The number of characters per line should be less than 72. It exceeds the limitation in 1st and 3rd lines. > > Thanks > > > > [1]https://mails.dpdk.org/archives/dev/2018-October/117115.html > > > > Signed-off-by: Hideyuki Yamashita > > Signed-off-by: Naoki Takada > > --- > > src/shared/common.c | 26 ++++++++++++++++++++++++++ > > src/shared/common.h | 17 +++++++++++++++++ > > 2 files changed, 43 insertions(+) > > > > diff --git a/src/shared/common.c b/src/shared/common.c > > index f1754db..c88ce14 100644 > > --- a/src/shared/common.c > > +++ b/src/shared/common.c > > @@ -500,3 +500,29 @@ append_patch_info_json(char *str, > > > return 0; > > } > > + > > +/* attach the new device, then store port_id of the device */ > > +int > > +dev_attach_by_devargs(const char *devargs, uint16_t *port_id) > > +{ > > + int ret = -1; > > + struct rte_devargs da; > > + > > + memset(&da, 0, sizeof(da)); > > + > > + /* parse devargs */ > > + if (rte_devargs_parse(&da, devargs)) > > + return -1; > > + > > + ret = rte_eal_hotplug_add(da.bus->name, da.name, da.args); > > + if (ret < 0) { > > + free(da.args); > > + return ret; > > + } > > + > > + ret = rte_eth_dev_get_port_by_name(da.name, port_id); > > + > > + free(da.args); > > + > > + return ret; > > +} > > diff --git a/src/shared/common.h b/src/shared/common.h > > index a5395aa..60514e5 100644 > > --- a/src/shared/common.h > > +++ b/src/shared/common.h > > @@ -18,7 +18,9 @@ > > #include > > #include > > #include > > +#include > > #include > > +#include > > #include > > #include > > #include > > @@ -217,4 +219,19 @@ int spp_atoi(const char *str, int *val); > > > #define RTE_LOGTYPE_APP RTE_LOGTYPE_USER1 > > > +/** > > + * Attach a new Ethernet device specified by arguments. > > + * > > + * @param devargs > > + * A pointer to a strings array describing the new device > > + * to be attached. The strings should be a pci address like > > + * '0000:01:00.0' or virtual device name like 'net_pcap0'. > > + * @param port_id > > + * A pointer to a port identifier actually attached. > > + * @return > > + * 0 on success and port_id is filled, negative on error > > + */ > > +int > > +dev_attach_by_devargs(const char *devargs, uint16_t *port_id); > > + > > #endif > >