DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/virtio: define avail and used flags as constants
@ 2019-03-25  5:27 Tiwei Bie
  2019-03-25  5:27 ` Tiwei Bie
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Tiwei Bie @ 2019-03-25  5:27 UTC (permalink / raw)
  To: maxime.coquelin, zhihong.wang, dev; +Cc: jfreimann

We are consistently passing 1 as the argument in the data path,
so there is no need to define avail/used flags as function-like
macros anymore. This patch changes the avail and used flags to
constants. And a frequently used combination is also introduced.

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
---
 drivers/net/virtio/virtio_ethdev.c              | 10 ++++------
 drivers/net/virtio/virtio_ring.h                |  9 +++++++--
 drivers/net/virtio/virtio_rxtx.c                |  9 ++++-----
 .../net/virtio/virtio_user/virtio_user_dev.c    | 17 ++++++++++-------
 drivers/net/virtio/virtqueue.h                  |  4 ++--
 5 files changed, 27 insertions(+), 22 deletions(-)

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 310008757..2272bb2e5 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -168,8 +168,7 @@ virtio_send_command_packed(struct virtnet_ctl *cvq,
 	nb_descs++;
 	if (++vq->vq_avail_idx >= vq->vq_nentries) {
 		vq->vq_avail_idx -= vq->vq_nentries;
-		vq->vq_packed.cached_flags ^=
-			VRING_DESC_F_AVAIL(1) | VRING_DESC_F_USED(1);
+		vq->vq_packed.cached_flags ^= VRING_PACKED_DESC_F_AVAIL_USED;
 	}
 
 	for (k = 0; k < pkt_num; k++) {
@@ -185,7 +184,7 @@ virtio_send_command_packed(struct virtnet_ctl *cvq,
 		if (++vq->vq_avail_idx >= vq->vq_nentries) {
 			vq->vq_avail_idx -= vq->vq_nentries;
 			vq->vq_packed.cached_flags ^=
-				VRING_DESC_F_AVAIL(1) | VRING_DESC_F_USED(1);
+				VRING_PACKED_DESC_F_AVAIL_USED;
 		}
 	}
 
@@ -198,8 +197,7 @@ virtio_send_command_packed(struct virtnet_ctl *cvq,
 	nb_descs++;
 	if (++vq->vq_avail_idx >= vq->vq_nentries) {
 		vq->vq_avail_idx -= vq->vq_nentries;
-		vq->vq_packed.cached_flags ^=
-			VRING_DESC_F_AVAIL(1) | VRING_DESC_F_USED(1);
+		vq->vq_packed.cached_flags ^= VRING_PACKED_DESC_F_AVAIL_USED;
 	}
 
 	virtio_wmb(vq->hw->weak_barriers);
@@ -502,7 +500,7 @@ virtio_init_queue(struct rte_eth_dev *dev, uint16_t vtpci_queue_idx)
 	vq->vq_nentries = vq_size;
 	if (vtpci_packed_queue(hw)) {
 		vq->vq_packed.used_wrap_counter = 1;
-		vq->vq_packed.cached_flags = VRING_DESC_F_AVAIL(1);
+		vq->vq_packed.cached_flags = VRING_PACKED_DESC_F_AVAIL;
 		vq->vq_packed.event_flags_shadow = 0;
 		if (queue_type == VTNET_RQ)
 			vq->vq_packed.cached_flags |= VRING_DESC_F_WRITE;
diff --git a/drivers/net/virtio/virtio_ring.h b/drivers/net/virtio/virtio_ring.h
index 6abec4d87..7ba34662e 100644
--- a/drivers/net/virtio/virtio_ring.h
+++ b/drivers/net/virtio/virtio_ring.h
@@ -15,10 +15,15 @@
 #define VRING_DESC_F_WRITE      2
 /* This means the buffer contains a list of buffer descriptors. */
 #define VRING_DESC_F_INDIRECT   4
+
 /* This flag means the descriptor was made available by the driver */
-#define VRING_DESC_F_AVAIL(b)   ((uint16_t)(b) << 7)
+#define VRING_PACKED_DESC_F_AVAIL	(1 << 7)
 /* This flag means the descriptor was used by the device */
-#define VRING_DESC_F_USED(b)    ((uint16_t)(b) << 15)
+#define VRING_PACKED_DESC_F_USED	(1 << 15)
+
+/* Frequently used combinations */
+#define VRING_PACKED_DESC_F_AVAIL_USED	(VRING_PACKED_DESC_F_AVAIL | \
+					 VRING_PACKED_DESC_F_USED)
 
 /* The Host uses this in used->flags to advise the Guest: don't kick me
  * when you add a buffer.  It's unreliable, so it's simply an
diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c
index 5f6796bdb..ee30084e4 100644
--- a/drivers/net/virtio/virtio_rxtx.c
+++ b/drivers/net/virtio/virtio_rxtx.c
@@ -461,7 +461,7 @@ virtqueue_enqueue_recv_refill_packed(struct virtqueue *vq,
 		if (++vq->vq_avail_idx >= vq->vq_nentries) {
 			vq->vq_avail_idx -= vq->vq_nentries;
 			vq->vq_packed.cached_flags ^=
-				VRING_DESC_F_AVAIL(1) | VRING_DESC_F_USED(1);
+				VRING_PACKED_DESC_F_AVAIL_USED;
 			flags = vq->vq_packed.cached_flags;
 		}
 	}
@@ -660,8 +660,7 @@ virtqueue_enqueue_xmit_packed_fast(struct virtnet_tx *txvq,
 
 	if (++vq->vq_avail_idx >= vq->vq_nentries) {
 		vq->vq_avail_idx -= vq->vq_nentries;
-		vq->vq_packed.cached_flags ^=
-			VRING_DESC_F_AVAIL(1) | VRING_DESC_F_USED(1);
+		vq->vq_packed.cached_flags ^= VRING_PACKED_DESC_F_AVAIL_USED;
 	}
 
 	vq->vq_free_cnt--;
@@ -728,7 +727,7 @@ virtqueue_enqueue_xmit_packed(struct virtnet_tx *txvq, struct rte_mbuf *cookie,
 		if (idx >= vq->vq_nentries) {
 			idx -= vq->vq_nentries;
 			vq->vq_packed.cached_flags ^=
-				VRING_DESC_F_AVAIL(1) | VRING_DESC_F_USED(1);
+				VRING_PACKED_DESC_F_AVAIL_USED;
 		}
 	}
 
@@ -749,7 +748,7 @@ virtqueue_enqueue_xmit_packed(struct virtnet_tx *txvq, struct rte_mbuf *cookie,
 		if (idx >= vq->vq_nentries) {
 			idx -= vq->vq_nentries;
 			vq->vq_packed.cached_flags ^=
-				VRING_DESC_F_AVAIL(1) | VRING_DESC_F_USED(1);
+				VRING_PACKED_DESC_F_AVAIL_USED;
 		}
 	} while ((cookie = cookie->next) != NULL);
 
diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c
index 07aabb527..b004bc13a 100644
--- a/drivers/net/virtio/virtio_user/virtio_user_dev.c
+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c
@@ -628,8 +628,10 @@ virtio_user_handle_ctrl_msg(struct virtio_user_dev *dev, struct vring *vring,
 static inline int
 desc_is_avail(struct vring_packed_desc *desc, bool wrap_counter)
 {
-	return wrap_counter == !!(desc->flags & VRING_DESC_F_AVAIL(1)) &&
-		wrap_counter != !!(desc->flags & VRING_DESC_F_USED(1));
+	uint16_t flags = desc->flags;
+
+	return wrap_counter == !!(flags & VRING_PACKED_DESC_F_AVAIL) &&
+		wrap_counter != !!(flags & VRING_PACKED_DESC_F_USED);
 }
 
 static uint32_t
@@ -684,7 +686,7 @@ virtio_user_handle_cq_packed(struct virtio_user_dev *dev, uint16_t queue_idx)
 {
 	struct virtio_user_queue *vq = &dev->packed_queues[queue_idx];
 	struct vring_packed *vring = &dev->packed_vrings[queue_idx];
-	uint16_t n_descs;
+	uint16_t n_descs, flags;
 
 	while (desc_is_avail(&vring->desc[vq->used_idx],
 			     vq->used_wrap_counter)) {
@@ -692,11 +694,12 @@ virtio_user_handle_cq_packed(struct virtio_user_dev *dev, uint16_t queue_idx)
 		n_descs = virtio_user_handle_ctrl_msg_packed(dev, vring,
 				vq->used_idx);
 
+		flags = VRING_DESC_F_WRITE;
+		if (vq->used_wrap_counter)
+			flags |= VRING_PACKED_DESC_F_AVAIL_USED;
+
 		rte_smp_wmb();
-		vring->desc[vq->used_idx].flags =
-			VRING_DESC_F_WRITE |
-			VRING_DESC_F_AVAIL(vq->used_wrap_counter) |
-			VRING_DESC_F_USED(vq->used_wrap_counter);
+		vring->desc[vq->used_idx].flags = flags;
 
 		vq->used_idx += n_descs;
 		if (vq->used_idx >= dev->queue_size) {
diff --git a/drivers/net/virtio/virtqueue.h b/drivers/net/virtio/virtqueue.h
index 5cea7cb4a..e9dedc5da 100644
--- a/drivers/net/virtio/virtqueue.h
+++ b/drivers/net/virtio/virtqueue.h
@@ -287,8 +287,8 @@ desc_is_used(struct vring_packed_desc *desc, struct virtqueue *vq)
 	uint16_t used, avail, flags;
 
 	flags = desc->flags;
-	used = !!(flags & VRING_DESC_F_USED(1));
-	avail = !!(flags & VRING_DESC_F_AVAIL(1));
+	used = !!(flags & VRING_PACKED_DESC_F_USED);
+	avail = !!(flags & VRING_PACKED_DESC_F_AVAIL);
 
 	return avail == used && used == vq->vq_packed.used_wrap_counter;
 }
-- 
2.17.1

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

* [dpdk-dev] [PATCH] net/virtio: define avail and used flags as constants
  2019-03-25  5:27 [dpdk-dev] [PATCH] net/virtio: define avail and used flags as constants Tiwei Bie
@ 2019-03-25  5:27 ` Tiwei Bie
  2019-03-25  7:47 ` Jens Freimann
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Tiwei Bie @ 2019-03-25  5:27 UTC (permalink / raw)
  To: maxime.coquelin, zhihong.wang, dev; +Cc: jfreimann

We are consistently passing 1 as the argument in the data path,
so there is no need to define avail/used flags as function-like
macros anymore. This patch changes the avail and used flags to
constants. And a frequently used combination is also introduced.

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
---
 drivers/net/virtio/virtio_ethdev.c              | 10 ++++------
 drivers/net/virtio/virtio_ring.h                |  9 +++++++--
 drivers/net/virtio/virtio_rxtx.c                |  9 ++++-----
 .../net/virtio/virtio_user/virtio_user_dev.c    | 17 ++++++++++-------
 drivers/net/virtio/virtqueue.h                  |  4 ++--
 5 files changed, 27 insertions(+), 22 deletions(-)

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 310008757..2272bb2e5 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -168,8 +168,7 @@ virtio_send_command_packed(struct virtnet_ctl *cvq,
 	nb_descs++;
 	if (++vq->vq_avail_idx >= vq->vq_nentries) {
 		vq->vq_avail_idx -= vq->vq_nentries;
-		vq->vq_packed.cached_flags ^=
-			VRING_DESC_F_AVAIL(1) | VRING_DESC_F_USED(1);
+		vq->vq_packed.cached_flags ^= VRING_PACKED_DESC_F_AVAIL_USED;
 	}
 
 	for (k = 0; k < pkt_num; k++) {
@@ -185,7 +184,7 @@ virtio_send_command_packed(struct virtnet_ctl *cvq,
 		if (++vq->vq_avail_idx >= vq->vq_nentries) {
 			vq->vq_avail_idx -= vq->vq_nentries;
 			vq->vq_packed.cached_flags ^=
-				VRING_DESC_F_AVAIL(1) | VRING_DESC_F_USED(1);
+				VRING_PACKED_DESC_F_AVAIL_USED;
 		}
 	}
 
@@ -198,8 +197,7 @@ virtio_send_command_packed(struct virtnet_ctl *cvq,
 	nb_descs++;
 	if (++vq->vq_avail_idx >= vq->vq_nentries) {
 		vq->vq_avail_idx -= vq->vq_nentries;
-		vq->vq_packed.cached_flags ^=
-			VRING_DESC_F_AVAIL(1) | VRING_DESC_F_USED(1);
+		vq->vq_packed.cached_flags ^= VRING_PACKED_DESC_F_AVAIL_USED;
 	}
 
 	virtio_wmb(vq->hw->weak_barriers);
@@ -502,7 +500,7 @@ virtio_init_queue(struct rte_eth_dev *dev, uint16_t vtpci_queue_idx)
 	vq->vq_nentries = vq_size;
 	if (vtpci_packed_queue(hw)) {
 		vq->vq_packed.used_wrap_counter = 1;
-		vq->vq_packed.cached_flags = VRING_DESC_F_AVAIL(1);
+		vq->vq_packed.cached_flags = VRING_PACKED_DESC_F_AVAIL;
 		vq->vq_packed.event_flags_shadow = 0;
 		if (queue_type == VTNET_RQ)
 			vq->vq_packed.cached_flags |= VRING_DESC_F_WRITE;
diff --git a/drivers/net/virtio/virtio_ring.h b/drivers/net/virtio/virtio_ring.h
index 6abec4d87..7ba34662e 100644
--- a/drivers/net/virtio/virtio_ring.h
+++ b/drivers/net/virtio/virtio_ring.h
@@ -15,10 +15,15 @@
 #define VRING_DESC_F_WRITE      2
 /* This means the buffer contains a list of buffer descriptors. */
 #define VRING_DESC_F_INDIRECT   4
+
 /* This flag means the descriptor was made available by the driver */
-#define VRING_DESC_F_AVAIL(b)   ((uint16_t)(b) << 7)
+#define VRING_PACKED_DESC_F_AVAIL	(1 << 7)
 /* This flag means the descriptor was used by the device */
-#define VRING_DESC_F_USED(b)    ((uint16_t)(b) << 15)
+#define VRING_PACKED_DESC_F_USED	(1 << 15)
+
+/* Frequently used combinations */
+#define VRING_PACKED_DESC_F_AVAIL_USED	(VRING_PACKED_DESC_F_AVAIL | \
+					 VRING_PACKED_DESC_F_USED)
 
 /* The Host uses this in used->flags to advise the Guest: don't kick me
  * when you add a buffer.  It's unreliable, so it's simply an
diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c
index 5f6796bdb..ee30084e4 100644
--- a/drivers/net/virtio/virtio_rxtx.c
+++ b/drivers/net/virtio/virtio_rxtx.c
@@ -461,7 +461,7 @@ virtqueue_enqueue_recv_refill_packed(struct virtqueue *vq,
 		if (++vq->vq_avail_idx >= vq->vq_nentries) {
 			vq->vq_avail_idx -= vq->vq_nentries;
 			vq->vq_packed.cached_flags ^=
-				VRING_DESC_F_AVAIL(1) | VRING_DESC_F_USED(1);
+				VRING_PACKED_DESC_F_AVAIL_USED;
 			flags = vq->vq_packed.cached_flags;
 		}
 	}
@@ -660,8 +660,7 @@ virtqueue_enqueue_xmit_packed_fast(struct virtnet_tx *txvq,
 
 	if (++vq->vq_avail_idx >= vq->vq_nentries) {
 		vq->vq_avail_idx -= vq->vq_nentries;
-		vq->vq_packed.cached_flags ^=
-			VRING_DESC_F_AVAIL(1) | VRING_DESC_F_USED(1);
+		vq->vq_packed.cached_flags ^= VRING_PACKED_DESC_F_AVAIL_USED;
 	}
 
 	vq->vq_free_cnt--;
@@ -728,7 +727,7 @@ virtqueue_enqueue_xmit_packed(struct virtnet_tx *txvq, struct rte_mbuf *cookie,
 		if (idx >= vq->vq_nentries) {
 			idx -= vq->vq_nentries;
 			vq->vq_packed.cached_flags ^=
-				VRING_DESC_F_AVAIL(1) | VRING_DESC_F_USED(1);
+				VRING_PACKED_DESC_F_AVAIL_USED;
 		}
 	}
 
@@ -749,7 +748,7 @@ virtqueue_enqueue_xmit_packed(struct virtnet_tx *txvq, struct rte_mbuf *cookie,
 		if (idx >= vq->vq_nentries) {
 			idx -= vq->vq_nentries;
 			vq->vq_packed.cached_flags ^=
-				VRING_DESC_F_AVAIL(1) | VRING_DESC_F_USED(1);
+				VRING_PACKED_DESC_F_AVAIL_USED;
 		}
 	} while ((cookie = cookie->next) != NULL);
 
diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c
index 07aabb527..b004bc13a 100644
--- a/drivers/net/virtio/virtio_user/virtio_user_dev.c
+++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c
@@ -628,8 +628,10 @@ virtio_user_handle_ctrl_msg(struct virtio_user_dev *dev, struct vring *vring,
 static inline int
 desc_is_avail(struct vring_packed_desc *desc, bool wrap_counter)
 {
-	return wrap_counter == !!(desc->flags & VRING_DESC_F_AVAIL(1)) &&
-		wrap_counter != !!(desc->flags & VRING_DESC_F_USED(1));
+	uint16_t flags = desc->flags;
+
+	return wrap_counter == !!(flags & VRING_PACKED_DESC_F_AVAIL) &&
+		wrap_counter != !!(flags & VRING_PACKED_DESC_F_USED);
 }
 
 static uint32_t
@@ -684,7 +686,7 @@ virtio_user_handle_cq_packed(struct virtio_user_dev *dev, uint16_t queue_idx)
 {
 	struct virtio_user_queue *vq = &dev->packed_queues[queue_idx];
 	struct vring_packed *vring = &dev->packed_vrings[queue_idx];
-	uint16_t n_descs;
+	uint16_t n_descs, flags;
 
 	while (desc_is_avail(&vring->desc[vq->used_idx],
 			     vq->used_wrap_counter)) {
@@ -692,11 +694,12 @@ virtio_user_handle_cq_packed(struct virtio_user_dev *dev, uint16_t queue_idx)
 		n_descs = virtio_user_handle_ctrl_msg_packed(dev, vring,
 				vq->used_idx);
 
+		flags = VRING_DESC_F_WRITE;
+		if (vq->used_wrap_counter)
+			flags |= VRING_PACKED_DESC_F_AVAIL_USED;
+
 		rte_smp_wmb();
-		vring->desc[vq->used_idx].flags =
-			VRING_DESC_F_WRITE |
-			VRING_DESC_F_AVAIL(vq->used_wrap_counter) |
-			VRING_DESC_F_USED(vq->used_wrap_counter);
+		vring->desc[vq->used_idx].flags = flags;
 
 		vq->used_idx += n_descs;
 		if (vq->used_idx >= dev->queue_size) {
diff --git a/drivers/net/virtio/virtqueue.h b/drivers/net/virtio/virtqueue.h
index 5cea7cb4a..e9dedc5da 100644
--- a/drivers/net/virtio/virtqueue.h
+++ b/drivers/net/virtio/virtqueue.h
@@ -287,8 +287,8 @@ desc_is_used(struct vring_packed_desc *desc, struct virtqueue *vq)
 	uint16_t used, avail, flags;
 
 	flags = desc->flags;
-	used = !!(flags & VRING_DESC_F_USED(1));
-	avail = !!(flags & VRING_DESC_F_AVAIL(1));
+	used = !!(flags & VRING_PACKED_DESC_F_USED);
+	avail = !!(flags & VRING_PACKED_DESC_F_AVAIL);
 
 	return avail == used && used == vq->vq_packed.used_wrap_counter;
 }
-- 
2.17.1


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

* Re: [dpdk-dev] [PATCH] net/virtio: define avail and used flags as constants
  2019-03-25  5:27 [dpdk-dev] [PATCH] net/virtio: define avail and used flags as constants Tiwei Bie
  2019-03-25  5:27 ` Tiwei Bie
