DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] i40e: fix the issue of wrongly reporting descriptor done
@ 2015-07-29 22:08 Helin Zhang
  2015-08-02 21:57 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: Helin Zhang @ 2015-07-29 22:08 UTC (permalink / raw)
  To: dev

Header buffer address for header split will be filled with the
physical address for DMA, which is actually not needed at all,
as header split hasn't been supported. Hardware requires the
least bit of header address which is 'Descriptor Done' bit when
write back should be set to 0 by driver.
The issue is that if the user wants to reserve an odd number of
bytes between the mbuf header and data buffer, the physical address
to be filled in the descriptor would happen to be odd. That means
the DD bit would be set to non-zero by driver. That will result in
reporting descriptor done wrongly.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
---
 drivers/net/i40e/i40e_rxtx.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index 891a221..a267b4d 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -1367,7 +1367,7 @@ i40e_rx_alloc_bufs(struct i40e_rx_queue *rxq)
 		mb->port = rxq->port_id;
 		dma_addr = rte_cpu_to_le_64(\
 			RTE_MBUF_DATA_DMA_ADDR_DEFAULT(mb));
-		rxdp[i].read.hdr_addr = dma_addr;
+		rxdp[i].read.hdr_addr = 0;
 		rxdp[i].read.pkt_addr = dma_addr;
 	}
 
@@ -1514,7 +1514,7 @@ i40e_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 		rxe->mbuf = nmb;
 		dma_addr =
 			rte_cpu_to_le_64(RTE_MBUF_DATA_DMA_ADDR_DEFAULT(nmb));
-		rxdp->read.hdr_addr = dma_addr;
+		rxdp->read.hdr_addr = 0;
 		rxdp->read.pkt_addr = dma_addr;
 
 		rx_packet_len = ((qword1 & I40E_RXD_QW1_LENGTH_PBUF_MASK) >>
@@ -1640,7 +1640,7 @@ i40e_recv_scattered_pkts(void *rx_queue,
 			rte_cpu_to_le_64(RTE_MBUF_DATA_DMA_ADDR_DEFAULT(nmb));
 
 		/* Set data buffer address and data length of the mbuf */
-		rxdp->read.hdr_addr = dma_addr;
+		rxdp->read.hdr_addr = 0;
 		rxdp->read.pkt_addr = dma_addr;
 		rx_packet_len = (qword1 & I40E_RXD_QW1_LENGTH_PBUF_MASK) >>
 					I40E_RXD_QW1_LENGTH_PBUF_SHIFT;
@@ -3047,7 +3047,7 @@ i40e_alloc_rx_queue_mbufs(struct i40e_rx_queue *rxq)
 
 		rxd = &rxq->rx_ring[i];
 		rxd->read.pkt_addr = dma_addr;
-		rxd->read.hdr_addr = dma_addr;
+		rxd->read.hdr_addr = 0;
 #ifndef RTE_LIBRTE_I40E_16BYTE_RX_DESC
 		rxd->read.rsvd1 = 0;
 		rxd->read.rsvd2 = 0;
-- 
1.9.3

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

* Re: [dpdk-dev] [PATCH] i40e: fix the issue of wrongly reporting descriptor done
  2015-07-29 22:08 [dpdk-dev] [PATCH] i40e: fix the issue of wrongly reporting descriptor done Helin Zhang
@ 2015-08-02 21:57 ` Thomas Monjalon
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Monjalon @ 2015-08-02 21:57 UTC (permalink / raw)
  To: Helin Zhang; +Cc: dev

2015-07-30 06:08, Helin Zhang:
> Header buffer address for header split will be filled with the
> physical address for DMA, which is actually not needed at all,
> as header split hasn't been supported. Hardware requires the
> least bit of header address which is 'Descriptor Done' bit when
> write back should be set to 0 by driver.
> The issue is that if the user wants to reserve an odd number of
> bytes between the mbuf header and data buffer, the physical address
> to be filled in the descriptor would happen to be odd. That means
> the DD bit would be set to non-zero by driver. That will result in
> reporting descriptor done wrongly.
> 
> Signed-off-by: Helin Zhang <helin.zhang@intel.com>

Applied, thanks

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

end of thread, other threads:[~2015-08-02 21:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-29 22:08 [dpdk-dev] [PATCH] i40e: fix the issue of wrongly reporting descriptor done Helin Zhang
2015-08-02 21:57 ` Thomas Monjalon

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).