[dpdk-dev] examples/vhost: how to use vhost-switch between VMs?

2016-12-23 Thread wang . yong19
Dear Mr. Liu,
  There are some descriptions in 
dpdk-16.11\doc\guides\sample_app_ug\vhost.rst,
"The sample application performs simple packet switching between virtual 
machines based on Media Access Control (MAC) address or Virtual Local Area 

Network (VLAN) tag." So, we runned the vhost-switch sample in a VM with 
three
virtio ports. First, we binded one virtio port to igb_uio. Then we runned 
the command
"./vhost-switch -c f -n 4 --socket-mem 1024 -- --socket-file /tmp/sock0 
�C-vm2vm 1 �C-dequeue-zero-copy"
And then error occured. We found that the 'dev_info.max_vmdq_pools' of the 
virtio
port was 0, and division by zero error occured at the statement 
'queues_per_pool = dev_info.vmdq_queue_num / dev_info.max_vmdq_pools;'
We fixed this by assigning 'queues_per_pool' to 0 if 
'dev_info.max_vmdq_pools'
was 0, but there were still other errors when running vhost-switch. 
  So, we doubted whether we use the vhost-switch in a wrong way. Could you
please give us some advice that how to use the vhost-switch between two or 
more
 VMs?
  I look forward to hearing from you.

 Yours faithfully,
 Yong Wang


[dpdk-dev] examples/vhost: how to use vhost-switch between VMs? Anybody who can help?

2016-12-26 Thread wang . yong19
  There are some descriptions in 
dpdk-16.11\doc\guides\sample_app_ug\vhost.rst,
"The sample application performs simple packet switching between virtual 
machines based on Media Access Control (MAC) address or Virtual Local Area 

Network (VLAN) tag." So, we want to use vhost-switch between two VMs, one 
work as server and another as client.
  We runned the vhost-switch sample in a VM with three virtio ports. 
First, we 
binded one virtio port to igb_uio. Then we runned the command
"./vhost-switch -c f -n 4 --socket-mem 1024 -- --socket-file /tmp/sock0 
�C-vm2vm 1 �C-dequeue-zero-copy"
And then error occured. We found that the 'dev_info.max_vmdq_pools' of the 
virtio
port was 0, and division by zero error occured at the statement 
'queues_per_pool = dev_info.vmdq_queue_num / dev_info.max_vmdq_pools;'
We fixed this by assigning 'queues_per_pool' to 0 if 
'dev_info.max_vmdq_pools'
was 0, but there were still other errors when running vhost-switch. 
  After we fixed all the errors while running vhost-switch as server, we 
didn't
know how to run the vhost-switch as client in another VM, how could the 
client 
get the socket, the netdev and the virtio port that the server 
vhost-switch 
created?
  So, we doubted whether we use the vhost-switch in a wrong way. Could you
please give us some advice that how to use the vhost-switch between two or 
more
 VMs?
  Anybody who can help us with this?



[dpdk-dev] 答复: Re: [PATCH] lib/librte_vhost: fix memory leak

2017-01-03 Thread wang . yong19
> Yuanhan Liu  
> 2017/01/04 12:02
> 
> to
> 
> Yong Wang , 
> 
> cc
> 
> dev@dpdk.org
> 
> subject
> 
> Re: [PATCH] lib/librte_vhost: fix memory leak
> 
> On Tue, Jan 03, 2017 at 10:57:55PM -0500, Yong Wang wrote:
> > In function vhost_new_device(), current code dose not free 'dev'
> > in "i == MAX_VHOST_DEVICE" condition statements. It will lead to a
> > memory leak.
> 
> Nice catch!
> 
> Here are few minor stuff you might need pay attention to for future
> contribution:
> 
> - a fix patch needs a fixline, like following
> 
>   Fixes: 45ca9c6f7bc6 ("vhost: get rid of linked list for devices")
> 
> - the prefix for vhost lib is "vhost: ". And FYI, for PMD drivers, it's
>   'net/PMD_NAME', say 'net/virtio'.
> 
> 
> For you convenience, I have fixed the two while applying. And thanks
> for the fix.
> 
> Applied to dpdk-next-virtio.
> 
>--yliu

