Re: [ovs-dev] [RFC] dpdk: support multiple queues in vhost

2015-08-06 Thread Karthick, A.R.
Just to top-post briefly:
 qemu reverted the vhost-user multiqueue support sometime back.
 So this patch isn't really usable.

Regards,
-Karthick

 commit f73ca7363440240b7ee5ee7f7ddb1c64751efb54
Merge: 7135847 f9d6dbf
Author: Peter Maydell peter.mayd...@linaro.org
Date:   Mon Jul 20 13:25:28 2015 +0100

Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into
staging

virtio, vhost, pc fixes for 2.4

The only notable thing here is vhost-user multiqueue
revert. We'll work on making it stable in 2.5,
reverting now means we won't have to maintain
bug for bug compability forever.

Signed-off-by: Michael S. Tsirkin m...@redhat.com

# gpg: Signature made Mon Jul 20 12:24:00 2015 BST using RSA key ID
D28D5469
# gpg: Good signature from Michael S. Tsirkin m...@kernel.org
# gpg: aka Michael S. Tsirkin m...@redhat.com

* remotes/mst/tags/for_upstream:
  virtio-net: remove virtio queues if the guest doesn't support
multiqueue
  virtio-net: Flush incoming queues when DRIVER_OK is being set
  pci_add_capability: remove duplicate comments
  virtio-net: unbreak any layout
  Revert vhost-user: add multi queue support
  ich9: fix skipped vmstate_memhp_state subsection

Signed-off-by: Peter Maydell peter.mayd...@linaro.org


On Thu, Aug 6, 2015 at 10:40 AM, Flavio Leitner f...@sysclose.org wrote:

 On Thu, Aug 06, 2015 at 12:39:29PM -0400, Thomas F Herbert wrote:
  On 7/31/15 6:30 PM, Flavio Leitner wrote:
  This RFC is based on the vhost multiple queues work on
  dpdk-dev: http://dpdk.org/ml/archives/dev/2015-June/019345.html
  
  Signed-off-by: Flavio Leitner f...@redhat.com
  ---
lib/netdev-dpdk.c | 61
 ---
