Re: [dpdk-dev] [PATCH v2 12/12] net/vhost: support to run in the secondary process

2017-10-01 Thread Tan, Jianfeng
On 9/30/2017 7:49 PM, Yuanhan Liu wrote: On Sat, Sep 30, 2017 at 12:06:44PM , Jianfeng Tan wrote: + /* share callfd and kickfd */ + params->type = VHOST_MSG_TYPE_SET_FDS; + vring_num = rte_vhost_get_vring_num(vid); + for (i = 0; i < vring_num; i++) { +

Re: [dpdk-dev] [PATCH v2 12/12] net/vhost: support to run in the secondary process

2017-10-01 Thread Tan, Jianfeng
On 9/30/2017 7:34 PM, Yuanhan Liu wrote: On Thu, Sep 30, 2017 at 12:53:00PM +, Jianfeng Tan wrote: On 9/30/2017 4:23 PM, Yuanhan Liu wrote: On Thu, Sep 28, 2017 at 01:55:59PM +, Jianfeng Tan wrote: +static int new_device(int vid) { struct rte_eth_dev *eth_dev; @@ -610,6

Re: [dpdk-dev] [PATCH v2 12/12] net/vhost: support to run in the secondary process

2017-09-30 Thread Yuanhan Liu
On Sat, Sep 30, 2017 at 12:06:44PM , Jianfeng Tan wrote: > +/* share callfd and kickfd */ > +params->type = VHOST_MSG_TYPE_SET_FDS; > +vring_num = rte_vhost_get_vring_num(vid); > +for (i = 0; i < vring_num; i++) { > +if (r

Re: [dpdk-dev] [PATCH v2 12/12] net/vhost: support to run in the secondary process

2017-09-30 Thread Yuanhan Liu
On Thu, Sep 30, 2017 at 12:53:00PM +, Jianfeng Tan wrote: >On 9/30/2017 4:23 PM, Yuanhan Liu wrote: > > On Thu, Sep 28, 2017 at 01:55:59PM +, Jianfeng Tan wrote: > >> +static int > >> new_device(int vid) > >> { > >>struct rte_eth_dev *eth_dev; > >> @@ -610,6 +685,8 @@ new_device(in

Re: [dpdk-dev] [PATCH v2 12/12] net/vhost: support to run in the secondary process

2017-09-30 Thread Tan, Jianfeng
On 9/30/2017 4:23 PM, Yuanhan Liu wrote: On Thu, Sep 28, 2017 at 01:55:59PM +, Jianfeng Tan wrote: +static int new_device(int vid) { struct rte_eth_dev *eth_dev; @@ -610,6 +685,8 @@ new_device(int vid) _rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_INTR_LSC,

Re: [dpdk-dev] [PATCH v2 12/12] net/vhost: support to run in the secondary process

2017-09-30 Thread Tan, Jianfeng
On 9/30/2017 4:16 PM, Yuanhan Liu wrote: On Sat, Sep 30, 2017 at 12:03:33PM +0800, Tan, Jianfeng wrote: + if (rte_eal_mp_sendmsg("vhost pmd", params, sizeof(*params) + len, To me, it's not a good idea to identify an object by a string. The common practice is to use a handler, which coul

Re: [dpdk-dev] [PATCH v2 12/12] net/vhost: support to run in the secondary process

2017-09-30 Thread Yuanhan Liu
On Thu, Sep 28, 2017 at 01:55:59PM +, Jianfeng Tan wrote: > +static int > new_device(int vid) > { > struct rte_eth_dev *eth_dev; > @@ -610,6 +685,8 @@ new_device(int vid) > _rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_INTR_LSC, > NULL, N

Re: [dpdk-dev] [PATCH v2 12/12] net/vhost: support to run in the secondary process

2017-09-30 Thread Yuanhan Liu
On Sat, Sep 30, 2017 at 12:03:33PM +0800, Tan, Jianfeng wrote: > >>+ if (rte_eal_mp_sendmsg("vhost pmd", params, sizeof(*params) + len, > >To me, it's not a good idea to identify an object by a string. The common > >practice is to use a handler, which could either be a struct or a nubmer. > > My

Re: [dpdk-dev] [PATCH v2 12/12] net/vhost: support to run in the secondary process

2017-09-29 Thread Tan, Jianfeng
Hi Yuanhan, On 9/29/2017 4:28 PM, Yuanhan Liu wrote: On Thu, Sep 28, 2017 at 01:55:59PM +, Jianfeng Tan wrote: static int +share_device(int vid) +{ + uint32_t i, vring_num; + int len; + int fds[8]; + struct rte_vhost_memory *mem; + struct vhost_params *param

Re: [dpdk-dev] [PATCH v2 12/12] net/vhost: support to run in the secondary process

2017-09-29 Thread Yuanhan Liu
On Thu, Sep 28, 2017 at 01:55:59PM +, Jianfeng Tan wrote: > static int > +share_device(int vid) > +{ > + uint32_t i, vring_num; > + int len; > + int fds[8]; > + struct rte_vhost_memory *mem; > + struct vhost_params *params; > + struct rte_vhost_vring vring; > + > +

[dpdk-dev] [PATCH v2 12/12] net/vhost: support to run in the secondary process

2017-09-28 Thread Jianfeng Tan
Support to run vhost-pmd vdev in the secondary process. We obtain information, like memory regions, kickfd, callfd, through primary/secondary communication channel. And by invoking rte_vhost_set_vring_effective_fd, we can set the kickfd which can be recognized by the secondary process. Signed-off