@ 2019-03-25  7:47 ` Jens Freimann
  2019-03-25  7:47   ` Jens Freimann
  2019-03-27 10:30 ` Maxime Coquelin
  2019-03-27 11:14 ` Maxime Coquelin
  3 siblings, 1 reply; 8+ messages in thread
From: Jens Freimann @ 2019-03-25  7:47 UTC (permalink / raw)
  To: Tiwei Bie; +Cc: maxime.coquelin, zhihong.wang, dev

On Mon, Mar 25, 2019 at 01:27:16PM +0800, Tiwei Bie wrote:
>We are consistently passing 1 as the argument in the data path,
>so there is no need to define avail/used flags as function-like
>macros anymore. This patch changes the avail and used flags to
>constants. And a frequently used combination is also introduced.
>
>Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
>---
> drivers/net/virtio/virtio_ethdev.c              | 10 ++++------
> drivers/net/virtio/virtio_ring.h                |  9 +++++++--
> drivers/net/virtio/virtio_rxtx.c                |  9 ++++-----
> .../net/virtio/virtio_user/virtio_user_dev.c    | 17 ++++++++++-------
> drivers/net/virtio/virtqueue.h                  |  4 ++--
> 5 files changed, 27 insertions(+), 22 deletions(-)
>

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

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

* Re: [dpdk-dev] [PATCH] net/virtio: define avail and used flags as constants
  2019-03-25  7:47 ` Jens Freimann
@ 2019-03-25  7:47   ` Jens Freimann
  0 siblings, 0 replies; 8+ messages in thread
