patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH 01/10] net/virtio: fix typo in packed ring init
       [not found] <20190319064312.13743-1-tiwei.bie@intel.com>
@ 2019-03-19  6:43 ` Tiwei Bie
  2019-03-19  8:39   ` [dpdk-stable] [dpdk-dev] " Jens Freimann
  2019-03-19 12:46   ` [dpdk-stable] " Maxime Coquelin
  2019-03-19  6:43 ` [dpdk-stable] [PATCH 02/10] net/virtio: fix interrupt helper for packed ring Tiwei Bie
  2019-03-19  6:43 ` [dpdk-stable] [PATCH 03/10] net/virtio: add missing barrier in interrupt enable Tiwei Bie
  2 siblings, 2 replies; 7+ messages in thread
From: Tiwei Bie @ 2019-03-19  6:43 UTC (permalink / raw)
  To: maxime.coquelin, zhihong.wang, dev; +Cc: stable

The pointer to event structure should be cast to uintptr_t first.

Fixes: f803734b0f2e ("net/virtio: vring init for packed queues")
Cc: stable@dpdk.org

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
---
 drivers/net/virtio/virtio_ring.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/virtio/virtio_ring.h b/drivers/net/virtio/virtio_ring.h
index 1760823c6..5a37629fe 100644
--- a/drivers/net/virtio/virtio_ring.h
+++ b/drivers/net/virtio/virtio_ring.h
@@ -165,7 +165,7 @@ vring_init_packed(struct vring_packed *vr, uint8_t *p, unsigned long align,
 	vr->driver_event = (struct vring_packed_desc_event *)(p +
 			vr->num * sizeof(struct vring_packed_desc));
 	vr->device_event = (struct vring_packed_desc_event *)
-		RTE_ALIGN_CEIL((uintptr_t)(vr->driver_event +
+		RTE_ALIGN_CEIL(((uintptr_t)vr->driver_event +
 				sizeof(struct vring_packed_desc_event)), align);
 }
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [dpdk-stable] [PATCH 02/10] net/virtio: fix interrupt helper for packed ring
       [not found] <20190319064312.13743-1-tiwei.bie@intel.com>
  2019-03-19  6:43 ` [dpdk-stable] [PATCH 01/10] net/virtio: fix typo in packed ring init Tiwei Bie
@ 2019-03-19  6:43 ` Tiwei Bie
  2019-03-19 12:48   ` Maxime Coquelin
  2019-03-19  6:43 ` [dpdk-stable] [PATCH 03/10] net/virtio: add missing barrier in interrupt enable Tiwei Bie
  2 siblings, 1 reply; 7+ messages in thread
From: Tiwei Bie @ 2019-03-19  6:43 UTC (permalink / raw)
  To: maxime.coquelin, zhihong.wang, dev; +Cc: stable

When disabling interrupt, the shadow event flags should also be
updated accordingly. The unnecessary wmb is also dropped.

Fixes: e9f4feb7e622 ("net/virtio: add packed virtqueue helpers")
Cc: stable@dpdk.org

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
---
 drivers/net/virtio/virtqueue.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/virtio/virtqueue.h b/drivers/net/virtio/virtqueue.h
index ca9d8e6e3..24fa873c3 100644
--- a/drivers/net/virtio/virtqueue.h
+++ b/drivers/net/virtio/virtqueue.h
@@ -321,12 +321,13 @@ vring_desc_init_split(struct vring_desc *dp, uint16_t n)
 static inline void
 virtqueue_disable_intr_packed(struct virtqueue *vq)
 {
-	uint16_t *event_flags = &vq->ring_packed.driver_event->desc_event_flags;
-
-	*event_flags = RING_EVENT_FLAGS_DISABLE;
+	if (vq->event_flags_shadow != RING_EVENT_FLAGS_DISABLE) {
+		vq->event_flags_shadow = RING_EVENT_FLAGS_DISABLE;
+		vq->ring_packed.driver_event->desc_event_flags =
+			vq->event_flags_shadow;
+	}
 }
 
-
 /**
  * Tell the backend not to interrupt us.
  */
@@ -348,7 +349,6 @@ virtqueue_enable_intr_packed(struct virtqueue *vq)
 	uint16_t *event_flags = &vq->ring_packed.driver_event->desc_event_flags;
 
 	if (vq->event_flags_shadow == RING_EVENT_FLAGS_DISABLE) {
-		virtio_wmb(vq->hw->weak_barriers);
 		vq->event_flags_shadow = RING_EVENT_FLAGS_ENABLE;
 		*event_flags = vq->event_flags_shadow;
 	}
-- 
2.17.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [dpdk-stable] [PATCH 03/10] net/virtio: add missing barrier in interrupt enable
       [not found] <20190319064312.13743-1-tiwei.bie@intel.com>
  2019-03-19  6:43 ` [dpdk-stable] [PATCH 01/10] net/virtio: fix typo in packed ring init Tiwei Bie
  2019-03-19  6:43 ` [dpdk-stable] [PATCH 02/10] net/virtio: fix interrupt helper for packed ring Tiwei Bie
@ 2019-03-19  6:43 ` Tiwei Bie
  2019-03-19 12:49   ` Maxime Coquelin
  2 siblings, 1 reply; 7+ messages in thread
From: Tiwei Bie @ 2019-03-19  6:43 UTC (permalink / raw)
  To: maxime.coquelin, zhihong.wang, dev; +Cc: stable

Typically, after enabling Rx interrupt, a check should be done
to make sure that there is no new incoming packets before going
to sleep. So a barrier is needed to make sure that any following
check won't happen before the interrupt is actually enabled.

Fixes: c056be239db5 ("net/virtio: add Rx interrupt enable/disable functions")
Cc: stable@dpdk.org

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
---
 drivers/net/virtio/virtio_ethdev.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 78ba7bd29..ff16fb63e 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -850,10 +850,12 @@ virtio_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)
 static int
 virtio_dev_rx_queue_intr_enable(struct rte_eth_dev *dev, uint16_t queue_id)
 {
+	struct virtio_hw *hw = dev->data->dev_private;
 	struct virtnet_rx *rxvq = dev->data->rx_queues[queue_id];
 	struct virtqueue *vq = rxvq->vq;
 
 	virtqueue_enable_intr(vq);
+	virtio_mb(hw->weak_barriers);
 	return 0;
 }
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-stable] [dpdk-dev] [PATCH 01/10] net/virtio: fix typo in packed ring init
  2019-03-19  6:43 ` [dpdk-stable] [PATCH 01/10] net/virtio: fix typo in packed ring init Tiwei Bie
@ 2019-03-19  8:39   ` Jens Freimann
  2019-03-19 12:46   ` [dpdk-stable] " Maxime Coquelin
  1 sibling, 0 replies; 7+ messages in thread
From: Jens Freimann @ 2019-03-19  8:39 UTC (permalink / raw)
  To: Tiwei Bie; +Cc: maxime.coquelin, zhihong.wang, dev, stable

On Tue, Mar 19, 2019 at 02:43:03PM +0800, Tiwei Bie wrote:
>The pointer to event structure should be cast to uintptr_t first.
>
>Fixes: f803734b0f2e ("net/virtio: vring init for packed queues")
>Cc: stable@dpdk.org
>
>Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
>---
> drivers/net/virtio/virtio_ring.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>

Reviewed-by: Jens Freimann <jfreimann@redhat.com>



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-stable] [PATCH 01/10] net/virtio: fix typo in packed ring init
  2019-03-19  6:43 ` [dpdk-stable] [PATCH 01/10] net/virtio: fix typo in packed ring init Tiwei Bie
  2019-03-19  8:39   ` [dpdk-stable] [dpdk-dev] " Jens Freimann
@ 2019-03-19 12:46   ` Maxime Coquelin
  1 sibling, 0 replies; 7+ messages in thread
From: Maxime Coquelin @ 2019-03-19 12:46 UTC (permalink / raw)
  To: Tiwei Bie, zhihong.wang, dev; +Cc: stable



On 3/19/19 7:43 AM, Tiwei Bie wrote:
> The pointer to event structure should be cast to uintptr_t first.
> 
> Fixes: f803734b0f2e ("net/virtio: vring init for packed queues")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
> ---
>   drivers/net/virtio/virtio_ring.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-stable] [PATCH 02/10] net/virtio: fix interrupt helper for packed ring
  2019-03-19  6:43 ` [dpdk-stable] [PATCH 02/10] net/virtio: fix interrupt helper for packed ring Tiwei Bie
@ 2019-03-19 12:48   ` Maxime Coquelin
  0 siblings, 0 replies; 7+ messages in thread
From: Maxime Coquelin @ 2019-03-19 12:48 UTC (permalink / raw)
  To: Tiwei Bie, zhihong.wang, dev; +Cc: stable



On 3/19/19 7:43 AM, Tiwei Bie wrote:
> When disabling interrupt, the shadow event flags should also be
> updated accordingly. The unnecessary wmb is also dropped.
> 
> Fixes: e9f4feb7e622 ("net/virtio: add packed virtqueue helpers")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
> ---
>   drivers/net/virtio/virtqueue.h | 10 +++++-----
>   1 file changed, 5 insertions(+), 5 deletions(-)
> 

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-stable] [PATCH 03/10] net/virtio: add missing barrier in interrupt enable
  2019-03-19  6:43 ` [dpdk-stable] [PATCH 03/10] net/virtio: add missing barrier in interrupt enable Tiwei Bie
@ 2019-03-19 12:49   ` Maxime Coquelin
  0 siblings, 0 replies; 7+ messages in thread
From: Maxime Coquelin @ 2019-03-19 12:49 UTC (permalink / raw)
  To: Tiwei Bie, zhihong.wang, dev; +Cc: stable



On 3/19/19 7:43 AM, Tiwei Bie wrote:
> Typically, after enabling Rx interrupt, a check should be done
> to make sure that there is no new incoming packets before going
> to sleep. So a barrier is needed to make sure that any following
> check won't happen before the interrupt is actually enabled.
> 
> Fixes: c056be239db5 ("net/virtio: add Rx interrupt enable/disable functions")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
> ---
>   drivers/net/virtio/virtio_ethdev.c | 2 ++
>   1 file changed, 2 insertions(+)


Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks,
Maxime

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-03-19 12:49 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20190319064312.13743-1-tiwei.bie@intel.com>
2019-03-19  6:43 ` [dpdk-stable] [PATCH 01/10] net/virtio: fix typo in packed ring init Tiwei Bie
2019-03-19  8:39   ` [dpdk-stable] [dpdk-dev] " Jens Freimann
2019-03-19 12:46   ` [dpdk-stable] " Maxime Coquelin
2019-03-19  6:43 ` [dpdk-stable] [PATCH 02/10] net/virtio: fix interrupt helper for packed ring Tiwei Bie
2019-03-19 12:48   ` Maxime Coquelin
2019-03-19  6:43 ` [dpdk-stable] [PATCH 03/10] net/virtio: add missing barrier in interrupt enable Tiwei Bie
2019-03-19 12:49   ` Maxime Coquelin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).