[07/10] net/virtio: drop unused field in Tx region structure

Message ID 20190319064312.13743-8-tiwei.bie@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Maxime Coquelin
Headers
Series net/virtio: cleanups and fixes for packed/split ring |

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Tiwei Bie March 19, 2019, 6:43 a.m. UTC
Drop the unused field tx_indir_pq from virtio_tx_region
structure.

Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
---
 drivers/net/virtio/virtio_ethdev.c | 10 +---------
 drivers/net/virtio/virtqueue.h     |  8 ++------
 2 files changed, 3 insertions(+), 15 deletions(-)
  

Comments

Jens Freimann March 19, 2019, 9:51 a.m. UTC | #1
On Tue, Mar 19, 2019 at 02:43:09PM +0800, Tiwei Bie wrote:
>Drop the unused field tx_indir_pq from virtio_tx_region
>structure.
>
>Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
>---
> drivers/net/virtio/virtio_ethdev.c | 10 +---------
> drivers/net/virtio/virtqueue.h     |  8 ++------
> 2 files changed, 3 insertions(+), 15 deletions(-)
>

Reviewed-by: Jens Freimann <jfreimann@redhat.com>
  
Maxime Coquelin March 19, 2019, 1:33 p.m. UTC | #2
On 3/19/19 7:43 AM, Tiwei Bie wrote:
> Drop the unused field tx_indir_pq from virtio_tx_region
> structure.
> 
> Signed-off-by: Tiwei Bie <tiwei.bie@intel.com>
> ---
>   drivers/net/virtio/virtio_ethdev.c | 10 +---------
>   drivers/net/virtio/virtqueue.h     |  8 ++------
>   2 files changed, 3 insertions(+), 15 deletions(-)
> 

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

Thanks,
Maxime
  

Patch

diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index f452a9a79..8aa250997 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -603,17 +603,9 @@  virtio_init_queue(struct rte_eth_dev *dev, uint16_t vtpci_queue_idx)
 		memset(txr, 0, vq_size * sizeof(*txr));
 		for (i = 0; i < vq_size; i++) {
 			struct vring_desc *start_dp = txr[i].tx_indir;
-			struct vring_packed_desc *start_dp_packed =
-				txr[i].tx_indir_pq;
 
 			/* first indirect descriptor is always the tx header */
-			if (vtpci_packed_queue(hw)) {
-				start_dp_packed->addr = txvq->virtio_net_hdr_mem
-					+ i * sizeof(*txr)
-					+ offsetof(struct virtio_tx_region,
-						   tx_hdr);
-				start_dp_packed->len = hw->vtnet_hdr_size;
-			} else {
+			if (!vtpci_packed_queue(hw)) {
 				vring_desc_init_split(start_dp,
 						      RTE_DIM(txr[i].tx_indir));
 				start_dp->addr = txvq->virtio_net_hdr_mem
diff --git a/drivers/net/virtio/virtqueue.h b/drivers/net/virtio/virtqueue.h
index 78df6d390..6dab7db8e 100644
--- a/drivers/net/virtio/virtqueue.h
+++ b/drivers/net/virtio/virtqueue.h
@@ -277,12 +277,8 @@  struct virtio_net_hdr_mrg_rxbuf {
 #define VIRTIO_MAX_TX_INDIRECT 8
 struct virtio_tx_region {
 	struct virtio_net_hdr_mrg_rxbuf tx_hdr;
-	union {
-		struct vring_desc tx_indir[VIRTIO_MAX_TX_INDIRECT]
-			__attribute__((__aligned__(16)));
-		struct vring_packed_desc tx_indir_pq[VIRTIO_MAX_TX_INDIRECT]
-			__attribute__((__aligned__(16)));
-	};
+	struct vring_desc tx_indir[VIRTIO_MAX_TX_INDIRECT]
+		__attribute__((__aligned__(16)));
 };
 
 static inline int