summaryrefslogtreecommitdiffstats
path: root/drivers/net/virtio/virtio_rxtx_simple.c
diff options
context:
space:
mode:
authorRicardo Salveti <ricardo.salveti@linaro.org>2016-07-25 13:22:22 -0300
committerRicardo Salveti <ricardo.salveti@linaro.org>2016-07-25 13:26:13 -0300
commit5b1ff351aa2d38446487eed6ccd7ace1b654bbe6 (patch)
tree383fc0fb3c0906113cdbdc0268a32479ed8fa038 /drivers/net/virtio/virtio_rxtx_simple.c
parentfe9e0a156b8ec361b633b4d20d2231113f28fa63 (diff)
Imported Upstream version 16.07-rc4
Change-Id: Ic57f6a3726f2dbd1682223648d91310f45705327 Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
Diffstat (limited to 'drivers/net/virtio/virtio_rxtx_simple.c')
-rw-r--r--drivers/net/virtio/virtio_rxtx_simple.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/net/virtio/virtio_rxtx_simple.c b/drivers/net/virtio/virtio_rxtx_simple.c
index d8fcc15e..6517aa80 100644
--- a/drivers/net/virtio/virtio_rxtx_simple.c
+++ b/drivers/net/virtio/virtio_rxtx_simple.c
@@ -80,8 +80,9 @@ virtqueue_enqueue_recv_refill_simple(struct virtqueue *vq,
vq->sw_ring[desc_idx] = cookie;
start_dp = vq->vq_ring.desc;
- start_dp[desc_idx].addr = MBUF_DATA_DMA_ADDR(cookie, vq->offset) -
- vq->hw->vtnet_hdr_size;
+ start_dp[desc_idx].addr =
+ VIRTIO_MBUF_ADDR(cookie, vq) +
+ RTE_PKTMBUF_HEADROOM - vq->hw->vtnet_hdr_size;
start_dp[desc_idx].len = cookie->buf_len -
RTE_PKTMBUF_HEADROOM + vq->hw->vtnet_hdr_size;
@@ -120,8 +121,8 @@ virtio_rxq_rearm_vec(struct virtnet_rx *rxvq)
*(uint64_t *)p = rxvq->mbuf_initializer;
start_dp[i].addr =
- MBUF_DATA_DMA_ADDR(sw_ring[i], vq->offset) -
- vq->hw->vtnet_hdr_size;
+ VIRTIO_MBUF_ADDR(sw_ring[i], vq) +
+ RTE_PKTMBUF_HEADROOM - vq->hw->vtnet_hdr_size;
start_dp[i].len = sw_ring[i]->buf_len -
RTE_PKTMBUF_HEADROOM + vq->hw->vtnet_hdr_size;
}
@@ -371,7 +372,7 @@ virtio_xmit_pkts_simple(void *tx_queue, struct rte_mbuf **tx_pkts,
vq->vq_descx[desc_idx + i].cookie = tx_pkts[i];
for (i = 0; i < nb_tail; i++) {
start_dp[desc_idx].addr =
- MBUF_DATA_DMA_ADDR(*tx_pkts, vq->offset);
+ VIRTIO_MBUF_DATA_DMA_ADDR(*tx_pkts, vq);
start_dp[desc_idx].len = (*tx_pkts)->pkt_len;
tx_pkts++;
desc_idx++;
@@ -383,7 +384,7 @@ virtio_xmit_pkts_simple(void *tx_queue, struct rte_mbuf **tx_pkts,
vq->vq_descx[desc_idx + i].cookie = tx_pkts[i];
for (i = 0; i < nb_commit; i++) {
start_dp[desc_idx].addr =
- MBUF_DATA_DMA_ADDR(*tx_pkts, vq->offset);
+ VIRTIO_MBUF_DATA_DMA_ADDR(*tx_pkts, vq);
start_dp[desc_idx].len = (*tx_pkts)->pkt_len;
tx_pkts++;
desc_idx++;