1 file changed, 40 insertions(+), 21 deletions(-)
  
  diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
  index 5ae805e..493172c 100644
  --- a/lib/netdev-dpdk.c
  +++ b/lib/netdev-dpdk.c
  @@ -215,12 +215,9 @@ struct netdev_dpdk {
 * If the numbers match, 'txq_needs_locking' is false, otherwise
 it is
 * true and we will take a spinlock on transmission */
int real_n_txq;
  +int real_n_rxq;
bool txq_needs_locking;
  
  -/* Spinlock for vhost transmission.  Other DPDK devices use
 spinlocks in
  - * dpdk_tx_queue */
  -rte_spinlock_t vhost_tx_lock;
  -
/* virtio-net structure for vhost device */
OVSRCU_TYPE(struct virtio_net *) virtio_dev;
  
  @@ -602,13 +599,10 @@ dpdk_dev_parse_name(const char dev_name[], const
 char prefix[],
static int
vhost_construct_helper(struct netdev *netdev_)
 OVS_REQUIRES(dpdk_mutex)
{
  -struct netdev_dpdk *netdev = netdev_dpdk_cast(netdev_);
  -
if (rte_eal_init_ret) {
return rte_eal_init_ret;
}
  
  -rte_spinlock_init(netdev-vhost_tx_lock);
return netdev_dpdk_init(netdev_, -1, DPDK_DEV_VHOST);
}
  
  @@ -791,9 +785,16 @@ netdev_dpdk_vhost_set_multiq(struct netdev
 *netdev_, unsigned int n_txq,
ovs_mutex_lock(dpdk_mutex);
ovs_mutex_lock(netdev-mutex);
  
  +rte_free(netdev-tx_q);
  +/* FIXME: the number of vqueues needs to match */
netdev-up.n_txq = n_txq;
  -netdev-real_n_txq = 1;
  -netdev-up.n_rxq = 1;
  +netdev-up.n_rxq = n_rxq;
  +
  +/* vring has txq = rxq */
  +netdev-real_n_txq = n_rxq;
  +netdev-real_n_rxq = n_rxq;
  +netdev-txq_needs_locking = netdev-real_n_txq != netdev-up.n_txq;
  +netdev_dpdk_alloc_txq(netdev, netdev-up.n_txq);
  
ovs_mutex_unlock(netdev-mutex);
ovs_mutex_unlock(dpdk_mutex);
  @@ -904,14 +905,14 @@ netdev_dpdk_vhost_rxq_recv(struct netdev_rxq
 *rxq_,
struct netdev *netdev = rx-up.netdev;
struct netdev_dpdk *vhost_dev = netdev_dpdk_cast(netdev);
struct virtio_net *virtio_dev = netdev_dpdk_get_virtio(vhost_dev);
  -int qid = 1;
  +int qid = rxq_-queue_id;
uint16_t nb_rx = 0;
  
if (OVS_UNLIKELY(!is_vhost_running(virtio_dev))) {
return EAGAIN;
}
  
  -nb_rx = rte_vhost_dequeue_burst(virtio_dev, qid,
  +nb_rx = rte_vhost_dequeue_burst(virtio_dev, VIRTIO_TXQ + qid * 2,
vhost_dev-dpdk_mp-mp,
(struct rte_mbuf **)packets,
NETDEV_MAX_BURST);
  @@ -958,8 +959,9 @@ netdev_dpdk_rxq_recv(struct netdev_rxq *rxq_,
 struct dp_packet **packets,
}
  
static void
  -__netdev_dpdk_vhost_send(struct netdev *netdev, struct dp_packet
 **pkts,
  - int cnt, bool may_steal)
  +__netdev_dpdk_vhost_send(struct netdev *netdev, int qid,
  + struct dp_packet **pkts, int cnt,
  + bool may_steal)
{
struct netdev_dpdk *vhost_dev = netdev_dpdk_cast(netdev);
struct virtio_net *virtio_dev = netdev_dpdk_get_virtio(vhost_dev);
  @@ -974,13 +976,16 

Re: [ovs-dev] [PATCH] netdev-dpdk: Increase limit for dpdk ring names

2015-08-06 Thread Karthick, A.R.
Hi,
 I know this is a low hanging fruit.
 But still wanted to know if this can be merged.
Regards,
-Karthi

On Tue, Jul 28, 2015 at 11:33 AM, A.R. Karthick ar.karth...@cyaninc.com
wrote:

 Hi,
  Currently, the ovs netdev-dpdk ring type dpdkr, restricts dpdk ring name
 size to 10 bytes (includes the _rx/tx suffix).

  This only gives us space to accommodate 10 rings as truncation happens
 with dpdkr10_rx/tx.

  The enclosed patch below ensures that we respect the ring name size
 constraints imposed by the rte dpdk ring apis by allowing for a greater
 size instead of using a hard-coded ring name size in ovs netdev-dpdk layer.

 Regards,
 -Karthick

 diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
 index 5ae805e..00229c2 100644
 --- a/lib/netdev-dpdk.c
 +++ b/lib/netdev-dpdk.c
 @@ -92,7 +92,7 @@ BUILD_ASSERT_DECL((MAX_NB_MBUF /
 ROUND_DOWN_POW2(MAX_NB_MBUF/MIN_NB_MBUF))

  #define NIC_PORT_RX_Q_SIZE 2048  /* Size of Physical NIC RX Queue, Max
 (n+32=4096)*/
  #define NIC_PORT_TX_Q_SIZE 2048  /* Size of Physical NIC TX Queue, Max
 (n+32=4096)*/
 -
 +#define RING_NAME_MAX (RTE_MEMZONE_NAMESIZE - sizeof(RTE_RING_MZ_PREFIX))
  static char *cuse_dev_name = NULL;/* Character device cuse_dev_name.
 */
  static char *vhost_sock_dir = NULL;   /* Location of vhost-user sockets */

 @@ -1797,7 +1797,7 @@ dpdk_ring_create(const char dev_name[], unsigned int
 port_no,
   unsigned int *eth_port_id)
  {
  struct dpdk_ring *ivshmem;
 -char ring_name[10];
 +char ring_name[RING_NAME_MAX];
  int err;

  ivshmem = dpdk_rte_mzalloc(sizeof *ivshmem);
 @@ -1806,7 +1806,7 @@ dpdk_ring_create(const char dev_name[], unsigned int
 port_no,
  }

  /* XXX: Add support for multiquque ring. */
 -err = snprintf(ring_name, 10, %s_tx, dev_name);
 +err = snprintf(ring_name, sizeof(ring_name), %s_tx, dev_name);
  if (err  0) {
  return -err;
  }
 @@ -1819,7 +1819,7 @@ dpdk_ring_create(const char dev_name[], unsigned int
 port_no,
  return ENOMEM;
  }

 -err = snprintf(ring_name, 10, %s_rx, dev_name);
 +err = snprintf(ring_name, sizeof(ring_name), %s_rx, dev_name);
  if (err  0) {
  return -err;
  }






___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev