From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f180.google.com (mail-wi0-f180.google.com [209.85.212.180]) by dpdk.org (Postfix) with ESMTP id 2807C5ABA for ; Mon, 9 Mar 2015 17:28:57 +0100 (CET) Received: by wibbs8 with SMTP id bs8so22693445wib.4 for ; Mon, 09 Mar 2015 09:28:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=YmtwRivGZyScCVUAF3LDxeXfWKIfQZchreffhBmU41I=; b=KJN0IkA9NAlpVczvPlC1njsTRbNxXhM1dL2tdodhbaBmTysqfSzQjJ3pGBIK9H2fAD XfL3MpBJEIIRmmue1xFkMjigd2q8i3EvR4pNSn/Nw8IVIYlb+V2V0kJBOJsBY5izQlg6 in/MZjmZqTPPXiCuJqot9sji5oboVgxhBwGaE3meUIytEBn6utRNhXTHcCDtIW6kjL86 M0YkpNX2YU42MePuwOF0hs65+VG5lWbgyH9vKfWpT6HksuHwRCSm23/yGRrlJ+x14bzO 2W5baAAWjEscFra5NOpNJi/4kZV9Z6Yqa/jYcnxCQj5/g35hm9QGL2VTmfTdannXgS7K 4rOw== X-Gm-Message-State: ALoCoQkYPuHA13vys3VNeyIwA2n7cPGU/WOQdbipq6xlwsqeCFwinTMZubGEInGl6WVzgvG/TLgi X-Received: by 10.180.39.33 with SMTP id m1mr62146616wik.26.1425918537019; Mon, 09 Mar 2015 09:28:57 -0700 (PDT) Received: from vladz-laptop.localdomain ([109.65.117.109]) by mx.google.com with ESMTPSA id e18sm28920929wjz.27.2015.03.09.09.28.55 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Mar 2015 09:28:56 -0700 (PDT) From: Vlad Zolotarov To: dev@dpdk.org Date: Mon, 9 Mar 2015 18:28:50 +0200 Message-Id: <1425918532-8601-2-git-send-email-vladz@cloudius-systems.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1425918532-8601-1-git-send-email-vladz@cloudius-systems.com> References: <1425918532-8601-1-git-send-email-vladz@cloudius-systems.com> Subject: [dpdk-dev] [PATCH v2 1/3] ixgbe: Use the rte_le_to_cpu_xx()/rte_cpu_to_le_xx() when reading/setting HW ring descriptor fields X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Mar 2015 16:28:57 -0000 Fixed the above in ixgbe_rx_alloc_bufs() and in ixgbe_recv_scattered_pkts(). Signed-off-by: Vlad Zolotarov --- 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 9ecf3e5..b033e04 100644 --- a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c +++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c @@ -1028,7 +1028,7 @@ ixgbe_rx_alloc_bufs(struct igb_rx_queue *rxq) struct igb_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 */ @@ -1051,7 +1051,7 @@ ixgbe_rx_alloc_bufs(struct igb_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; } @@ -1559,13 +1559,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