DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/8] net/virtio: revert "virtio: fix restart"
From: Yuanhan Liu @ 2016-11-03 16:09 UTC (permalink / raw)
  To: dev; +Cc: stable, Ilya Maximets
In-Reply-To: <1478189400-14606-1-git-send-email-yuanhan.liu@linux.intel.com>

This reverts commit 9a0615af7746 ("virtio: fix restart"); conflict is
manually addressed.

Kyle reported an issue with above commit

    qemu-kvm: Guest moved used index from 5 to 1

with following steps,

    1) Start my virtio interfaces
    2) Send some traffic into/out of the interfaces
    3) Stop the interfaces
    4) Start the interfaces
    5) Send some more traffic

And here are some quotes from Kyle's analysis,

    Prior to the patch, if an interface were stopped then started, without
    restarting the application, the queues would be left as-is, because
    hw->started would be set to 1. Now, calling stop sets hw->started to 0,
    which means the next call to start will "touch the queues". This is the
    unintended side-effect that causes the problem.

Fixes: 9a0615af7746 ("virtio: fix restart")

Cc: Jianfeng Tan <jianfeng.tan@intel.com>
Cc: <stable@dpdk.org>
Reported-by: Kyle Larose <klarose@sandvine.com>
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
---
 drivers/net/virtio/virtio_ethdev.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index b388134..5815875 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -550,9 +550,6 @@ virtio_dev_close(struct rte_eth_dev *dev)
 
 	PMD_INIT_LOG(DEBUG, "virtio_dev_close");
 
-	if (hw->started == 1)
-		virtio_dev_stop(dev);
-
 	if (hw->cvq)
 		virtio_dev_queue_release(hw->cvq->vq);
 
@@ -560,6 +557,7 @@ virtio_dev_close(struct rte_eth_dev *dev)
 	if (dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC)
 		vtpci_irq_config(hw, VIRTIO_MSI_NO_VECTOR);
 	vtpci_reset(hw);
+	hw->started = 0;
 	virtio_dev_free_mbufs(dev);
 	virtio_free_queues(dev);
 }