From: Jens Freimann @ 2019-03-25  7:47 UTC (permalink / raw)
  To: Tiwei Bie; +Cc: maxime.coquelin, zhihong.wang, dev

On Mon, Mar 25, 2019 at 01:27:16PM +0800, Tiwei Bie wrote:
>We are consistently passing 1 as the argument in the data path,
>so there is no need to define avail/used flags as function-like
>macros anymore. This patch changes the avail and used flags to
>constants. And a frequently used combination is also introduced.
>
>Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
>---
> drivers/net/virtio/virtio_ethdev.c              | 10 ++++------
> drivers/net/virtio/virtio_ring.h                |  9 +++++++--
> drivers/net/virtio/virtio_rxtx.c                |  9 ++++-----
> .../net/virtio/virtio_user/virtio_user_dev.c    | 17 ++++++++++-------
> drivers/net/virtio/virtqueue.h                  |  4 ++--
> 5 files changed, 27 insertions(+), 22 deletions(-)
>

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



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

* Re: [dpdk-dev] [PATCH] net/virtio: define avail and used flags as constants
  2019-03-25  5:27 [dpdk-dev] [PATCH] net/virtio: define avail and used flags as constants Tiwei Bie
  2019-03-25  5:27 ` Tiwei Bie
  2019-03-25  7:47 ` Jens Freimann
@ 2019-03-27 10:30 ` Maxime Coquelin
  2019-03-27 10:30   ` Maxime Coquelin
  2019-03-27 11:14 ` Maxime Coquelin
  3 siblings, 1 reply; 8+ messages in thread
From: Maxime Coquelin @ 2019-03-27 10:30 UTC (permalink / raw)
  To: Tiwei Bie, zhihong.wang, dev; +Cc: jfreimann



On 3/25/19 6:27 AM, Tiwei Bie wrote:
> We are consistently passing 1 as the argument in the data path,
> so there is no need to define avail/used flags as function-like
> macros anymore. This patch changes the avail and used flags to
> constants. And a frequently used combination is also introduced.
> 
> Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
> ---
>   drivers/net/virtio/virtio_ethdev.c              | 10 ++++------
>   drivers/net/virtio/virtio_ring.h                |  9 +++++++--
>   drivers/net/virtio/virtio_rxtx.c                |  9 ++++-----
>   .../net/virtio/virtio_user/virtio_user_dev.c    | 17 ++++++++++-------
>   drivers/net/virtio/virtqueue.h                  |  4 ++--
>   5 files changed, 27 insertions(+), 22 deletions(-)
> 

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

Thanks,
Maxime

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

* Re: [dpdk-dev] [PATCH] net/virtio: define avail and used flags as constants
  2019-03-27 10:30 ` Maxime Coquelin
