From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id E86629A8E for ; Tue, 10 Mar 2015 10:23:33 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP; 10 Mar 2015 02:21:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,373,1422950400"; d="scan'208";a="538555362" Received: from irsmsx151.ger.corp.intel.com ([163.33.192.59]) by orsmga003.jf.intel.com with ESMTP; 10 Mar 2015 02:22:59 -0700 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.117]) by IRSMSX151.ger.corp.intel.com ([169.254.4.7]) with mapi id 14.03.0195.001; Tue, 10 Mar 2015 09:23:31 +0000 From: "Ananyev, Konstantin" To: Vlad Zolotarov , "dev@dpdk.org" Thread-Topic: [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 Thread-Index: AQHQWoY+TqIkAmaGt0Wy2LrNDG/iVJ0VcpTQ Date: Tue, 10 Mar 2015 09:23:30 +0000 Message-ID: <2601191342CEEE43887BDE71AB977258213F5107@irsmsx105.ger.corp.intel.com> References: <1425918532-8601-1-git-send-email-vladz@cloudius-systems.com> <1425918532-8601-2-git-send-email-vladz@cloudius-systems.com> In-Reply-To: <1425918532-8601-2-git-send-email-vladz@cloudius-systems.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.181] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [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: Tue, 10 Mar 2015 09:23:34 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Vlad Zolotarov > Sent: Monday, March 09, 2015 4:29 PM > To: dev@dpdk.org > 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 >=20 > Fixed the above in ixgbe_rx_alloc_bufs() and in ixgbe_recv_scattered_pkts= (). >=20 Acked-by: Konstantin Ananyev > Signed-off-by: Vlad Zolotarov > --- > lib/librte_pmd_ixgbe/ixgbe_rxtx.c | 13 +++++++------ > 1 file changed, 7 insertions(+), 6 deletions(-) >=20 > diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c b/lib/librte_pmd_ixgbe/ixg= be_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; >=20 > /* 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 =3D rxq->port_id; >=20 > /* populate the descriptors */ > - dma_addr =3D (uint64_t)mb->buf_physaddr + RTE_PKTMBUF_HEADROOM; > + dma_addr =3D rte_cpu_to_le_64(RTE_MBUF_DATA_DMA_ADDR_DEFAULT(mb)); > rxdp[i].read.hdr_addr =3D dma_addr; > rxdp[i].read.pkt_addr =3D dma_addr; > } > @@ -1559,13 +1559,14 @@ ixgbe_recv_scattered_pkts(void *rx_queue, struct = rte_mbuf **rx_pkts, > first_seg->ol_flags =3D pkt_flags; >=20 > if (likely(pkt_flags & PKT_RX_RSS_HASH)) > - first_seg->hash.rss =3D rxd.wb.lower.hi_dword.rss; > + first_seg->hash.rss =3D > + rte_le_to_cpu_32(rxd.wb.lower.hi_dword.rss); > else if (pkt_flags & PKT_RX_FDIR) { > first_seg->hash.fdir.hash =3D > - (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 =3D > - rxd.wb.lower.hi_dword.csum_ip.ip_id; > + rte_le_to_cpu_16(rxd.wb.lower.hi_dword.csum_ip.ip_id); > } >=20 > /* Prefetch data of first segment, if configured to do so. */ > -- > 2.1.0