Re: [ovs-dev] [PATCH 2/4] datapath: Limits the number of tx/rx queues for netdev-dummy.

2017-01-09 Thread nickcooper-zhangtonghao
Thanks, I got it. :)


> On Jan 10, 2017, at 10:11 AM, Daniele Di Proietto  wrote:
> 
> 2017-01-08 20:02 GMT-08:00 nickcooper-zhangtonghao  >:
>> Thanks Daniele,
>> Yes, it’s a small improvement. but it is necessary for us. I will check it
>> in
>> set_config(). One question to ask: should we check the tx/rx queue for
>> netdev-dpdk in set_config()?
> 
> I think for DPDK devices ultimately there's no way to check without
> actually setting up the queues, that's why it's done in reconfigure().
> 
> Thanks,
> 
> Daniele

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH 2/4] datapath: Limits the number of tx/rx queues for netdev-dummy.

2017-01-09 Thread Daniele Di Proietto
2017-01-08 20:02 GMT-08:00 nickcooper-zhangtonghao :
> Thanks Daniele,
> Yes, it’s a small improvement. but it is necessary for us. I will check it
> in
> set_config(). One question to ask: should we check the tx/rx queue for
> netdev-dpdk in set_config()?

I think for DPDK devices ultimately there's no way to check without
actually setting up the queues, that's why it's done in reconfigure().

Thanks,

Daniele

>
> Now we check it in dpdk_eth_dev_init().
>
> Thanks.
>
>
>
> On Jan 9, 2017, at 11:22 AM, Daniele Di Proietto 
> wrote:
>
> 2017-01-08 17:30 GMT-08:00 nickcooper-zhangtonghao :
>
> This patch avoids the ovs_rcu to report WARN, caused by blocked
> for a long time, when ovs-vswitchd processes a port with many
> rx/tx queues. The number of tx/rx queues per port may be appropriate,
> because the dpdk uses it as an default max value.
>
> Signed-off-by: nickcooper-zhangtonghao 
>
>
> I don't think this is a big deal, since netdev-dummy is only used for
> testing, but don't you think it's better to check it in set_config()
> and return an error?
>
> Also, could you use the prefix netdev-dummy, instead of datapath?
>
> Thanks,
>
> Daniele
>
>
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH 2/4] datapath: Limits the number of tx/rx queues for netdev-dummy.

2017-01-08 Thread nickcooper-zhangtonghao
Thanks Daniele,
Yes, it’s a small improvement. but it is necessary for us. I will check it in 
set_config(). One question to ask: should we check the tx/rx queue for 
netdev-dpdk in set_config()?

Now we check it in dpdk_eth_dev_init().

Thanks.



> On Jan 9, 2017, at 11:22 AM, Daniele Di Proietto  wrote:
> 
> 2017-01-08 17:30 GMT-08:00 nickcooper-zhangtonghao  >:
>> This patch avoids the ovs_rcu to report WARN, caused by blocked
>> for a long time, when ovs-vswitchd processes a port with many
>> rx/tx queues. The number of tx/rx queues per port may be appropriate,
>> because the dpdk uses it as an default max value.
>> 
>> Signed-off-by: nickcooper-zhangtonghao > >
> 
> I don't think this is a big deal, since netdev-dummy is only used for
> testing, but don't you think it's better to check it in set_config()
> and return an error?
> 
> Also, could you use the prefix netdev-dummy, instead of datapath?
> 
> Thanks,
> 
> Daniele

___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH 2/4] datapath: Limits the number of tx/rx queues for netdev-dummy.

2017-01-08 Thread Daniele Di Proietto
2017-01-08 17:30 GMT-08:00 nickcooper-zhangtonghao :
> This patch avoids the ovs_rcu to report WARN, caused by blocked
> for a long time, when ovs-vswitchd processes a port with many
> rx/tx queues. The number of tx/rx queues per port may be appropriate,
> because the dpdk uses it as an default max value.
>
> Signed-off-by: nickcooper-zhangtonghao 

I don't think this is a big deal, since netdev-dummy is only used for
testing, but don't you think it's better to check it in set_config()
and return an error?

Also, could you use the prefix netdev-dummy, instead of datapath?

Thanks,

Daniele

> ---
>  lib/netdev-dummy.c | 7 +--
>  1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/lib/netdev-dummy.c b/lib/netdev-dummy.c
> index d406cbc..d75e597 100644
> --- a/lib/netdev-dummy.c
> +++ b/lib/netdev-dummy.c
> @@ -897,6 +897,9 @@ netdev_dummy_get_numa_id(const struct netdev *netdev_)
>  return numa_id;
>  }
>
> +
> +#define DUMMY_MAX_QUEUES_PER_PORT 1024
> +
>  /* Sets the number of tx queues and rx queues for the dummy PMD interface. */
>  static int
>  netdev_dummy_reconfigure(struct netdev *netdev_)
> @@ -905,8 +908,8 @@ netdev_dummy_reconfigure(struct netdev *netdev_)
>
>  ovs_mutex_lock(>mutex);
>
> -netdev_->n_txq = netdev->requested_n_txq;
> -netdev_->n_rxq = netdev->requested_n_rxq;
> +netdev_->n_txq = MIN(DUMMY_MAX_QUEUES_PER_PORT, netdev->requested_n_txq);
> +netdev_->n_rxq = MIN(DUMMY_MAX_QUEUES_PER_PORT, netdev->requested_n_rxq);
>  netdev->numa_id = netdev->requested_numa_id;
>
>  ovs_mutex_unlock(>mutex);
> --
> 1.8.3.1
>
>
>
> ___
> dev mailing list
> d...@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev