Re: [dpdk-dev] How to replace rte_eth_dev_attach with rte_eal_hotplug_add

2018-10-25 Thread Thomas Monjalon
25/10/2018 11:46, Hideyuki Yamashita: > Hi, > > > 25/10/2018 04:54, Hideyuki Yamashita: > > > Hi, > > > > > > > Yes it may work with most of the drivers. > > > Question for my understadnding. > > > You said that most of the drivers assign only one > > > port when hotplug_add is called, right? >

Re: [dpdk-dev] How to replace rte_eth_dev_attach with rte_eal_hotplug_add

2018-10-25 Thread Hideyuki Yamashita
Hi, > 25/10/2018 04:54, Hideyuki Yamashita: > > Hi, > > > > > Yes it may work with most of the drivers. > > Question for my understadnding. > > You said that most of the drivers assign only one > > port when hotplug_add is called, right? > > Then what is the exception? > > What kind of device/d

Re: [dpdk-dev] How to replace rte_eth_dev_attach with rte_eal_hotplug_add

2018-10-24 Thread Thomas Monjalon
25/10/2018 04:54, Hideyuki Yamashita: > Hi, > > > Yes it may work with most of the drivers. > Question for my understadnding. > You said that most of the drivers assign only one > port when hotplug_add is called, right? > Then what is the exception? > What kind of device/driver assign multiple po

Re: [dpdk-dev] How to replace rte_eth_dev_attach with rte_eal_hotplug_add

2018-10-24 Thread Hideyuki Yamashita
Hi, > Yes it may work with most of the drivers. Question for my understadnding. You said that most of the drivers assign only one port when hotplug_add is called, right? Then what is the exception? What kind of device/driver assign multiple ports? My program attach to - vhost pmd - pcap pmd

Re: [dpdk-dev] How to replace rte_eth_dev_attach with rte_eal_hotplug_add

2018-10-23 Thread Thomas Monjalon
Hi, 23/10/2018 03:52, Hideyuki Yamashita: > Hi, > > Thanks for your guidance again. > > Q1. > Is following my understanding correct? > If a device has multiple port, then "rte_eth_dev_get_port_by_name" > will NOT work becauase it uses strcmp and needs "exact match" > of the device name. > New it

Re: [dpdk-dev] How to replace rte_eth_dev_attach with rte_eal_hotplug_add

2018-10-22 Thread Hideyuki Yamashita
Hi, Thanks for your guidance again. Q1. Is following my understanding correct? If a device has multiple port, then "rte_eth_dev_get_port_by_name" will NOT work becauase it uses strcmp and needs "exact match" of the device name. New iterator RTE_ETH_FOREACH_MATCHING_DEV takes care of this issue a

Re: [dpdk-dev] How to replace rte_eth_dev_attach with rte_eal_hotplug_add

2018-10-22 Thread Thomas Monjalon
Hi, The better approach is using RTE_ETH_FOREACH_MATCHING_DEV for 2 reasons: - it is a loop, so work if multiple ports are matching - it uses devargs parameter, which is what the user requests Note: your code assumes that the ethdev name is devargs.name. It can be true by chance,

Re: [dpdk-dev] How to replace rte_eth_dev_attach with rte_eal_hotplug_add

2018-10-22 Thread Hideyuki Yamashita
Hello Thomas, Thanks for your info. What is the difference between using rte_eth_dev_get_port_by_name and RTE_ETH_FOREACH_MATCHING_DEV? I think using rte_eth_dev_get_port_by_name is workable. (In fact I modified my code already and it worked with no problem) So my question is "what is the dif

Re: [dpdk-dev] How to replace rte_eth_dev_attach with rte_eal_hotplug_add

2018-10-21 Thread Thomas Monjalon
Hi, I am actively working on it. Look how rte_eth_dev_attach is replaced in testpmd: https://patches.dpdk.org/patch/47019/ It is using a new ethdev iterator RTE_ETH_FOREACH_MATCHING_DEV. 22/10/2018 06:34, Hideyuki Yamashita: > Dear Thomas and all, > > About a month ago, I posted the top

Re: [dpdk-dev] How to replace rte_eth_dev_attach with rte_eal_hotplug_add

2018-10-21 Thread Hideyuki Yamashita
Dear Thomas and all, About a month ago, I posted the topic related with how to replace rte_eth_dev_attach. Following your advice, my code would be as below: (Old code using deprecated API is commented out) rte_eth_dev_get_port_by_name is used to retrieve dpdk port after rte_eal_hotplug_add. Not

Re: [dpdk-dev] How to replace rte_eth_dev_attach with rte_eal_hotplug_add

2018-09-27 Thread Andrzej Ostruszka
On 27.09.2018 12:40, Hideyuki Yamashita wrote: [...] >>> Is it correct understanding that race condition >>> includes >>> - read information before port is available >>> - other device may be plugged (or unplugged) >>> and so using "eth_dev_last_created_port" is >>> NOT reliable? >> >> I am think

Re: [dpdk-dev] How to replace rte_eth_dev_attach with rte_eal_hotplug_add

2018-09-27 Thread Thomas Monjalon
27/09/2018 12:40, Hideyuki Yamashita: > Dear Thomas, > > Thansk for your answer. > Please see inline. > > > 27/09/2018 03:38, Hideyuki Yamashita: > > > Dear Thomas, > > > > > > Thanks for your answer. > > > It took me a little time to digest answer. > > > Please see inline. > > > > > > > > > >

Re: [dpdk-dev] How to replace rte_eth_dev_attach with rte_eal_hotplug_add

2018-09-27 Thread Hideyuki Yamashita
Dear Thomas, Thansk for your answer. Please see inline. > 27/09/2018 03:38, Hideyuki Yamashita: > > Dear Thomas, > > > > Thanks for your answer. > > It took me a little time to digest answer. > > Please see inline. > > > > > > > 21/09/2018 09:19, Hideyuki Yamashita: > > > > Dear Gaetan and Tho

Re: [dpdk-dev] How to replace rte_eth_dev_attach with rte_eal_hotplug_add

2018-09-27 Thread Thomas Monjalon
27/09/2018 03:38, Hideyuki Yamashita: > Dear Thomas, > > Thanks for your answer. > It took me a little time to digest answer. > Please see inline. > > > > 21/09/2018 09:19, Hideyuki Yamashita: > > > Dear Gaetan and Thomas, > > > > > > Thanks for your answer. > > > Please see inline. > > > > >

Re: [dpdk-dev] How to replace rte_eth_dev_attach with rte_eal_hotplug_add

2018-09-26 Thread Hideyuki Yamashita
Dear Thomas, Thanks for your answer. It took me a little time to digest answer. Please see inline. > 21/09/2018 09:19, Hideyuki Yamashita: > > Dear Gaetan and Thomas, > > > > Thanks for your answer. > > Please see inline. > > > > > 20/09/2018 11:09, Ga?an Rivet: > > > > On Thu, Sep 20, 2018 a

Re: [dpdk-dev] How to replace rte_eth_dev_attach with rte_eal_hotplug_add

2018-09-21 Thread Thomas Monjalon
21/09/2018 09:19, Hideyuki Yamashita: > Dear Gaetan and Thomas, > > Thanks for your answer. > Please see inline. > > > 20/09/2018 11:09, Ga�an Rivet: > > > On Thu, Sep 20, 2018 at 05:46:37PM +0900, Hideyuki Yamashita wrote: > > > > Hello, > > > > > > > > From dpdk 18.08 release rte_eth_dev_atta

Re: [dpdk-dev] How to replace rte_eth_dev_attach with rte_eal_hotplug_add

2018-09-21 Thread Hideyuki Yamashita
Dear Gaetan and Thomas, Thanks for your answer. Please see inline. > 20/09/2018 11:09, Ga枓an Rivet: > > On Thu, Sep 20, 2018 at 05:46:37PM +0900, Hideyuki Yamashita wrote: > > > Hello, > > > > > > From dpdk 18.08 release rte_eth_dev_attach and > > > rte_eth_dev_detach becom deprecated API and

Re: [dpdk-dev] How to replace rte_eth_dev_attach with rte_eal_hotplug_add

2018-09-20 Thread Thomas Monjalon
20/09/2018 11:09, Gaëtan Rivet: > On Thu, Sep 20, 2018 at 05:46:37PM +0900, Hideyuki Yamashita wrote: > > Hello, > > > > From dpdk 18.08 release rte_eth_dev_attach and > > rte_eth_dev_detach becom deprecated API and > > it is recommended to replace with rte_eal_hotplug_add > > and rte_eal_hotplu

Re: [dpdk-dev] How to replace rte_eth_dev_attach with rte_eal_hotplug_add

2018-09-20 Thread Gaëtan Rivet
On Thu, Sep 20, 2018 at 05:46:37PM +0900, Hideyuki Yamashita wrote: > Hello, > > From dpdk 18.08 release rte_eth_dev_attach and > rte_eth_dev_detach becom deprecated API and > it is recommended to replace with rte_eal_hotplug_add > and rte_eal_hotplug_remove. > > My program uses above mentione

[dpdk-dev] How to replace rte_eth_dev_attach with rte_eal_hotplug_add

2018-09-20 Thread Hideyuki Yamashita
Hello, From dpdk 18.08 release rte_eth_dev_attach and rte_eth_dev_detach becom deprecated API and it is recommended to replace with rte_eal_hotplug_add and rte_eal_hotplug_remove. My program uses above mentioned deprecated APIs and have to replace those. Note that my program uses attach to att