@@ -1296,15 +1294,17 @@ static int
 eth_virtio_dev_uninit(struct rte_eth_dev *eth_dev)
 {
 	struct rte_pci_device *pci_dev;
+	struct virtio_hw *hw = eth_dev->data->dev_private;
 
 	PMD_INIT_FUNC_TRACE();
 
 	if (rte_eal_process_type() == RTE_PROC_SECONDARY)
 		return -EPERM;
 
-	/* Close it anyway since there's no way to know if closed */
-	virtio_dev_close(eth_dev);
-
+	if (hw->started == 1) {
+		virtio_dev_stop(eth_dev);
+		virtio_dev_close(eth_dev);
+	}
 	pci_dev = eth_dev->pci_dev;
 
 	eth_dev->dev_ops = NULL;
@@ -1543,12 +1543,9 @@ static void
 virtio_dev_stop(struct rte_eth_dev *dev)
 {
 	struct rte_eth_link link;
-	struct virtio_hw *hw = dev->data->dev_private;
 
 	PMD_INIT_LOG(DEBUG, "stop");
 
-	hw->started = 0;
-
 	if (dev->data->dev_conf.intr_conf.lsc)
 		rte_intr_disable(&dev->pci_dev->intr_handle);
 
-- 
1.9.0

^ permalink raw reply related

* [PATCH 8/8] net/virtio: remove started field
From: Yuanhan Liu @ 2016-11-03 16:10 UTC (permalink / raw)
  To: dev; +Cc: Ilya Maximets
In-Reply-To: <1478189400-14606-1-git-send-email-yuanhan.liu@linux.intel.com>

The "hw->started" field was introduced to stop touching queues
on restart. We never touches queues on restart any more, thus
it's safe to remove this flag.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
---
 drivers/net/virtio/virtio_ethdev.c | 15 ++-------------
 drivers/net/virtio/virtio_pci.h    |  1 -
 2 files changed, 2 insertions(+), 14 deletions(-)

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index c147909..1505f67 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -607,7 +607,6 @@ virtio_dev_close(struct rte_eth_dev *dev)
 	if (dev->data->dev_flags & RTE_ETH_DEV_INTR_LSC)
 		vtpci_irq_config(hw, VIRTIO_MSI_NO_VECTOR);
 	vtpci_reset(hw);
-	hw->started = 0;
 	virtio_dev_free_mbufs(dev);
 	virtio_free_queues(dev);
 }
@@ -1350,17 +1349,14 @@ static int
 eth_virtio_dev_uninit(struct rte_eth_dev *eth_dev)
 {
 	struct rte_pci_device *pci_dev;
-	struct virtio_hw *hw = eth_dev->data->dev_private;
 
 	PMD_INIT_FUNC_TRACE();
 
 	if (rte_eal_process_type() == RTE_PROC_SECONDARY)
 		return -EPERM;
 
-	if (hw->started == 1) {
-		virtio_dev_stop(eth_dev);
-		virtio_dev_close(eth_dev);
-	}
+	virtio_dev_stop(eth_dev);
+	virtio_dev_close(eth_dev);
 	pci_dev = eth_dev->pci_dev;
 
 	eth_dev->dev_ops = NULL;
@@ -1479,7 +1475,6 @@ static int
 virtio_dev_start(struct rte_eth_dev *dev)
 {
 	uint16_t nb_queues, i;
-	struct virtio_hw *hw = dev->data->dev_private;
 	struct virtnet_rx *rxvq;
 	struct virtnet_tx *txvq __rte_unused;
 
@@ -1499,12 +1494,6 @@ virtio_dev_start(struct rte_eth_dev *dev)
 	/* Initialize Link state */
 	virtio_dev_link_update(dev, 0);
 
-	/* On restart after stop do not touch queues */
-	if (hw->started)
-		return 0;
-
-	hw->started = 1;
-
 	/*Notify the backend
 	 *Otherwise the tap backend might already stop its queue due to fullness.
 	 *vhost backend will have no chance to be waked up
diff --git a/drivers/net/virtio/virtio_pci.h b/drivers/net/virtio/virtio_pci.h
index f63f76c..de271bf 100644
--- a/drivers/net/virtio/virtio_pci.h
+++ b/drivers/net/virtio/virtio_pci.h
@@ -252,7 +252,6 @@ struct virtio_hw {
 	uint16_t    vtnet_hdr_size;
 	uint8_t	    vlan_strip;
 	uint8_t	    use_msix;
-	uint8_t     started;
 	uint8_t     modern;
 	uint8_t     use_simple_rxtx;
 	uint8_t     mac_addr[ETHER_ADDR_LEN];
-- 
1.9.0

^ permalink raw reply related

* [PATCH 7/8] net/virtio: complete init stage at the right place
From: Yuanhan Liu @ 2016-11-03 16:09 UTC (permalink / raw)
  To: dev; +Cc: Ilya Maximets
In-Reply-To: <1478189400-14606-1-git-send-email-yuanhan.liu@linux.intel.com>

Invoking vtpci_reinit_complete() at port start stage doesn't make any
sense, instead, it should be done at the end of dev init stage.

So move it here.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
---
 drivers/net/virtio/virtio_ethdev.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 37459e7..c147909 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1282,6 +1282,7 @@ virtio_init_device(struct rte_eth_dev *eth_dev, uint64_t req_features)
 	ret = virtio_alloc_queues(eth_dev);
 	if (ret < 0)
 		return ret;
+	vtpci_reinit_complete(hw);
 
 	if (pci_dev)
 		PMD_INIT_LOG(DEBUG, "port %d vendorID=0x%x deviceID=0x%x",
@@ -1502,8 +1503,6 @@ virtio_dev_start(struct rte_eth_dev *dev)
 	if (hw->started)
 		return 0;
 
-	vtpci_reinit_complete(hw);
-
 	hw->started = 1;
 
 	/*Notify the backend
-- 
1.9.0

^ permalink raw reply related

* [PATCH 6/8] net/virtio: move queue configure code to proper place
From: Yuanhan Liu @ 2016-11-03 16:09 UTC (permalink / raw)
  To: dev; +Cc: Ilya Maximets
In-Reply-To: <1478189400-14606-1-git-send-email-yuanhan.liu@linux.intel.com>

The only piece of code of virtio_dev_rxtx_start() is actually doing
queue configure/setup work. So, move it to corresponding queue_setup
callback.

Once that is done, virtio_dev_rxtx_start() becomes an empty function,
thus it's being removed.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
---
 drivers/net/virtio/virtio_ethdev.c |   2 -
 drivers/net/virtio/virtio_ethdev.h |   2 -
 drivers/net/virtio/virtio_rxtx.c   | 187 ++++++++++++++++---------------------
 3 files changed, 79 insertions(+), 112 deletions(-)

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index b80b6f5..37459e7 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1502,8 +1502,6 @@ virtio_dev_start(struct rte_eth_dev *dev)
 	if (hw->started)
 		return 0;
 
-	/* Do final configuration before rx/tx engine starts */
-	virtio_dev_rxtx_start(dev);
 	vtpci_reinit_complete(hw);
 
 	hw->started = 1;
diff --git a/drivers/net/virtio/virtio_ethdev.h b/drivers/net/virtio/virtio_ethdev.h
index 5db8632..1396c6e 100644
--- a/drivers/net/virtio/virtio_ethdev.h
+++ b/drivers/net/virtio/virtio_ethdev.h
@@ -78,8 +78,6 @@ void virtio_dev_cq_start(struct rte_eth_dev *dev);
 /*
  * RX/TX function prototypes
  */
-void virtio_dev_rxtx_start(struct rte_eth_dev *dev);
-
 void virtio_dev_queue_release(struct virtqueue *vq);
 
 int  virtio_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,
diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c
index bce0663..4cb2ce7 100644
--- a/drivers/net/virtio/virtio_rxtx.c
+++ b/drivers/net/virtio/virtio_rxtx.c
@@ -388,112 +388,6 @@ virtio_dev_cq_start(struct rte_eth_dev *dev)
 	}
 }
 
-void
-virtio_dev_rxtx_start(struct rte_eth_dev *dev)
-{
-	/*
-	 * Start receive and transmit vrings
-	 * -	Setup vring structure for all queues
-	 * -	Initialize descriptor for the rx vring
-	 * -	Allocate blank mbufs for the each rx descriptor
-	 *
-	 */
-	uint16_t i;
-	uint16_t desc_idx;
-	struct virtio_hw *hw = dev->data->dev_private;
-
-	PMD_INIT_FUNC_TRACE();
-
-	/* Start rx vring. */
-	for (i = 0; i < dev->data->nb_rx_queues; i++) {
-		struct virtnet_rx *rxvq = dev->data->rx_queues[i];
-		struct virtqueue *vq = rxvq->vq;
-		int error, nbufs;
-		struct rte_mbuf *m;
-
-		if (rxvq->mpool == NULL) {
-			rte_exit(EXIT_FAILURE,
-				"Cannot allocate mbufs for rx virtqueue");
-		}
-
-		/* Allocate blank mbufs for the each rx descriptor */
-		nbufs = 0;
-		error = ENOSPC;
-
-		if (hw->use_simple_rxtx) {
-			for (desc_idx = 0; desc_idx < vq->vq_nentries;
-			     desc_idx++) {
-				vq->vq_ring.avail->ring[desc_idx] = desc_idx;
-				vq->vq_ring.desc[desc_idx].flags =
-					VRING_DESC_F_WRITE;
-			}
-		}
-
-		memset(&rxvq->fake_mbuf, 0, sizeof(rxvq->fake_mbuf));
-		for (desc_idx = 0; desc_idx < RTE_PMD_VIRTIO_RX_MAX_BURST;
-		     desc_idx++) {
-			vq->sw_ring[vq->vq_nentries + desc_idx] =
-				&rxvq->fake_mbuf;
-		}
-
-		while (!virtqueue_full(vq)) {
-			m = rte_mbuf_raw_alloc(rxvq->mpool);
-			if (m == NULL)
-				break;
-
-			/******************************************
-			*         Enqueue allocated buffers        *
-			*******************************************/
-			if (hw->use_simple_rxtx)
-				error = virtqueue_enqueue_recv_refill_simple(vq, m);
-			else
-				error = virtqueue_enqueue_recv_refill(vq, m);
-
-			if (error) {
-				rte_pktmbuf_free(m);
-				break;
-			}
-			nbufs++;
-		}
-
-		vq_update_avail_idx(vq);
-
-		PMD_INIT_LOG(DEBUG, "Allocated %d bufs", nbufs);
-
-		VIRTQUEUE_DUMP(vq);
-	}
-
-	/* Start tx vring. */
-	for (i = 0; i < dev->data->nb_tx_queues; i++) {
-		struct virtnet_tx *txvq = dev->data->tx_queues[i];
-		struct virtqueue *vq = txvq->vq;
-
-		if (hw->use_simple_rxtx) {
-			uint16_t mid_idx  = vq->vq_nentries >> 1;
-
-			for (desc_idx = 0; desc_idx < mid_idx; desc_idx++) {
-				vq->vq_ring.avail->ring[desc_idx] =
-					desc_idx + mid_idx;
-				vq->vq_ring.desc[desc_idx + mid_idx].next =
-					desc_idx;
-				vq->vq_ring.desc[desc_idx + mid_idx].addr =
-					txvq->virtio_net_hdr_mem +
-					offsetof(struct virtio_tx_region, tx_hdr);
-				vq->vq_ring.desc[desc_idx + mid_idx].len =
-					vq->hw->vtnet_hdr_size;
-				vq->vq_ring.desc[desc_idx + mid_idx].flags =
-					VRING_DESC_F_NEXT;
-				vq->vq_ring.desc[desc_idx].flags = 0;
-			}
-			for (desc_idx = mid_idx; desc_idx < vq->vq_nentries;
-			     desc_idx++)
-				vq->vq_ring.avail->ring[desc_idx] = desc_idx;
-		}
-
-		VIRTQUEUE_DUMP(vq);
-	}
-}
-
 int
 virtio_dev_rx_queue_setup(struct rte_eth_dev *dev,
 			uint16_t queue_idx,
@@ -506,6 +400,9 @@ virtio_dev_rx_queue_setup(struct rte_eth_dev *dev,
 	struct virtio_hw *hw = dev->data->dev_private;
 	struct virtqueue *vq = hw->vqs[vtpci_queue_idx];
 	struct virtnet_rx *rxvq;
+	int error, nbufs;
+	struct rte_mbuf *m;
+	uint16_t desc_idx;
 
 	PMD_INIT_FUNC_TRACE();
 
@@ -514,13 +411,61 @@ virtio_dev_rx_queue_setup(struct rte_eth_dev *dev,
 	vq->vq_free_cnt = RTE_MIN(vq->vq_free_cnt, nb_desc);
 
 	rxvq = &vq->rxq;
-	rxvq->mpool = mp;
 	rxvq->queue_id = queue_idx;
-
+	rxvq->mpool = mp;
+	if (rxvq->mpool == NULL) {
+		rte_exit(EXIT_FAILURE,
+			"Cannot allocate mbufs for rx virtqueue");
+	}
 	dev->data->rx_queues[queue_idx] = rxvq;
 
+
+	/* Allocate blank mbufs for the each rx descriptor */
+	nbufs = 0;
+	error = ENOSPC;
+
+	if (hw->use_simple_rxtx) {
+		for (desc_idx = 0; desc_idx < vq->vq_nentries;
+		     desc_idx++) {
+			vq->vq_ring.avail->ring[desc_idx] = desc_idx;
+			vq->vq_ring.desc[desc_idx].flags =
+				VRING_DESC_F_WRITE;
+		}
+	}
+
+	memset(&rxvq->fake_mbuf, 0, sizeof(rxvq->fake_mbuf));
+	for (desc_idx = 0; desc_idx < RTE_PMD_VIRTIO_RX_MAX_BURST;
+	     desc_idx++) {
+		vq->sw_ring[vq->vq_nentries + desc_idx] =
+			&rxvq->fake_mbuf;
+	}
+
+	while (!virtqueue_full(vq)) {
+		m = rte_mbuf_raw_alloc(rxvq->mpool);
+		if (m == NULL)
+			break;
+
+		/* Enqueue allocated buffers */
+		if (hw->use_simple_rxtx)
+			error = virtqueue_enqueue_recv_refill_simple(vq, m);
+		else
+			error = virtqueue_enqueue_recv_refill(vq, m);
+
+		if (error) {
+			rte_pktmbuf_free(m);
+			break;
+		}
+		nbufs++;
+	}
+
+	vq_update_avail_idx(vq);
+
+	PMD_INIT_LOG(DEBUG, "Allocated %d bufs", nbufs);
+
 	virtio_rxq_vec_setup(rxvq);
 
+	VIRTQUEUE_DUMP(vq);
+
 	return 0;
 }
 
@@ -589,6 +534,7 @@ virtio_dev_tx_queue_setup(struct rte_eth_dev *dev,
 	struct virtqueue *vq = hw->vqs[vtpci_queue_idx];
 	struct virtnet_tx *txvq;
 	uint16_t tx_free_thresh;
+	uint16_t desc_idx;
 
 	PMD_INIT_FUNC_TRACE();
 
@@ -617,7 +563,32 @@ virtio_dev_tx_queue_setup(struct rte_eth_dev *dev,
 
 	vq->vq_free_thresh = tx_free_thresh;
 
+	if (hw->use_simple_rxtx) {
+		uint16_t mid_idx  = vq->vq_nentries >> 1;
+
+		for (desc_idx = 0; desc_idx < mid_idx; desc_idx++) {
+			vq->vq_ring.avail->ring[desc_idx] =
+				desc_idx + mid_idx;
+			vq->vq_ring.desc[desc_idx + mid_idx].next =
+				desc_idx;
+			vq->vq_ring.desc[desc_idx + mid_idx].addr =
+				txvq->virtio_net_hdr_mem +
+				offsetof(struct virtio_tx_region, tx_hdr);
+			vq->vq_ring.desc[desc_idx + mid_idx].len =
+				vq->hw->vtnet_hdr_size;
+			vq->vq_ring.desc[desc_idx + mid_idx].flags =
+				VRING_DESC_F_NEXT;
+			vq->vq_ring.desc[desc_idx].flags = 0;
+		}
+		for (desc_idx = mid_idx; desc_idx < vq->vq_nentries;
+		     desc_idx++)
+			vq->vq_ring.avail->ring[desc_idx] = desc_idx;
+	}
+
+	VIRTQUEUE_DUMP(vq);
+
 	dev->data->tx_queues[queue_idx] = txvq;
+
 	return 0;
 }
 
-- 
1.9.0

^ permalink raw reply related

* [PATCH 5/8] net/virtio: initiate vring at init stage
From: Yuanhan Liu @ 2016-11-03 16:09 UTC (permalink / raw)
  To: dev; +Cc: Ilya Maximets
In-Reply-To: <1478189400-14606-1-git-send-email-yuanhan.liu@linux.intel.com>

virtio_dev_vring_start() is actually doing the vring initiation job.
And the vring initiation job should be done at the dev init stage, as
stated with great details in former commit.

So move it there, and rename it to virtio_init_vring().

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
---
 drivers/net/virtio/virtio_ethdev.c | 32 +++++++++++++++++++++++++++++++-
 drivers/net/virtio/virtio_rxtx.c   | 32 --------------------------------
 2 files changed, 31 insertions(+), 33 deletions(-)

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 253bcb5..b80b6f5 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -306,6 +306,35 @@ virtio_get_queue_type(struct virtio_hw *hw, uint16_t vtpci_queue_idx)
 		return VTNET_TQ;
 }
 
+static void
+virtio_init_vring(struct virtqueue *vq)
+{
+	int size = vq->vq_nentries;
+	struct vring *vr = &vq->vq_ring;
+	uint8_t *ring_mem = vq->vq_ring_virt_mem;
+
+	PMD_INIT_FUNC_TRACE();
+
+	/*
+	 * Reinitialise since virtio port might have been stopped and restarted
+	 */
+	memset(ring_mem, 0, vq->vq_ring_size);
+	vring_init(vr, size, ring_mem, VIRTIO_PCI_VRING_ALIGN);
+	vq->vq_used_cons_idx = 0;
+	vq->vq_desc_head_idx = 0;
+	vq->vq_avail_idx = 0;
+	vq->vq_desc_tail_idx = (uint16_t)(vq->vq_nentries - 1);
+	vq->vq_free_cnt = vq->vq_nentries;
+	memset(vq->vq_descx, 0, sizeof(struct vq_desc_extra) * vq->vq_nentries);
+
+	vring_desc_init(vr->desc, size);
+
+	/*
+	 * Disable device(host) interrupting guest
+	 */
+	virtqueue_disable_intr(vq);
+}
+
 static int
 virtio_init_queue(struct rte_eth_dev *dev, uint16_t vtpci_queue_idx)
 {
@@ -369,7 +398,6 @@ virtio_init_queue(struct rte_eth_dev *dev, uint16_t vtpci_queue_idx)
 	vq->hw = hw;
 	vq->vq_queue_index = vtpci_queue_idx;
 	vq->vq_nentries = vq_size;
-	vq->vq_free_cnt = vq_size;
 
 	/*
 	 * Reserve a memzone for vring elements
@@ -400,6 +428,8 @@ virtio_init_queue(struct rte_eth_dev *dev, uint16_t vtpci_queue_idx)
 	PMD_INIT_LOG(DEBUG, "vq->vq_ring_virt_mem: 0x%" PRIx64,
 		     (uint64_t)(uintptr_t)mz->addr);
 
+	virtio_init_vring(vq);
+
 	if (sz_hdr_mz) {
 		snprintf(vq_hdr_name, sizeof(vq_hdr_name), "port%d_vq%d_hdr",
 			 dev->data->port_id, vtpci_queue_idx);
diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c
index fb703d2..bce0663 100644
--- a/drivers/net/virtio/virtio_rxtx.c
+++ b/drivers/net/virtio/virtio_rxtx.c
@@ -378,42 +378,12 @@ virtqueue_enqueue_xmit(struct virtnet_tx *txvq, struct rte_mbuf *cookie,
 	vq_update_avail_ring(vq, head_idx);
 }
 
-static void
-virtio_dev_vring_start(struct virtqueue *vq)
-{
-	int size = vq->vq_nentries;
-	struct vring *vr = &vq->vq_ring;
-	uint8_t *ring_mem = vq->vq_ring_virt_mem;
-
-	PMD_INIT_FUNC_TRACE();
-
-	/*
-	 * Reinitialise since virtio port might have been stopped and restarted
-	 */
-	memset(vq->vq_ring_virt_mem, 0, vq->vq_ring_size);
-	vring_init(vr, size, ring_mem, VIRTIO_PCI_VRING_ALIGN);
-	vq->vq_used_cons_idx = 0;
-	vq->vq_desc_head_idx = 0;
-	vq->vq_avail_idx = 0;
-	vq->vq_desc_tail_idx = (uint16_t)(vq->vq_nentries - 1);
-	vq->vq_free_cnt = vq->vq_nentries;
-	memset(vq->vq_descx, 0, sizeof(struct vq_desc_extra) * vq->vq_nentries);
-
-	vring_desc_init(vr->desc, size);
-
-	/*
-	 * Disable device(host) interrupting guest
-	 */
-	virtqueue_disable_intr(vq);
-}
-
 void
 virtio_dev_cq_start(struct rte_eth_dev *dev)
 {
 	struct virtio_hw *hw = dev->data->dev_private;
 
 	if (hw->cvq && hw->cvq->vq) {
-		virtio_dev_vring_start(hw->cvq->vq);
 		VIRTQUEUE_DUMP((struct virtqueue *)hw->cvq->vq);
 	}
 }
@@ -441,7 +411,6 @@ virtio_dev_rxtx_start(struct rte_eth_dev *dev)
 		int error, nbufs;
 		struct rte_mbuf *m;
 
-		virtio_dev_vring_start(vq);
 		if (rxvq->mpool == NULL) {
 			rte_exit(EXIT_FAILURE,
 				"Cannot allocate mbufs for rx virtqueue");
@@ -499,7 +468,6 @@ virtio_dev_rxtx_start(struct rte_eth_dev *dev)
 		struct virtnet_tx *txvq = dev->data->tx_queues[i];
 		struct virtqueue *vq = txvq->vq;
 
-		virtio_dev_vring_start(vq);
 		if (hw->use_simple_rxtx) {
 			uint16_t mid_idx  = vq->vq_nentries >> 1;
 
-- 
1.9.0

^ permalink raw reply related

* [PATCH 4/8] net/virtio: allocate queue at init stage
From: Yuanhan Liu @ 2016-11-03 16:09 UTC (permalink / raw)
  To: dev; +Cc: Ilya Maximets
In-Reply-To: <1478189400-14606-1-git-send-email-yuanhan.liu@linux.intel.com>

Queue allocation should be done once, since the queue related info (such
as vring addreess) will only be informed to the vhost-user backend once
without virtio device reset.

That means, if you allocate queues again after the vhost-user negotiation,
the vhost-user backend will not be informed any more. Leading to a state
that the vring info mismatches between virtio PMD driver and vhost-backend:
the driver switches to the new address has just been allocated, while the
vhost-backend still sticks to the old address has been assigned in the init
stage.

Unfortunately, that is exactly how the virtio driver is coded so far: queue
allocation is done at queue_setup stage (when rte_eth_tx/rx_queue_setup is
invoked). This is wrong, because queue_setup can be invoked several times.
For example,

    $ start_testpmd.sh ... --txq=1 --rxq=1 ...
    > port stop 0
    > port config all txq 1 # just trigger the queue_setup callback again
    > port config all rxq 1
    > port start 0

The right way to do is allocate the queues in the init stage, so that the
vring info could be persistent with the vhost-user backend.

Besides that, we should allocate max_queue pairs the device supports, but
not nr queue pairs firstly configured, to make following case work.

    $ start_testpmd.sh ... --txq=1 --rxq=1 ...
    > port stop 0
    > port config all txq 2
    > port config all rxq 2
    > port start 0

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
---
 drivers/net/virtio/virtio_ethdev.c | 105 +++++++++++++++++++++++--------------
 drivers/net/virtio/virtio_ethdev.h |   8 ---
 drivers/net/virtio/virtio_pci.h    |   2 +
 drivers/net/virtio/virtio_rxtx.c   |  38 +++++++-------
 4 files changed, 85 insertions(+), 68 deletions(-)

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 5a2c14b..253bcb5 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -295,13 +295,19 @@ virtio_dev_queue_release(struct virtqueue *vq)
 	}
 }
 
-int virtio_dev_queue_setup(struct rte_eth_dev *dev,
-			int queue_type,
-			uint16_t queue_idx,
-			uint16_t vtpci_queue_idx,
-			uint16_t nb_desc,
-			unsigned int socket_id,
-			void **pvq)
+static int
+virtio_get_queue_type(struct virtio_hw *hw, uint16_t vtpci_queue_idx)
+{
+	if (vtpci_queue_idx == hw->max_queue_pairs * 2)
+		return VTNET_CQ;
+	else if (vtpci_queue_idx % 2 == 0)
+		return VTNET_RQ;
+	else
+		return VTNET_TQ;
+}
+
+static int
+virtio_init_queue(struct rte_eth_dev *dev, uint16_t vtpci_queue_idx)
 {
 	char vq_name[VIRTQUEUE_MAX_NAME_SZ];
 	char vq_hdr_name[VIRTQUEUE_MAX_NAME_SZ];
@@ -314,6 +320,7 @@ int virtio_dev_queue_setup(struct rte_eth_dev *dev,
 	struct virtqueue *vq;
 	size_t sz_hdr_mz = 0;
 	void *sw_ring = NULL;
+	int queue_type = virtio_get_queue_type(hw, vtpci_queue_idx);
 	int ret;
 
 	PMD_INIT_LOG(DEBUG, "setting up queue: %u", vtpci_queue_idx);
@@ -351,18 +358,18 @@ int virtio_dev_queue_setup(struct rte_eth_dev *dev,
 		sz_hdr_mz = PAGE_SIZE;
 	}
 
-	vq = rte_zmalloc_socket(vq_name, size, RTE_CACHE_LINE_SIZE, socket_id);
+	vq = rte_zmalloc_socket(vq_name, size, RTE_CACHE_LINE_SIZE,
+				SOCKET_ID_ANY);
 	if (vq == NULL) {
 		PMD_INIT_LOG(ERR, "can not allocate vq");
 		return -ENOMEM;
 	}
+	hw->vqs[vtpci_queue_idx] = vq;
+
 	vq->hw = hw;
 	vq->vq_queue_index = vtpci_queue_idx;
 	vq->vq_nentries = vq_size;
-
-	if (nb_desc == 0 || nb_desc > vq_size)
-		nb_desc = vq_size;
-	vq->vq_free_cnt = nb_desc;
+	vq->vq_free_cnt = vq_size;
 
 	/*
 	 * Reserve a memzone for vring elements
@@ -372,7 +379,8 @@ int virtio_dev_queue_setup(struct rte_eth_dev *dev,
 	PMD_INIT_LOG(DEBUG, "vring_size: %d, rounded_vring_size: %d",
 		     size, vq->vq_ring_size);
 
-	mz = rte_memzone_reserve_aligned(vq_name, vq->vq_ring_size, socket_id,
+	mz = rte_memzone_reserve_aligned(vq_name, vq->vq_ring_size,
+					 SOCKET_ID_ANY,
 					 0, VIRTIO_PCI_VRING_ALIGN);
 	if (mz == NULL) {
 		if (rte_errno == EEXIST)
@@ -396,7 +404,7 @@ int virtio_dev_queue_setup(struct rte_eth_dev *dev,
 		snprintf(vq_hdr_name, sizeof(vq_hdr_name), "port%d_vq%d_hdr",
 			 dev->data->port_id, vtpci_queue_idx);
 		hdr_mz = rte_memzone_reserve_aligned(vq_hdr_name, sz_hdr_mz,
-						     socket_id, 0,
+						     SOCKET_ID_ANY, 0,
 						     RTE_CACHE_LINE_SIZE);
 		if (hdr_mz == NULL) {
 			if (rte_errno == EEXIST)
@@ -413,7 +421,7 @@ int virtio_dev_queue_setup(struct rte_eth_dev *dev,
 			       sizeof(vq->sw_ring[0]);
 
 		sw_ring = rte_zmalloc_socket("sw_ring", sz_sw,
-					     RTE_CACHE_LINE_SIZE, socket_id);
+				RTE_CACHE_LINE_SIZE, SOCKET_ID_ANY);
 		if (!sw_ring) {
 			PMD_INIT_LOG(ERR, "can not allocate RX soft ring");
 			ret = -ENOMEM;
@@ -424,19 +432,14 @@ int virtio_dev_queue_setup(struct rte_eth_dev *dev,
 		rxvq = &vq->rxq;
 		rxvq->vq = vq;
 		rxvq->port_id = dev->data->port_id;
-		rxvq->queue_id = queue_idx;
 		rxvq->mz = mz;
-		*pvq = rxvq;
 	} else if (queue_type == VTNET_TQ) {
 		txvq = &vq->txq;
 		txvq->vq = vq;
 		txvq->port_id = dev->data->port_id;
-		txvq->queue_id = queue_idx;
 		txvq->mz = mz;
 		txvq->virtio_net_hdr_mz = hdr_mz;
 		txvq->virtio_net_hdr_mem = hdr_mz->phys_addr;
-
-		*pvq = txvq;
 	} else if (queue_type == VTNET_CQ) {
 		cvq = &vq->cq;
 		cvq->vq = vq;
@@ -444,7 +447,8 @@ int virtio_dev_queue_setup(struct rte_eth_dev *dev,
 		cvq->virtio_net_hdr_mz = hdr_mz;
 		cvq->virtio_net_hdr_mem = hdr_mz->phys_addr;
 		memset(cvq->virtio_net_hdr_mz->addr, 0, PAGE_SIZE);
-		*pvq = cvq;
+
+		hw->cvq = cvq;
 	}
 
 	/* For virtio_user case (that is when dev->pci_dev is NULL), we use
@@ -502,23 +506,45 @@ fail_q_alloc:
 }
 
 static int
-virtio_dev_cq_queue_setup(struct rte_eth_dev *dev, uint16_t vtpci_queue_idx,
-		uint32_t socket_id)
+virtio_alloc_queues(struct rte_eth_dev *dev)
 {
-	struct virtnet_ctl *cvq;
-	int ret;
 	struct virtio_hw *hw = dev->data->dev_private;
+	uint16_t nr_vq = hw->max_queue_pairs * 2;
+	uint16_t i;
+	int ret;
 
-	PMD_INIT_FUNC_TRACE();
-	ret = virtio_dev_queue_setup(dev, VTNET_CQ, VTNET_SQ_CQ_QUEUE_IDX,
-			vtpci_queue_idx, 0, socket_id, (void **)&cvq);
-	if (ret < 0) {
-		PMD_INIT_LOG(ERR, "control vq initialization failed");
-		return ret;
+	if (vtpci_with_feature(hw, VIRTIO_NET_F_CTRL_VQ))
+		nr_vq += 1;
+
+	hw->vqs = rte_zmalloc(NULL, sizeof(struct virtqueue *) * nr_vq, 0);
+	if (!hw->vqs) {
+		PMD_INIT_LOG(ERR, "failed to allocate vqs");
+		return -ENOMEM;
+	}
+
+	for (i = 0; i < nr_vq; i++) {
+		ret = virtio_init_queue(dev, i);
+		if (ret < 0)
+			goto cleanup;
 	}
 
-	hw->cvq = cvq;
 	return 0;
+
+cleanup:
+	/*
+	 * ctrl queue is the last queue; if we go here, it means the ctrl
+	 * queue is not allocated, that we can do no cleanup for it here.
+	 */
+	while (i > 0) {
+		i--;
+		if (i % 2 == 0)
+			virtio_dev_rx_queue_release(&hw->vqs[i]->rxq);
+		else
+			virtio_dev_tx_queue_release(&hw->vqs[i]->txq);
+	}
+	rte_free(hw->vqs);
+
+	return ret;
 }
 
 static void
@@ -1141,6 +1167,7 @@ virtio_init_device(struct rte_eth_dev *eth_dev, uint64_t req_features)
 	struct virtio_net_config *config;
 	struct virtio_net_config local_config;
 	struct rte_pci_device *pci_dev = eth_dev->pci_dev;
+	int ret;
 
 	/* Reset the device although not necessary at startup */
 	vtpci_reset(hw);
@@ -1222,6 +1249,10 @@ virtio_init_device(struct rte_eth_dev *eth_dev, uint64_t req_features)
 		hw->max_queue_pairs = 1;
 	}
 
+	ret = virtio_alloc_queues(eth_dev);
+	if (ret < 0)
+		return ret;
+
 	if (pci_dev)
 		PMD_INIT_LOG(DEBUG, "port %d vendorID=0x%x deviceID=0x%x",
 			eth_dev->data->port_id, pci_dev->id.vendor_id,
@@ -1390,15 +1421,9 @@ virtio_dev_configure(struct rte_eth_dev *dev)
 		return -ENOTSUP;
 	}
 
-	/* Setup and start control queue */
-	if (vtpci_with_feature(hw, VIRTIO_NET_F_CTRL_VQ)) {
-		ret = virtio_dev_cq_queue_setup(dev,
-			hw->max_queue_pairs * 2,
-			SOCKET_ID_ANY);
-		if (ret < 0)
-			return ret;
+	/* start control queue */
+	if (vtpci_with_feature(hw, VIRTIO_NET_F_CTRL_VQ))
 		virtio_dev_cq_start(dev);
-	}
 
 	hw->vlan_strip = rxmode->hw_vlan_strip;
 
diff --git a/drivers/net/virtio/virtio_ethdev.h b/drivers/net/virtio/virtio_ethdev.h
index de33b32..5db8632 100644
--- a/drivers/net/virtio/virtio_ethdev.h
+++ b/drivers/net/virtio/virtio_ethdev.h
@@ -80,14 +80,6 @@ void virtio_dev_cq_start(struct rte_eth_dev *dev);
  */
 void virtio_dev_rxtx_start(struct rte_eth_dev *dev);
 
-int virtio_dev_queue_setup(struct rte_eth_dev *dev,
-			int queue_type,
-			uint16_t queue_idx,
-			uint16_t vtpci_queue_idx,
-			uint16_t nb_desc,
-			unsigned int socket_id,
-			void **pvq);
-
 void virtio_dev_queue_release(struct virtqueue *vq);
 
 int  virtio_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id,
diff --git a/drivers/net/virtio/virtio_pci.h b/drivers/net/virtio/virtio_pci.h
index 0c5ed31..f63f76c 100644
--- a/drivers/net/virtio/virtio_pci.h
+++ b/drivers/net/virtio/virtio_pci.h
@@ -264,6 +264,8 @@ struct virtio_hw {
 	struct virtio_net_config *dev_cfg;
 	const struct virtio_pci_ops *vtpci_ops;
 	void	    *virtio_user_dev;
+
+	struct virtqueue **vqs;
 };
 
 /*
diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c
index b4c4aa4..fb703d2 100644
--- a/drivers/net/virtio/virtio_rxtx.c
+++ b/drivers/net/virtio/virtio_rxtx.c
@@ -530,24 +530,24 @@ int
 virtio_dev_rx_queue_setup(struct rte_eth_dev *dev,
 			uint16_t queue_idx,
 			uint16_t nb_desc,
-			unsigned int socket_id,
+			unsigned int socket_id __rte_unused,
 			__rte_unused const struct rte_eth_rxconf *rx_conf,
 			struct rte_mempool *mp)
 {
 	uint16_t vtpci_queue_idx = 2 * queue_idx + VTNET_SQ_RQ_QUEUE_IDX;
+	struct virtio_hw *hw = dev->data->dev_private;
+	struct virtqueue *vq = hw->vqs[vtpci_queue_idx];
 	struct virtnet_rx *rxvq;
-	int ret;
 
 	PMD_INIT_FUNC_TRACE();
-	ret = virtio_dev_queue_setup(dev, VTNET_RQ, queue_idx, vtpci_queue_idx,
-			nb_desc, socket_id, (void **)&rxvq);
-	if (ret < 0) {
-		PMD_INIT_LOG(ERR, "rvq initialization failed");
-		return ret;
-	}
 
-	/* Create mempool for rx mbuf allocation */
+	if (nb_desc == 0 || nb_desc > vq->vq_nentries)
+		nb_desc = vq->vq_nentries;
+	vq->vq_free_cnt = RTE_MIN(vq->vq_free_cnt, nb_desc);
+
+	rxvq = &vq->rxq;
 	rxvq->mpool = mp;
+	rxvq->queue_id = queue_idx;
 
 	dev->data->rx_queues[queue_idx] = rxvq;
 
@@ -613,27 +613,25 @@ int
 virtio_dev_tx_queue_setup(struct rte_eth_dev *dev,
 			uint16_t queue_idx,
 			uint16_t nb_desc,
-			unsigned int socket_id,
+			unsigned int socket_id __rte_unused,
 			const struct rte_eth_txconf *tx_conf)
 {
 	uint8_t vtpci_queue_idx = 2 * queue_idx + VTNET_SQ_TQ_QUEUE_IDX;
+	struct virtio_hw *hw = dev->data->dev_private;
+	struct virtqueue *vq = hw->vqs[vtpci_queue_idx];
 	struct virtnet_tx *txvq;
-	struct virtqueue *vq;
 	uint16_t tx_free_thresh;
-	int ret;
 
 	PMD_INIT_FUNC_TRACE();
 
-
 	virtio_update_rxtx_handler(dev, tx_conf);
 
-	ret = virtio_dev_queue_setup(dev, VTNET_TQ, queue_idx, vtpci_queue_idx,
-			nb_desc, socket_id, (void **)&txvq);
-	if (ret < 0) {
-		PMD_INIT_LOG(ERR, "tvq initialization failed");
-		return ret;
-	}
-	vq = txvq->vq;
+	if (nb_desc == 0 || nb_desc > vq->vq_nentries)
+		nb_desc = vq->vq_nentries;
+	vq->vq_free_cnt = RTE_MIN(vq->vq_free_cnt, nb_desc);
+
+	txvq = &vq->txq;
+	txvq->queue_id = queue_idx;
 
 	tx_free_thresh = tx_conf->tx_free_thresh;
 	if (tx_free_thresh == 0)
-- 
1.9.0

^ permalink raw reply related

* [PATCH 3/8] net/virtio: simplify queue allocation
From: Yuanhan Liu @ 2016-11-03 16:09 UTC (permalink / raw)
  To: dev; +Cc: Ilya Maximets
In-Reply-To: <1478189400-14606-1-git-send-email-yuanhan.liu@linux.intel.com>

Let rxq/txq/cq be the union field of the virtqueue struct. This would
simplifies the vq allocation a bit: we don't need calculate the vq_size
any more based on the queue time.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
---
 drivers/net/virtio/virtio_ethdev.c | 18 +++++++-----------
 drivers/net/virtio/virtqueue.h     |  7 +++++++
 2 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index d082df5..5a2c14b 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -312,7 +312,7 @@ int virtio_dev_queue_setup(struct rte_eth_dev *dev,
 	struct virtnet_tx *txvq = NULL;
 	struct virtnet_ctl *cvq = NULL;
 	struct virtqueue *vq;
-	size_t sz_vq, sz_q = 0, sz_hdr_mz = 0;
+	size_t sz_hdr_mz = 0;
 	void *sw_ring = NULL;
 	int ret;
 
@@ -337,25 +337,21 @@ int virtio_dev_queue_setup(struct rte_eth_dev *dev,
 	snprintf(vq_name, sizeof(vq_name), "port%d_vq%d",
 		 dev->data->port_id, vtpci_queue_idx);
 
-	sz_vq = RTE_ALIGN_CEIL(sizeof(*vq) +
+	size = RTE_ALIGN_CEIL(sizeof(*vq) +
 				vq_size * sizeof(struct vq_desc_extra),
 				RTE_CACHE_LINE_SIZE);
-	if (queue_type == VTNET_RQ) {
-		sz_q = sz_vq + sizeof(*rxvq);
-	} else if (queue_type == VTNET_TQ) {
-		sz_q = sz_vq + sizeof(*txvq);
+	if (queue_type == VTNET_TQ) {
 		/*
 		 * For each xmit packet, allocate a virtio_net_hdr
 		 * and indirect ring elements
 		 */
 		sz_hdr_mz = vq_size * sizeof(struct virtio_tx_region);
 	} else if (queue_type == VTNET_CQ) {
-		sz_q = sz_vq + sizeof(*cvq);
 		/* Allocate a page for control vq command, data and status */
 		sz_hdr_mz = PAGE_SIZE;
 	}
 
-	vq = rte_zmalloc_socket(vq_name, sz_q, RTE_CACHE_LINE_SIZE, socket_id);
+	vq = rte_zmalloc_socket(vq_name, size, RTE_CACHE_LINE_SIZE, socket_id);
 	if (vq == NULL) {
 		PMD_INIT_LOG(ERR, "can not allocate vq");
 		return -ENOMEM;
@@ -425,14 +421,14 @@ int virtio_dev_queue_setup(struct rte_eth_dev *dev,
 		}
 
 		vq->sw_ring = sw_ring;
-		rxvq = (struct virtnet_rx *)RTE_PTR_ADD(vq, sz_vq);
+		rxvq = &vq->rxq;
 		rxvq->vq = vq;
 		rxvq->port_id = dev->data->port_id;
 		rxvq->queue_id = queue_idx;
 		rxvq->mz = mz;
 		*pvq = rxvq;
 	} else if (queue_type == VTNET_TQ) {
-		txvq = (struct virtnet_tx *)RTE_PTR_ADD(vq, sz_vq);
+		txvq = &vq->txq;
 		txvq->vq = vq;
 		txvq->port_id = dev->data->port_id;
 		txvq->queue_id = queue_idx;
@@ -442,7 +438,7 @@ int virtio_dev_queue_setup(struct rte_eth_dev *dev,
 
 		*pvq = txvq;
 	} else if (queue_type == VTNET_CQ) {
-		cvq = (struct virtnet_ctl *)RTE_PTR_ADD(vq, sz_vq);
+		cvq = &vq->cq;
 		cvq->vq = vq;
 		cvq->mz = mz;
 		cvq->virtio_net_hdr_mz = hdr_mz;
diff --git a/drivers/net/virtio/virtqueue.h b/drivers/net/virtio/virtqueue.h
index ef0027b..bbeb2f2 100644
--- a/drivers/net/virtio/virtqueue.h
+++ b/drivers/net/virtio/virtqueue.h
@@ -44,6 +44,7 @@
 #include "virtio_pci.h"
 #include "virtio_ring.h"
 #include "virtio_logs.h"
+#include "virtio_rxtx.h"
 
 struct rte_mbuf;
 
@@ -191,6 +192,12 @@ struct virtqueue {
 	void *vq_ring_virt_mem;  /**< linear address of vring*/
 	unsigned int vq_ring_size;
 
+	union {
+		struct virtnet_rx rxq;
+		struct virtnet_tx txq;
+		struct virtnet_ctl cq;
+	};
+
 	phys_addr_t vq_ring_mem; /**< physical address of vring,
 				  * or virtual address for virtio_user. */
 
-- 
1.9.0

^ permalink raw reply related

* [PATCH 2/8] net/virtio: simplify queue memzone name
From: Yuanhan Liu @ 2016-11-03 16:09 UTC (permalink / raw)
  To: dev; +Cc: Ilya Maximets
In-Reply-To: <1478189400-14606-1-git-send-email-yuanhan.liu@linux.intel.com>

Instead of setting up a queue memzone name like "port0_rxq0", "port0_txq0",
it could be simplified a bit to something like "port0_vq0", "port0_vq1" ...

Meanwhile, the code is also simplified a bit.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
---
 drivers/net/virtio/virtio_ethdev.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 5815875..d082df5 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -312,7 +312,6 @@ int virtio_dev_queue_setup(struct rte_eth_dev *dev,
 	struct virtnet_tx *txvq = NULL;
 	struct virtnet_ctl *cvq = NULL;
 	struct virtqueue *vq;
-	const char *queue_names[] = {"rvq", "txq", "cvq"};
 	size_t sz_vq, sz_q = 0, sz_hdr_mz = 0;
 	void *sw_ring = NULL;
 	int ret;
@@ -335,8 +334,8 @@ int virtio_dev_queue_setup(struct rte_eth_dev *dev,
 		return -EINVAL;
 	}
 
-	snprintf(vq_name, sizeof(vq_name), "port%d_%s%d",
-		 dev->data->port_id, queue_names[queue_type], queue_idx);
+	snprintf(vq_name, sizeof(vq_name), "port%d_vq%d",
+		 dev->data->port_id, vtpci_queue_idx);
 
 	sz_vq = RTE_ALIGN_CEIL(sizeof(*vq) +
 				vq_size * sizeof(struct vq_desc_extra),
@@ -398,9 +397,8 @@ int virtio_dev_queue_setup(struct rte_eth_dev *dev,
 		     (uint64_t)(uintptr_t)mz->addr);
 
 	if (sz_hdr_mz) {
-		snprintf(vq_hdr_name, sizeof(vq_hdr_name), "port%d_%s%d_hdr",
-			 dev->data->port_id, queue_names[queue_type],
-			 queue_idx);
+		snprintf(vq_hdr_name, sizeof(vq_hdr_name), "port%d_vq%d_hdr",
+			 dev->data->port_id, vtpci_queue_idx);
 		hdr_mz = rte_memzone_reserve_aligned(vq_hdr_name, sz_hdr_mz,
 						     socket_id, 0,
 						     RTE_CACHE_LINE_SIZE);
-- 
1.9.0

^ permalink raw reply related

* [PATCH 0/8] net/virtio: fix queue reconfigure issue
From: Yuanhan Liu @ 2016-11-03 16:09 UTC (permalink / raw)
  To: dev; +Cc: Ilya Maximets

This patchset fixes an issue (virtio/vhost become broken when queue setup
is done 2 or more times, check patch 2 for great details) reported by Ilya
at the late stage of last release. I sensed it would be some amounts of
code work, that I delayed it to this release. However, I failed to make
the fix in the early stage of this release, that we come to the same
situation again: we are being at the late stage of v16.11 :(

However, honestly, I don't want to miss it again in this release, as it
is hard to backport such fix to a stable release. It's not a bug can
be fixed by few lines of code. The virtio init logic is quite wrong that
I need change quite many places to fix it. Meanwhile, I have done my best
to keep the change being as minimal as possible.

Besides that, judging that v16.11 would be a LTS and it's such an severe
bug that should be fixed ASAP (at least, we should make it work in a LTS
release), I then tried hard today to make this patchset, with the hope we
could fix this severe issue at this release.

The issue is decribed in length in patch 4 "net/virtio: allocate queue
at init stage".

Again, it's not a bug can be fixed by one patch, that you see no one
"fix" tag in none of those patches. All below patches work together
to fix this issue.

Thanks.

	--yliu


---
Yuanhan Liu (8):
  net/virtio: revert "virtio: fix restart"
  net/virtio: simplify queue memzone name
  net/virtio: simplify queue allocation
  net/virtio: allocate queue at init stage
  net/virtio: initiate vring at init stage
  net/virtio: move queue configure code to proper place
  net/virtio: complete init stage at the right place
  net/virtio: remove started field

 drivers/net/virtio/virtio_ethdev.c | 182 ++++++++++++++++-----------
 drivers/net/virtio/virtio_ethdev.h |  10 --
 drivers/net/virtio/virtio_pci.h    |   3 +-
 drivers/net/virtio/virtio_rxtx.c   | 247 ++++++++++++++-----------------------
 drivers/net/virtio/virtqueue.h     |   7 ++
 5 files changed, 208 insertions(+), 241 deletions(-)

-- 
1.9.0

^ permalink raw reply

* [PATCH v2] doc: add mlx5 release notes
From: Nelio Laranjeiro @ 2016-11-03 13:45 UTC (permalink / raw)
  To: dev
In-Reply-To: <8b00bfb65b838183261f5c94202665a3bb14ff17.1478094292.git.nelio.laranjeiro@6wind.com>

Add list of tested and validated NICs too.

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
---
 doc/guides/rel_notes/release_16_11.rst | 122 +++++++++++++++++++++++++++++++++
 1 file changed, 122 insertions(+)

diff --git a/doc/guides/rel_notes/release_16_11.rst b/doc/guides/rel_notes/release_16_11.rst
index aa0c09a..e33d454 100644
--- a/doc/guides/rel_notes/release_16_11.rst
+++ b/doc/guides/rel_notes/release_16_11.rst
@@ -131,6 +131,13 @@ New Features
   The GCC 4.9 ``-march`` option supports the Intel processor code names.
   The config option ``RTE_MACHINE`` can be used to pass code names to the compiler as ``-march`` flag.
 
+* **Updated the mlx5 driver.**
+
+  The following changes were made to mlx5:
+
+  * Add support for RSS hash result
+  * Several performance improvements
+  * Several bug fixes
 
 Resolved Issues
 ---------------
@@ -277,6 +284,24 @@ Tested Platforms
    This section is a comment. Make sure to start the actual text at the margin.
 
 
+#. Intel(R) Server board S2600WTT
+
+   - Processor: Intel(R) Xeon(R) CPU E5-2697 v2 @ 2.70GHz
+
+#. Intel(R) Server
+
+   - Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz
+
+#. Intel(R) Server
+
+   - Intel(R) Xeon(R) CPU E5-2697 v3 @ 2.60GHz
+
+#. IBM(R) Power8(R)
+
+   - Machine type-model: 8247-22L
+   - Firmware FW810.21 (SV810_108)
+   - Processor: POWER8E (raw), AltiVec supported
+
 Tested NICs
 -----------
 
@@ -291,6 +316,96 @@ Tested NICs
 
    This section is a comment. Make sure to start the actual text at the margin.
 
+#. Mellanox(R) ConnectX(R)-4 10G MCX4111A-XCAT (1x10G)
+
+   * Host interface: PCI Express 3.0 x8
+   * Device ID: 15b3:1013
+   * MLNX_OFED: 3.4-1.0.0.0
+   * Firmware version: 12.17.1010
+
+#. Mellanox(R) ConnectX(R)-4 10G MCX4121A-XCAT (2x10G)
+
+   * Host interface: PCI Express 3.0 x8
+   * Device ID: 15b3:1013
+   * MLNX_OFED: 3.4-1.0.0.0
+   * Firmware version: 12.17.1010
+
+#. Mellanox(R) ConnectX(R)-4 25G MCX4111A-ACAT (1x25G)
+
+   * Host interface: PCI Express 3.0 x8
+   * Device ID: 15b3:1013
+   * MLNX_OFED: 3.4-1.0.0.0
+   * Firmware version: 12.17.1010
+
+#. Mellanox(R) ConnectX(R)-4 25G MCX4121A-ACAT (2x25G)
+
+   * Host interface: PCI Express 3.0 x8
+   * Device ID: 15b3:1013
+   * MLNX_OFED: 3.4-1.0.0.0
+   * Firmware version: 12.17.1010
+
+#. Mellanox(R) ConnectX(R)-4 40G MCX4131A-BCAT/MCX413A-BCAT (1x40G)
+
+   * Host interface: PCI Express 3.0 x8
+   * Device ID: 15b3:1013
+   * MLNX_OFED: 3.4-1.0.0.0
+   * Firmware version: 12.17.1010
+
+#. Mellanox(R) ConnectX(R)-4 40G MCX415A-BCAT (1x40G)
+
+   * Host interface: PCI Express 3.0 x16
+   * Device ID: 15b3:1013
+   * MLNX_OFED: 3.4-1.0.0.0
+   * Firmware version: 12.17.1010
+
+#. Mellanox(R) ConnectX(R)-4 50G MCX4131A-GCAT/MCX413A-GCAT (1x50G)
+
+   * Host interface: PCI Express 3.0 x8
+   * Device ID: 15b3:1013
+   * MLNX_OFED: 3.4-1.0.0.0
+   * Firmware version: 12.17.1010
+
+#. Mellanox(R) ConnectX(R)-4 50G MCX414A-BCAT (2x50G)
+
+   * Host interface: PCI Express 3.0 x8
+   * Device ID: 15b3:1013
+   * MLNX_OFED: 3.4-1.0.0.0
+   * Firmware version: 12.17.1010
+
+#. Mellanox(R) ConnectX(R)-4 50G MCX415A-GCAT/MCX416A-BCAT/MCX416A-GCAT (2x50G)
+
+   * Host interface: PCI Express 3.0 x16
+   * Device ID: 15b3:1013
+   * MLNX_OFED: 3.4-1.0.0.0
+   * Firmware version: 12.17.1010
+
+#. Mellanox(R) ConnectX(R)-4 50G MCX415A-CCAT (1x100G)
+
+   * Host interface: PCI Express 3.0 x16
+   * Device ID: 15b3:1013
+   * MLNX_OFED: 3.4-1.0.0.0
+   * Firmware version: 12.17.1010
+
+#. Mellanox(R) ConnectX(R)-4 100G MCX416A-CCAT (2x100G)
+
+   * Host interface: PCI Express 3.0 x16
+   * Device ID: 15b3:1013
+   * MLNX_OFED: 3.4-1.0.0.0
+   * Firmware version: 12.17.1010
+
+#. Mellanox(R) ConnectX(R)-4 Lx 10G MCX4121A-XCAT (2x10G)
+
+   * Host interface: PCI Express 3.0 x8
+   * Device ID: 15b3:1015
+   * MLNX_OFED: 3.4-1.0.0.0
+   * Firmware version: 14.17.1010
+
+#. Mellanox(R) ConnectX(R)-4 Lx 25G MCX4121A-ACAT (2x25G)
+
+   * Host interface: PCI Express 3.0 x8
+   * Device ID: 15b3:1015
+   * MLNX_OFED: 3.4-1.0.0.0
+   * Firmware version: 14.17.1010
 
 Tested OSes
 -----------
@@ -309,3 +424,10 @@ Tested OSes
    * Wind River Linux 8
 
    This section is a comment. Make sure to start the actual text at the margin.
+
+* Red Hat Enterprise Linux Server release 6.7 (Santiago)
+* Red Hat Enterprise Linux Server release 7.0 (Maipo)
+* Red Hat Enterprise Linux Server release 7.2 (Maipo)
+* Wind River Linux 6.0.0.26
+* Ubuntu 14.04
+* Ubuntu 15.04
-- 
2.1.4

^ permalink raw reply related

* Re: [PATCH] net/i40e: fix floating VEB issue
From: Wu, Jingjing @ 2016-11-03 13:14 UTC (permalink / raw)
  To: Xing, Beilei; +Cc: dev@dpdk.org
In-Reply-To: <1478165186-10238-1-git-send-email-beilei.xing@intel.com>



> -----Original Message-----
> From: Xing, Beilei
> Sent: Thursday, November 3, 2016 5:26 PM
> To: Wu, Jingjing <jingjing.wu@intel.com>
> Cc: dev@dpdk.org; Xing, Beilei <beilei.xing@intel.com>
> Subject: [PATCH] net/i40e: fix floating VEB issue
> 
> Turning off S-TAG identification will impact floating VEB,
> VFs can't communicate with each other.
> This patch fixes this issue by judging whether floating
> VEB is enabled, S-TAG identification will be turned off
> only when floating VEB is disabled.
> 
> Fixes: 4d61120d5ce7 ("net/i40e: fix dropping packets with ethertype 0x88A8")
> 
> Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>

^ permalink raw reply

* Issues binding 82545EM to igb_uio on Centos 6.5 + DPDK 16.07
From: Sruthi Yellamraju @ 2016-11-03 13:02 UTC (permalink / raw)
  To: dev

Hi,

I have a 82545EM NIC running e1000 driver on a VM running Centos 6.5 build
(2.6.32-431.20.3.el6.x86_64) (See lspci O/p). I am using dpdk-16.07 and
when i try binding this device to igb_uio, its giving me the following
error. Any pointers? I was able to get other drivers fm10k, e1000e to work
with this kernel version, but not e1000.

#dpdk-devbind -b igb_uio 0000:02:01.0
Error: bind failed for 0000:02:01.0 - Cannot bind to driver igb_uio

dmesg shows:

Nov  3 08:57:16 vm-sensor-test1 kernel: igb_uio 0000:02:01.0: PCI INT A ->
GSI 19 (level, low) -> IRQ 19
Nov  3 08:57:16 vm-sensor-test1 kernel: igb_uio 0000:02:01.0: setting
latency timer to 64
Nov  3 08:57:16 vm-sensor-test1 kernel: igb_uio 0000:02:01.0: PCI INTX mask
not supported
Nov  3 08:57:16 vm-sensor-test1 kernel: IRQ handler type mismatch for IRQ 0
Nov  3 08:57:16 vm-sensor-test1 kernel: current handler: timer
Nov  3 08:57:16 vm-sensor-test1 kernel: Pid: 3976, comm: dpdk-devbind Not
tainted 2.6.32-431.20.3.el6.x86_64 #1
Nov  3 08:57:16 vm-sensor-test1 kernel: Call Trace:
Nov  3 08:57:16 vm-sensor-test1 kernel: [<ffffffff810e7dd2>] ?
__setup_irq+0x382/0x3c0
Nov  3 08:57:16 vm-sensor-test1 kernel: [<ffffffffa00692b0>] ?
uio_interrupt+0x0/0x48 [uio]
Nov  3 08:57:16 vm-sensor-test1 kernel: [<ffffffff810e85d3>] ?
request_threaded_irq+0x133/0x230
Nov  3 08:57:16 vm-sensor-test1 kernel: [<ffffffffa00691ce>] ?
__uio_register_device+0x58e/0x620 [uio]
Nov  3 08:57:16 vm-sensor-test1 kernel: [<ffffffffa003269c>] ?
igbuio_pci_probe+0x3e1/0x500 [igb_uio]
Nov  3 08:57:16 vm-sensor-test1 kernel: [<ffffffff81284f9a>] ?
kobject_get+0x1a/0x30
Nov  3 08:57:16 vm-sensor-test1 kernel: [<ffffffff812a5747>] ?
local_pci_probe+0x17/0x20
Nov  3 08:57:16 vm-sensor-test1 kernel: [<ffffffff812a6931>] ?
pci_device_probe+0x101/0x120
Nov  3 08:57:16 vm-sensor-test1 kernel: [<ffffffff8136e102>] ?
driver_sysfs_add+0x62/0x90
Nov  3 08:57:16 vm-sensor-test1 kernel: [<ffffffff8136e2a0>] ?
driver_probe_device+0xa0/0x2a0
Nov  3 08:57:16 vm-sensor-test1 kernel: [<ffffffff8136e54b>] ?
__driver_attach+0xab/0xb0
Nov  3 08:57:16 vm-sensor-test1 kernel: [<ffffffff8136e4a0>] ?
__driver_attach+0x0/0xb0
Nov  3 08:57:16 vm-sensor-test1 kernel: [<ffffffff8136d854>] ?
bus_for_each_dev+0x64/0x90
Nov  3 08:57:16 vm-sensor-test1 kernel: [<ffffffff8136e03e>] ?
driver_attach+0x1e/0x20
Nov  3 08:57:16 vm-sensor-test1 kernel: [<ffffffff812a6cd7>] ?
pci_add_dynid+0xc7/0xf0
Nov  3 08:57:16 vm-sensor-test1 kernel: [<ffffffff812a6dd2>] ?
store_new_id+0xd2/0x110
Nov  3 08:57:16 vm-sensor-test1 kernel: [<ffffffff8136c87c>] ?
drv_attr_store+0x2c/0x30
Nov  3 08:57:16 vm-sensor-test1 kernel: [<ffffffff81204685>] ?
sysfs_write_file+0xe5/0x170
Nov  3 08:57:16 vm-sensor-test1 kernel: [<ffffffff81188df8>] ?
vfs_write+0xb8/0x1a0
Nov  3 08:57:16 vm-sensor-test1 kernel: [<ffffffff811896f1>] ?
sys_write+0x51/0x90
Nov  3 08:57:16 vm-sensor-test1 kernel: [<ffffffff8100b072>] ?
system_call_fastpath+0x16/0x1b
Nov  3 08:57:16 vm-sensor-test1 kernel: igb_uio 0000:02:01.0: PCI INT A
disabled
Nov  3 08:57:16 vm-sensor-test1 kernel: igb_uio: probe of 0000:02:01.0
failed with error -16
Nov  3 08:57:16 vm-sensor-test1 kernel: igb_uio 0000:02:01.0: PCI INT A ->
GSI 19 (level, low) -> IRQ 19
Nov  3 08:57:16 vm-sensor-test1 kernel: igb_uio 0000:02:01.0: setting
latency timer to 64
Nov  3 08:57:16 vm-sensor-test1 kernel: igb_uio 0000:02:01.0: PCI INTX mask
not supported
Nov  3 08:57:16 vm-sensor-test1 kernel: IRQ handler type mismatch for IRQ 0
Nov  3 08:57:16 vm-sensor-test1 kernel: current handler: timer
Nov  3 08:57:16 vm-sensor-test1 kernel: Pid: 3976, comm: dpdk-devbind Not
tainted 2.6.32-431.20.3.el6.x86_64 #1
Nov  3 08:57:16 vm-sensor-test1 kernel: Call Trace:
Nov  3 08:57:16 vm-sensor-test1 kernel: [<ffffffff810e7dd2>] ?
__setup_irq+0x382/0x3c0
Nov  3 08:57:16 vm-sensor-test1 kernel: [<ffffffffa00692b0>] ?
uio_interrupt+0x0/0x48 [uio]
Nov  3 08:57:16 vm-sensor-test1 kernel: [<ffffffff810e85d3>] ?
request_threaded_irq+0x133/0x230
Nov  3 08:57:16 vm-sensor-test1 kernel: [<ffffffffa00691ce>] ?
__uio_register_device+0x58e/0x620 [uio]
Nov  3 08:57:16 vm-sensor-test1 kernel: [<ffffffffa003269c>] ?
igbuio_pci_probe+0x3e1/0x500 [igb_uio]
Nov  3 08:57:16 vm-sensor-test1 kernel: [<ffffffff81284f9a>] ?
kobject_get+0x1a/0x30
Nov  3 08:57:16 vm-sensor-test1 kernel: [<ffffffff812a5747>] ?
local_pci_probe+0x17/0x20
Nov  3 08:57:16 vm-sensor-test1 kernel: [<ffffffff812a6931>] ?
pci_device_probe+0x101/0x120
Nov  3 08:57:16 vm-sensor-test1 kernel: [<ffffffff8136e102>] ?
driver_sysfs_add+0x62/0x90
Nov  3 08:57:16 vm-sensor-test1 kernel: [<ffffffff8136e2a0>] ?
driver_probe_device+0xa0/0x2a0
Nov  3 08:57:16 vm-sensor-test1 kernel: [<ffffffff8136d7aa>] ?
driver_bind+0xca/0x110
Nov  3 08:57:16 vm-sensor-test1 kernel: [<ffffffff8136c87c>] ?
drv_attr_store+0x2c/0x30
Nov  3 08:57:16 vm-sensor-test1 kernel: [<ffffffff81204685>] ?
sysfs_write_file+0xe5/0x170
Nov  3 08:57:16 vm-sensor-test1 kernel: [<ffffffff81188df8>] ?
vfs_write+0xb8/0x1a0
Nov  3 08:57:16 vm-sensor-test1 kernel: [<ffffffff811896f1>] ?
sys_write+0x51/0x90
Nov  3 08:57:16 vm-sensor-test1 kernel: [<ffffffff8100b072>] ?
system_call_fastpath+0x16/0x1b
Nov  3 08:57:16 vm-sensor-test1 kernel: igb_uio 0000:02:01.0: PCI INT A
disabled
Nov  3 08:57:16 vm-sensor-test1 kernel: igb_uio: probe of 0000:02:01.0
failed with error -16

lspci o/p
=======
02:01.0 Ethernet controller: Intel Corporation 82545EM Gigabit Ethernet
Controller (Copper) (rev 01)
        Subsystem: VMware PRO/1000 MT Single Port Adapter
        Physical Slot: 33
        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr-
Stepping- SERR+ FastB2B- DisINTx-
        Status: Cap+ 66MHz+ UDF- FastB2B- ParErr- DEVSEL=medium >TAbort-
<TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 0 (63750ns min), Cache Line Size: 64 bytes
        Interrupt: pin A routed to IRQ 19
        Region 0: Memory at fd5c0000 (64-bit, non-prefetchable) [size=128K]
        Region 2: Memory at fdff0000 (64-bit, non-prefetchable) [size=64K]
        Region 4: I/O ports at 2000 [size=64]
        [virtual] Expansion ROM at e7b00000 [disabled] [size=64K]
        Capabilities: [dc] Power Management version 2
                Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA
PME(D0+,D1-,D2-,D3hot+,D3cold+)
                Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=1 PME-
        Capabilities: [e4] PCI-X non-bridge device
                Command: DPERE- ERO+ RBC=512 OST=1
                Status: Dev=ff:1f.0 64bit+ 133MHz+ SCD- USC- DC=simple
DMMRBC=2048 DMOST=1 DMCRS=16 RSCEM- 266MHz- 533MHz-
        Kernel driver in use: e1000
        Kernel modules: e1000

^ permalink raw reply

* Re: [PATCH] doc: ZUC PMD cannot be built as a shared library
From: Mcnamara, John @ 2016-11-03 12:48 UTC (permalink / raw)
  To: De Lara Guarch, Pablo, dev@dpdk.org
In-Reply-To: <1476387303-238224-1-git-send-email-pablo.de.lara.guarch@intel.com>



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Pablo de Lara
> Sent: Thursday, October 13, 2016 8:35 PM
> To: dev@dpdk.org
> Cc: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>
> Subject: [dpdk-dev] [PATCH] doc: ZUC PMD cannot be built as a shared
> library
> 
> ZUC PMD cannot be built as a shared library, due to the fact that some
> assembly code in the underlying libsso library is not relocatable.
> This will be fixed in the future, but for the moment, it is added as a
> limitation of the PMD.
> 
> Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

Acked-by: John McNamara <john.mcnamara@intel.com>

^ permalink raw reply

* Re: [PATCH 2/2] doc: add mlx5 release notes
From: Nélio Laranjeiro @ 2016-11-03 12:48 UTC (permalink / raw)
  To: Mcnamara, John; +Cc: dev@dpdk.org
In-Reply-To: <B27915DBBA3421428155699D51E4CFE20264A0CE@IRSMSX103.ger.corp.intel.com>

On Thu, Nov 03, 2016 at 12:25:47PM +0000, Mcnamara, John wrote:
> > -----Original Message-----
> > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Nelio Laranjeiro
> > Sent: Wednesday, November 2, 2016 1:47 PM
> > To: dev@dpdk.org
> > Subject: [dpdk-dev] [PATCH 2/2] doc: add mlx5 release notes
> > 
> > ...
> > 
> > -   This section is a comment. Make sure to start the actual text at the margin.
> > +#. Mellanox(R) ConnectX(R)-4 25G MCX4111A-ACAT (1x25G)
> 
> Release note patches shouldn't remove or overwrite the comments sections.

Ok, I will re-send a v2.

Thanks.

-- 
Nélio Laranjeiro
6WIND

^ permalink raw reply

* Re: [PATCH] doc: how to build KASUMI as shared library
From: Mcnamara, John @ 2016-11-03 12:48 UTC (permalink / raw)
  To: De Lara Guarch, Pablo, dev@dpdk.org
In-Reply-To: <1476387252-238163-1-git-send-email-pablo.de.lara.guarch@intel.com>



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Pablo de Lara
> Sent: Thursday, October 13, 2016 8:34 PM
> To: dev@dpdk.org
> Cc: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>
> Subject: [dpdk-dev] [PATCH] doc: how to build KASUMI as shared library
> 
> Libsso KASUMI library has to be built with specific parameters to make the
> KASUMI PMD be built as a shared library, so a note has been added in its
> documentation.
> 
> Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

Acked-by: John McNamara <john.mcnamara@intel.com>

^ permalink raw reply

* Re: [PATCH] doc: fix libcrypto title
From: Mcnamara, John @ 2016-11-03 12:48 UTC (permalink / raw)
  To: De Lara Guarch, Pablo, dev@dpdk.org
In-Reply-To: <1476387229-238098-1-git-send-email-pablo.de.lara.guarch@intel.com>



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Pablo de Lara
> Sent: Thursday, October 13, 2016 8:34 PM
> To: dev@dpdk.org
> Cc: De Lara Guarch, Pablo <pablo.de.lara.guarch@intel.com>
> Subject: [dpdk-dev] [PATCH] doc: fix libcrypto title
> 
> Libcrypto documentation was missing the equal signs ("="), in its title,
> so it was not present in the documentation generated.
> 
> Fixes: d61f70b4c918 ("crypto/libcrypto: add driver for OpenSSL library")
> 
> Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>

Acked-by: John McNamara <john.mcnamara@intel.com>

^ permalink raw reply

* Re: [PATCH v1 2/2] doc: update poll mode driver guide
From: Mcnamara, John @ 2016-11-03 12:46 UTC (permalink / raw)
  To: Iremonger, Bernard, dev@dpdk.org
In-Reply-To: <1476462909-14891-3-git-send-email-bernard.iremonger@intel.com>



> -----Original Message-----
> From: Iremonger, Bernard
> Sent: Friday, October 14, 2016 5:35 PM
> To: dev@dpdk.org; Mcnamara, John <john.mcnamara@intel.com>
> Cc: Iremonger, Bernard <bernard.iremonger@intel.com>
> Subject: [PATCH v1 2/2] doc: update poll mode driver guide
> 
> add information about new ixgbe PMD API.
> 
> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>

Acked-by: John McNamara <john.mcnamara@intel.com>

^ permalink raw reply

* Re: [PATCH v1 1/2] doc: update ixgbe guide
From: Mcnamara, John @ 2016-11-03 12:46 UTC (permalink / raw)
  To: Iremonger, Bernard, dev@dpdk.org
In-Reply-To: <1476462909-14891-2-git-send-email-bernard.iremonger@intel.com>



> -----Original Message-----
> From: Iremonger, Bernard
> Sent: Friday, October 14, 2016 5:35 PM
> To: dev@dpdk.org; Mcnamara, John <john.mcnamara@intel.com>
> Cc: Iremonger, Bernard <bernard.iremonger@intel.com>
> Subject: [PATCH v1 1/2] doc: update ixgbe guide
> 
> add information about new ixgbe PMD API.
> 
> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>

Acked-by: John McNamara <john.mcnamara@intel.com>

^ permalink raw reply

* Re: [PATCH] doc: release note for ixgbe PMD API's
From: Mcnamara, John @ 2016-11-03 12:32 UTC (permalink / raw)
  To: Iremonger, Bernard, dev@dpdk.org
In-Reply-To: <1477398282-24611-1-git-send-email-bernard.iremonger@intel.com>

> -----Original Message-----
> From: Iremonger, Bernard
> Sent: Tuesday, October 25, 2016 1:25 PM
> To: dev@dpdk.org; Mcnamara, John <john.mcnamara@intel.com>
> Cc: Iremonger, Bernard <bernard.iremonger@intel.com>
> Subject: [PATCH] doc: release note for ixgbe PMD API's
> 
> Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>

Acked-by: John McNamara <john.mcnamara@intel.com>

^ permalink raw reply

* Re: [PATCH v2] doc: arm64: document DPDK application profiling methods
From: Mcnamara, John @ 2016-11-03 12:30 UTC (permalink / raw)
  To: Thomas Monjalon, Jerin Jacob; +Cc: dev@dpdk.org, viktorin@rehivetech.com
In-Reply-To: <1695172.8HmTq10QNC@xps13>

> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> Sent: Wednesday, October 26, 2016 9:07 PM
> To: Jerin Jacob <jerin.jacob@caviumnetworks.com>; Mcnamara, John
> <john.mcnamara@intel.com>
> Cc: dev@dpdk.org; jianbo.liu@linaro.org; viktorin@rehivetech.com
> Subject: Re: [dpdk-dev] [PATCH v2] doc: arm64: document DPDK application
> profiling methods
> 
> 2016-10-05 14:13, Jerin Jacob:
> > Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
> > ---
> > v2:
> > -Addressed ARM64 specific review comments(Suggested by Thomas)
> 
> I feel more comments could be done, especially about formatting.
> You are adding a chapter Introduction without any other section of the
> same level.
> Some technical terms should be enclosed in backquotes.
> 
> Please John, could you guide Jerin or provide an updated version?

Will do.

^ permalink raw reply

* Re: [PATCH] doc: remove Intel reference from multi-process support guide
From: Mcnamara, John @ 2016-11-03 12:30 UTC (permalink / raw)
  To: Jerin Jacob, dev@dpdk.org
In-Reply-To: <1477548679-17356-1-git-send-email-jerin.jacob@caviumnetworks.com>



> -----Original Message-----
> From: Jerin Jacob [mailto:jerin.jacob@caviumnetworks.com]
> Sent: Thursday, October 27, 2016 7:11 AM
> To: dev@dpdk.org
> Cc: thomas.monjalon@6wind.com; Mcnamara, John <john.mcnamara@intel.com>;
> Jerin Jacob <jerin.jacob@caviumnetworks.com>
> Subject: [dpdk-dev] [PATCH] doc: remove Intel reference from multi-process
> support guide
> 
> multi-process support has been verified on non IA such as ARMv8.
> 
> Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

Acked-by: John McNamara <john.mcnamara@intel.com>

^ permalink raw reply

* Re: [PATCH] doc: add missing library to release notes
From: Mcnamara, John @ 2016-11-03 12:28 UTC (permalink / raw)
  To: Yigit, Ferruh, dev@dpdk.org
In-Reply-To: <20161101170331.27813-1-ferruh.yigit@intel.com>

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Ferruh Yigit
> Sent: Tuesday, November 1, 2016 5:04 PM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH] doc: add missing library to release notes
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> ---
> CC: Olivier Matz <olivier.matz@6wind.com>


Acked-by: John McNamara <john.mcnamara@intel.com>

^ permalink raw reply

* Re: [PATCH 2/2] doc: add mlx5 release notes
From: Mcnamara, John @ 2016-11-03 12:25 UTC (permalink / raw)
  To: Nelio Laranjeiro, dev@dpdk.org
In-Reply-To: <8b00bfb65b838183261f5c94202665a3bb14ff17.1478094292.git.nelio.laranjeiro@6wind.com>

> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Nelio Laranjeiro
> Sent: Wednesday, November 2, 2016 1:47 PM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH 2/2] doc: add mlx5 release notes
> 
> ...
> 
> -   This section is a comment. Make sure to start the actual text at the margin.
> +#. Mellanox(R) ConnectX(R)-4 25G MCX4111A-ACAT (1x25G)

Release note patches shouldn't remove or overwrite the comments sections.

^ permalink raw reply

* Re: [PATCH 1/2] doc: update mlx5 dependencies
From: Mcnamara, John @ 2016-11-03 12:20 UTC (permalink / raw)
  To: Nelio Laranjeiro, dev@dpdk.org
In-Reply-To: <285ae09a28a6aece6fd9d53538cbbc1aabef9922.1478094292.git.nelio.laranjeiro@6wind.com>



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Nelio Laranjeiro
> Sent: Wednesday, November 2, 2016 1:47 PM
> To: dev@dpdk.org
> Subject: [dpdk-dev] [PATCH 1/2] doc: update mlx5 dependencies
> 
> Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>

Acked-by: John McNamara <john.mcnamara@intel.com>

^ permalink raw reply

* [PATCH] examples/ipsec-secgw: fix pointer to local outside scope
From: Fan Zhang @ 2016-11-03 12:12 UTC (permalink / raw)
  To: dev
In-Reply-To: <1478175163-229116-1-git-send-email-roy.fan.zhang@intel.com>

Fixes: 0d547ed03717 ("examples/ipsec-secgw: support configuration file")
Coverity issue: 137871

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
---
 examples/ipsec-secgw/parser.c | 124 +++++++++++++++++++++---------------------
 1 file changed, 62 insertions(+), 62 deletions(-)

diff --git a/examples/ipsec-secgw/parser.c b/examples/ipsec-secgw/parser.c
index 99bdfc5..45473c7 100644
--- a/examples/ipsec-secgw/parser.c
+++ b/examples/ipsec-secgw/parser.c
@@ -503,86 +503,86 @@ parse_cfg_file(const char *cfg_filename)
 
 	do {
 		char oneline[1024];
-
+		char *pos;
 		get_s = fgets(oneline, 1024, f);
-		if (get_s) {
-			char *pos;
 
-			line_num++;
+		if (!get_s)
+			break;
 
-			if (strlen(oneline) > 1022) {
-				rte_panic("%s:%u: error: the line "
-					"contains more characters the "
-					"parser can handle\n",
-					cfg_filename, line_num);
-				goto error_exit;
-			}
+		line_num++;
 
-			/* process comment char '#' */
-			if (oneline[0] == '#')
-				continue;
+		if (strlen(oneline) > 1022) {
+			rte_panic("%s:%u: error: the line "
+				"contains more characters the "
+				"parser can handle\n",
+				cfg_filename, line_num);
+			goto error_exit;
+		}
 
-			pos = strchr(oneline, '#');
-			if (pos != NULL)
-				*pos = '\0';
-
-			/* process line concatenator '\' */
-			pos = strchr(oneline, 92);
-			if (pos != NULL) {
-				if (pos != oneline+strlen(oneline) - 2) {
-					rte_panic("%s:%u: error: no "
-						"character should exist "
-						"after '\\' symbol\n",
-						cfg_filename, line_num);
-					goto error_exit;
-				}
-
-				*pos = '\0';
-
-				if (strlen(oneline) + strlen(str) > 1022) {
-					rte_panic("%s:%u: error: the "
-						"concatenated line "
-						"contains more characters "
-						"the parser can handle\n",
-						cfg_filename, line_num);
-					goto error_exit;
-				}
-
-				strncpy(str + strlen(str), oneline,
-					strlen(oneline));
+		/* process comment char '#' */
+		if (oneline[0] == '#')
+			continue;
 
-				continue;
+		pos = strchr(oneline, '#');
+		if (pos != NULL)
+			*pos = '\0';
+
+		/* process line concatenator '\' */
+		pos = strchr(oneline, 92);
+		if (pos != NULL) {
+			if (pos != oneline+strlen(oneline) - 2) {
+				rte_panic("%s:%u: error: no "
+					"character should exist "
+					"after '\\' symbol\n",
+					cfg_filename, line_num);
+				goto error_exit;
 			}
 
-			/* copy the line to str and process */
+			*pos = '\0';
+
 			if (strlen(oneline) + strlen(str) > 1022) {
-				rte_panic("%s:%u: error: the line "
-					"contains more characters the "
-					"parser can handle\n",
+				rte_panic("%s:%u: error: the "
+					"concatenated line "
+					"contains more characters "
+					"the parser can handle\n",
 					cfg_filename, line_num);
 				goto error_exit;
 			}
+
 			strncpy(str + strlen(str), oneline,
 				strlen(oneline));
 
-			str[strlen(str)] = '\n';
-			if (cmdline_parse(cl, str) < 0) {
-				rte_panic("%s:%u: error: parsing \"%s\" "
-					"failed\n", cfg_filename,
-					line_num, str);
-				goto error_exit;
-			}
+			continue;
+		}
 
-			if (status.status < 0) {
-				rte_panic("%s:%u: error: %s",
-					cfg_filename, line_num,
-					status.parse_msg);
-				goto error_exit;
-			}
+		/* copy the line to str and process */
+		if (strlen(oneline) + strlen(str) > 1022) {
+			rte_panic("%s:%u: error: the line "
+				"contains more characters the "
+				"parser can handle\n",
+				cfg_filename, line_num);
+			goto error_exit;
+		}
+		strncpy(str + strlen(str), oneline,
+			strlen(oneline));
+
+		str[strlen(str)] = '\n';
+		if (cmdline_parse(cl, str) < 0) {
+			rte_panic("%s:%u: error: parsing \"%s\" "
+				"failed\n", cfg_filename,
+				line_num, str);
+			goto error_exit;
+		}
 
-			memset(str, 0, 1024);
+		if (status.status < 0) {
+			rte_panic("%s:%u: error: %s",
+				cfg_filename, line_num,
+				status.parse_msg);
+			goto error_exit;
 		}
-	} while (get_s != NULL);
+
+		memset(str, 0, 1024);
+	} while (1);
 
 	cmdline_stdin_exit(cl);
 	fclose(f);
-- 
2.5.5

^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox