From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-we0-f179.google.com (mail-we0-f179.google.com [74.125.82.179]) by dpdk.org (Postfix) with ESMTP id 81F1E592B for ; Thu, 12 Mar 2015 22:17:37 +0100 (CET) Received: by wesu56 with SMTP id u56so19138399wes.12 for ; Thu, 12 Mar 2015 14:17:37 -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=DfJ/KUbTs/1EB4zrN8X7YCjPrF67CALksD9lN1+Q5XU=; b=XMccQ7eU6aZaqIK8+Tcei39Ho+cd6+Trbyhrl8Q0Uy9DAUXy7/iXF8K3Nvw0x2vqZs imt1pDUCH9qERT8UpKMa4vIHV1iSUN2uW2K6YiQL4+Dm8bFxJkIJQIBuop00ZH8ktX00 Cd1HVE0NTJmvDwHMVxu1BZihXuOCmrR7mSrOgwwmvVZ9s3B215sihOazugQmWmDyS+bp Qnk4xE7ElaBBZgUuAOrZ+4v6sph8qxYVgM02vsrR8UIMeiUDmzyF6ocYpSVsR/0N1D+t 0HBpdC0kEjFfdtqk2aSP8cv8um/7p3x7U1o/I02DsBQEMPVEGECOqGC5jPkv8CtdD297 F4vg== X-Gm-Message-State: ALoCoQkSRHwqxRCtd2nUiRhg9G3Uf4aHyKQg45rcdEIdG28/2RvhKCjZI4/cU5CjrwrCxEIVNUTC X-Received: by 10.180.8.165 with SMTP id s5mr90711598wia.16.1426195057206; Thu, 12 Mar 2015 14:17:37 -0700 (PDT) Received: from vladz-laptop.localdomain (bzq-109-65-117-109.red.bezeqint.net. [109.65.117.109]) by mx.google.com with ESMTPSA id cf12sm68579wjb.10.2015.03.12.14.17.35 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Mar 2015 14:17:36 -0700 (PDT) From: Vlad Zolotarov To: dev@dpdk.org Date: Thu, 12 Mar 2015 23:17:30 +0200 Message-Id: <1426195052-4640-2-git-send-email-vladz@cloudius-systems.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1426195052-4640-1-git-send-email-vladz@cloudius-systems.com> References: <1426195052-4640-1-git-send-email-vladz@cloudius-systems.com> Subject: [dpdk-dev] [PATCH v3 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: Thu, 12 Mar 2015 21:17:37 -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 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