dev.dpdk.org archive mirror
 help / color / mirror / Atom feed
From: Vlad Zolotarov <vladz-RmZWMc9puTNJc61us3aD9laTQe2KTcn/@public.gmane.org>
To: dev-VfR2kkLFssw@public.gmane.org
Subject: [PATCH v3 1/3] ixgbe: Use the rte_le_to_cpu_xx()/rte_cpu_to_le_xx() when reading/setting HW ring descriptor fields
Date: Thu, 12 Mar 2015 23:17:30 +0200	[thread overview]
Message-ID: <1426195052-4640-2-git-send-email-vladz@cloudius-systems.com> (raw)
In-Reply-To: <1426195052-4640-1-git-send-email-vladz-RmZWMc9puTNJc61us3aD9laTQe2KTcn/@public.gmane.org>

Fixed the above in ixgbe_rx_alloc_bufs() and in ixgbe_recv_scattered_pkts().

Signed-off-by: Vlad Zolotarov <vladz-RmZWMc9puTNJc61us3aD9laTQe2KTcn/@public.gmane.org>
---
 lib/librte_pmd_ixgbe/ixgbe_rxtx.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c
index 96c4b98..f7c081f 100644
--- a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c
+++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c
@@ -1027,7 +1027,7 @@ ixgbe_rx_alloc_bufs(struct ixgbe_rx_queue *rxq)
 	struct ixgbe_rx_entry *rxep;
 	struct rte_mbuf *mb;
 	uint16_t alloc_idx;
-	uint64_t dma_addr;
+	__le64 dma_addr;
 	int diag, i;
 
 	/* allocate buffers in bulk directly into the S/W ring */
@@ -1050,7 +1050,7 @@ ixgbe_rx_alloc_bufs(struct ixgbe_rx_queue *rxq)
 		mb->port = rxq->port_id;
 
 		/* populate the descriptors */
-		dma_addr = (uint64_t)mb->buf_physaddr + RTE_PKTMBUF_HEADROOM;
+		dma_addr = rte_cpu_to_le_64(RTE_MBUF_DATA_DMA_ADDR_DEFAULT(mb));
 		rxdp[i].read.hdr_addr = dma_addr;
 		rxdp[i].read.pkt_addr = dma_addr;
 	}
@@ -1558,13 +1558,14 @@ ixgbe_recv_scattered_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,
 		first_seg->ol_flags = pkt_flags;
 
 		if (likely(pkt_flags & PKT_RX_RSS_HASH))
-			first_seg->hash.rss = rxd.wb.lower.hi_dword.rss;
+			first_seg->hash.rss =
+				    rte_le_to_cpu_32(rxd.wb.lower.hi_dword.rss);
 		else if (pkt_flags & PKT_RX_FDIR) {
 			first_seg->hash.fdir.hash =
-				(uint16_t)((rxd.wb.lower.hi_dword.csum_ip.csum)
-					   & IXGBE_ATR_HASH_MASK);
+			    rte_le_to_cpu_16(rxd.wb.lower.hi_dword.csum_ip.csum)
+					   & IXGBE_ATR_HASH_MASK;
 			first_seg->hash.fdir.id =
-				rxd.wb.lower.hi_dword.csum_ip.ip_id;
+			  rte_le_to_cpu_16(rxd.wb.lower.hi_dword.csum_ip.ip_id);
 		}
 
 		/* Prefetch data of first segment, if configured to do so. */
-- 
2.1.0

  parent reply	other threads:[~2015-03-12 21:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-12 21:17 [PATCH v3 0/3]: bug fixes in the ixgbe PF PMD Rx flow Vlad Zolotarov
     [not found] ` <1426195052-4640-1-git-send-email-vladz-RmZWMc9puTNJc61us3aD9laTQe2KTcn/@public.gmane.org>
2015-03-12 21:17   ` Vlad Zolotarov [this message]
2015-03-12 21:17   ` [PATCH v3 2/3] ixgbe: Bug fix: Properly configure Rx CRC stripping for x540 devices Vlad Zolotarov
2015-03-12 21:17   ` [PATCH v3 3/3] ixgbe: Unify the rx_pkt_bulk callback initialization Vlad Zolotarov
2015-03-13 11:07   ` [PATCH v3 0/3]: bug fixes in the ixgbe PF PMD Rx flow Ananyev, Konstantin
     [not found]     ` <2601191342CEEE43887BDE71AB977258213F5E9B-pww93C2UFcwu0RiL9chJVbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-03-13 11:51       ` Vlad Zolotarov
     [not found]         ` <5502CF58.3050504-RmZWMc9puTNJc61us3aD9laTQe2KTcn/@public.gmane.org>
2015-03-13 12:51           ` Ananyev, Konstantin
     [not found]             ` <2601191342CEEE43887BDE71AB977258213F63E2-pww93C2UFcwu0RiL9chJVbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-03-13 13:03               ` Vladislav Zolotarov
     [not found]                 ` <CAOYyTHbDcYy9FcSSU3u+CtfHt0QQRRQJXwiFiB2DO-7GEZ9B2Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-03-16  7:52                   ` Vlad Zolotarov
     [not found]                     ` <55068BD5.9090000-RmZWMc9puTNJc61us3aD9laTQe2KTcn/@public.gmane.org>
2015-03-16 10:19                       ` Thomas Monjalon
2015-03-16 23:16       ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1426195052-4640-2-git-send-email-vladz@cloudius-systems.com \
    --to=vladz-rmzwmc9putnjc61us3ad9latqe2ktcn/@public.gmane.org \
    --cc=dev-VfR2kkLFssw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).