@ 2019-03-27 10:30   ` Maxime Coquelin
  0 siblings, 0 replies; 8+ messages in thread
From: Maxime Coquelin @ 2019-03-27 10:30 UTC (permalink / raw)
  To: Tiwei Bie, zhihong.wang, dev; +Cc: jfreimann



On 3/25/19 6:27 AM, Tiwei Bie wrote:
> We are consistently passing 1 as the argument in the data path,
> so there is no need to define avail/used flags as function-like
> macros anymore. This patch changes the avail and used flags to
> constants. And a frequently used combination is also introduced.
> 
> Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
> ---
>   drivers/net/virtio/virtio_ethdev.c              | 10 ++++------
>   drivers/net/virtio/virtio_ring.h                |  9 +++++++--
>   drivers/net/virtio/virtio_rxtx.c                |  9 ++++-----
>   .../net/virtio/virtio_user/virtio_user_dev.c    | 17 ++++++++++-------
>   drivers/net/virtio/virtqueue.h                  |  4 ++--
>   5 files changed, 27 insertions(+), 22 deletions(-)
> 

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

Thanks,
Maxime


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

* Re: [dpdk-dev] [PATCH] net/virtio: define avail and used flags as constants
  2019-03-25  5:27 [dpdk-dev] [PATCH] net/virtio: define avail and used flags as constants Tiwei Bie
                   ` (2 preceding siblings ...)
  2019-03-27 10:30 ` Maxime Coquelin
@ 2019-03-27 11:14 ` Maxime Coquelin
  2019-03-27 11:14   ` Maxime Coquelin
  3 siblings, 1 reply; 8+ messages in thread
From: Maxime Coquelin @ 2019-03-27 11:14 UTC (permalink / raw)
  To: Tiwei Bie, zhihong.wang, dev; +Cc: jfreimann



On 3/25/19 6:27 AM, Tiwei Bie wrote:
> We are consistently passing 1 as the argument in the data path,
> so there is no need to define avail/used flags as function-like
> macros anymore. This patch changes the avail and used flags to
> constants. And a frequently used combination is also introduced.
> 
> Signed-off-by: Tiwei Bie<tiwei.bie@intel.com>
> ---
>   drivers/net/virtio/virtio_ethdev.c              | 10 ++++------
>   drivers/net/virtio/virtio_ring.h                |  9 +++++++--
>   drivers/net/virtio/virtio_rxtx.c                |  9 ++++-----
>   .../net/virtio/virtio_user/virtio_user_dev.c    | 17 ++++++++++-------
>   drivers/net/virtio/virtqueue.h                  |  4 ++--
>   5 files changed, 27 insertions(+), 22 deletions(-)

Applied to dpdk-next-virtio/master.

Thanks,
Maxime

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

* Re: [dpdk-dev] [PATCH] net/virtio: define avail and used flags as constants
  2019-03-27 11:14 ` Maxime Coquelin
