[ovs-dev] [dpdk patch 4/8] netdev-dpdk: Create 'number of dpdk ifaces on same cpu socket' rx queues and 'number of cpu cores' tx queues for each dpdk interface.

Pravin Shelar pshelar at nicira.com
Sat Aug 30 19:02:17 UTC 2014


On Mon, Aug 11, 2014 at 9:56 PM, Alex Wang <alexw at nicira.com> wrote:
> Before this commit, ovs only creates one tx/rx queue for each
> dpdk interface and uses only one poll thread for handling the
> I/O of all dpdk interfaces.  As one step toward using multiple
> poll threads, this commit makes ovs, by default, create same
> number of rx queues as the number dpdk interfaces on the cpu
> socket.  Also each dpdk interface will have one tx queue for
> each cpu core, even though not all of those queues will be
> used.
>

Generally we should describe subject in less than 70 characters.
Commit msg should explain why we are introducing this change. It is
not clear from the patch the relation between number of core on socket
and rx queues.

> Signed-off-by: Alex Wang <alexw at nicira.com>
> ---
>  lib/dpif-netdev.h |    1 -
>  lib/netdev-dpdk.c |   55 +++++++++++++++++++++++++++++++++++++++++++++--------
>  2 files changed, 47 insertions(+), 9 deletions(-)
>
> diff --git a/lib/dpif-netdev.h b/lib/dpif-netdev.h
> index 410fcfa..50c1198 100644
> --- a/lib/dpif-netdev.h
> +++ b/lib/dpif-netdev.h
> @@ -40,7 +40,6 @@ static inline void dp_packet_pad(struct ofpbuf *b)
>      }
>  }
>
> -#define NR_QUEUE   1
>  #define NR_PMD_THREADS 1
>
>  #ifdef  __cplusplus
> diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
> index 109006f..432524f 100644
> --- a/lib/netdev-dpdk.c
> +++ b/lib/netdev-dpdk.c
> @@ -36,6 +36,7 @@
>  #include "odp-util.h"
>  #include "ofp-print.h"
>  #include "ofpbuf.h"
> +#include "ovs-numa.h"
>  #include "ovs-thread.h"
>  #include "ovs-rcu.h"
>  #include "packet-dpif.h"
> @@ -179,7 +180,9 @@ struct netdev_dpdk {
>      int port_id;
>      int max_packet_len;
>
> -    struct dpdk_tx_queue tx_q[NR_QUEUE];
> +    struct dpdk_tx_queue *tx_q;
> +    int n_tx_q;
> +    int n_rx_q;
>
There is already member in struct netdev called n_rxq to represent
number of rx_queues, we should use that directly.
tx_queues are not visible to dpif-netdev, but later patches will make
them visible, so we should add another member n_txq to struct netdev.
netdev-provide should be a passive layer, driven by dpif-netdev. Logic
of calculating number of queues should is in dpif-netdev, We can add
another API to open multi queue devices like dpdk.



More information about the dev mailing list