Thanks for your advice. 



Re: [dpdk-dev] [PATCH] net/i40e: fix param check to avoid division by 0

2017-06-20 Thread wang . yong19
 > RE: [PATCH] net/i40e: fix param check to avoid division by 0
> 
> 
> 
> > -Original Message-
> > From: Yong Wang [mailto:wang.yon...@zte.com.cn]
> > Sent: Monday, June 12, 2017 5:07 PM
> > To: Zhang, Helin ; Wu, Jingjing 
> 
> > Cc: dev@dpdk.org; Yong Wang 
> > Subject: [PATCH] net/i40e: fix param check to avoid division by 0
> > 
> > In function i40e_vsi_config_tc_queue_mapping(), if 'enabled_tcmap' is
> > 0, 'total_tc' might be 0. Then 'total_tc' might be used in a division
> > by 0 in "qpnum_per_tc = i40e_align_floor(vsi->nb_qps / total_tc)". Fix
> > it by adding a check to parameter 'enabled_tcmap'.
> > 
> > Signed-off-by: Yong Wang 
> > ---
> >  drivers/net/i40e/i40e_ethdev.c | 5 +
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/drivers/net/i40e/i40e_ethdev.c 
b/drivers/net/i40e/i40e_ethdev.c
> > index c18a93b..d41b213 100644
> > --- a/drivers/net/i40e/i40e_ethdev.c
> > +++ b/drivers/net/i40e/i40e_ethdev.c
> > @@ -4257,6 +4257,11 @@ enum i40e_status_code
> > int i, total_tc = 0;
> > uint16_t qpnum_per_tc, bsf, qp_idx;
> > 
> > +   if (enabled_tcmap == 0) {
> > +  PMD_DRV_LOG(ERR, "Error! enabled tcmap shouldn't be 0");
> > +  return I40E_ERR_PARAM;
> > +   }
> > +
> > ret = validate_tcmap_parameter(vsi, enabled_tcmap);
> > if (ret != I40E_SUCCESS)
> >return ret;
> > --
> Thanks for the fix.
> 
> Could you add the check in func validate_tcmap_parameter?
> 
> Thanks
> Jingjing
> 
> 
  Since func validate_tcmap_parameter() was called by 3 func, if I add 
the check to func validate_tcmap_parameter(), I am not sure whether it 
will impact the other two callers who didn't meet division by 0.
  Or should I fix it by changing 'total_tc' from 0 to 1 just as func 
i40e_vsi_update_queue_mapping() does?

Thanks
Yong



[dpdk-dev] 答复: Re: [PATCH] net/ark:add null point check

2017-09-14 Thread wang . yong19
> Ferruh Yigit  
> 2017/09/14 17:33
> 
> to
> 
> Yong Wang , shepard.sie...@atomicrules.com, 
> 
> cc
> 
> dev@dpdk.org
> 
> subject
> 
> Re: [dpdk-dev] [PATCH] net/ark:add null point check
> 
> On 9/14/2017 8:22 AM, Yong Wang wrote:
> > In function ark_config_device(), there are several malloc without null
> > point check. Fix it by adding null point check.
> > 
> > Signed-off-by: Yong Wang 
> 
> Hi Yong,
> 
> Thank you for the patch.
> 
> I think you have sent new version of the patch because previous one was
> giving checkpatch warning, but having two patches with same title is
> being confusing.
> 
> Next time would you mind sending next version as version 2 (v2) and as a
> reply to previous version of the patch? So this makes clear which one is
> the one to take into account.
> Also adding a changelog to the commit log makes life easy. Thanks.
> 
> DPDK Contributor's Guide has more details:
> http://dpdk.org/doc/guides/contributing/patches.html
> 
> Thanks,
> ferruh

Ok. Thanks for your advice.