@ 2019-03-27 11:14   ` Maxime Coquelin
  0 siblings, 0 replies; 8+ messages in thread
From: Maxime Coquelin @ 2019-03-27 11:14 UTC (permalink / raw)
  To: Tiwei Bie, zhihong.wang, dev; +Cc: jfreimann



On 3/25/19 6:27 AM, Tiwei Bie wrote:
> We are consistently passing 1 as the argument in the data path,
> so there is no need to define avail/used flags as function-like
> macros anymore. This patch changes the avail and used flags to
> constants. And a frequently used combination is also introduced.
> 
> Signed-off-by: Tiwei Bie<tiwei.bie@intel.com>
> ---
>   drivers/net/virtio/virtio_ethdev.c              | 10 ++++------
>   drivers/net/virtio/virtio_ring.h                |  9 +++++++--
>   drivers/net/virtio/virtio_rxtx.c                |  9 ++++-----
>   .../net/virtio/virtio_user/virtio_user_dev.c    | 17 ++++++++++-------
>   drivers/net/virtio/virtqueue.h                  |  4 ++--
>   5 files changed, 27 insertions(+), 22 deletions(-)

Applied to dpdk-next-virtio/master.

Thanks,
Maxime

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

end of thread, other threads:[~2019-03-27 11:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-25  5:27 [dpdk-dev] [PATCH] net/virtio: define avail and used flags as constants Tiwei Bie
2019-03-25  5:27 ` Tiwei Bie
2019-03-25  7:47 ` Jens Freimann
2019-03-25  7:47   ` Jens Freimann
2019-03-27 10:30 ` Maxime Coquelin
2019-03-27 10:30   ` Maxime Coquelin
2019-03-27 11:14 ` Maxime Coquelin
2019-03-27 11:14   ` 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).