diff mbox

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

Message ID 1483925422-4607-3-git-send-email-nic@opencloud.tech
State Superseded
Headers show

Commit Message

nickcooper-zhangtonghao Jan. 9, 2017, 1:30 a.m. UTC
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 <nic@opencloud.tech>
---
 lib/netdev-dummy.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Daniele Di Proietto Jan. 9, 2017, 3:22 a.m. UTC | #1
2017-01-08 17:30 GMT-08:00 nickcooper-zhangtonghao <nic@opencloud.tech>:
> 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 <nic@opencloud.tech>

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(&netdev->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(&netdev->mutex);
> --
> 1.8.3.1
>
>
>
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
nickcooper-zhangtonghao Jan. 9, 2017, 4:02 a.m. UTC | #2
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 <diproiettod@ovn.org> wrote:
> 
> 2017-01-08 17:30 GMT-08:00 nickcooper-zhangtonghao <nic@opencloud.tech <mailto:nic@opencloud.tech>>:
>> 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 <nic@opencloud.tech <mailto:nic@opencloud.tech>>
> 
> 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
Daniele Di Proietto Jan. 10, 2017, 2:11 a.m. UTC | #3
2017-01-08 20:02 GMT-08:00 nickcooper-zhangtonghao <nic@opencloud.tech>:
> 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 <diproiettod@ovn.org>
> wrote:
>
> 2017-01-08 17:30 GMT-08:00 nickcooper-zhangtonghao <nic@opencloud.tech>:
>
> 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 <nic@opencloud.tech>
>
>
> 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
>
>
nickcooper-zhangtonghao Jan. 10, 2017, 2:30 a.m. UTC | #4
Thanks, I got it. :)


> On Jan 10, 2017, at 10:11 AM, Daniele Di Proietto <diproiettod@ovn.org> wrote:
> 
> 2017-01-08 20:02 GMT-08:00 nickcooper-zhangtonghao <nic@opencloud.tech <mailto:nic@opencloud.tech>>:
>> 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
diff mbox

Patch

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(&netdev->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(&netdev->mutex);