From owner-svn-src-all@FreeBSD.ORG Thu Dec 20 22:26:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 726E98AE; Thu, 20 Dec 2012 22:26:04 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4CF928FC12; Thu, 20 Dec 2012 22:26:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBKMQ4Wc034182; Thu, 20 Dec 2012 22:26:04 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBKMQ3JC034179; Thu, 20 Dec 2012 22:26:03 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201212202226.qBKMQ3JC034179@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 20 Dec 2012 22:26:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244514 - in head/sys/dev: ixgbe netmap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Dec 2012 22:26:04 -0000 Author: luigi Date: Thu Dec 20 22:26:03 2012 New Revision: 244514 URL: http://svnweb.freebsd.org/changeset/base/244514 Log: rename the 'tag' and 'map' fields used the rx ring to their previous names, 'ptag' and 'pmap' -- p stands for packet. This change reduces the difference between the code in stable/9 and head, and also helps using the same ixgbe_netmap.h on both branches. Approved by: Jack Vogel Modified: head/sys/dev/ixgbe/ixgbe.c head/sys/dev/ixgbe/ixgbe.h head/sys/dev/netmap/ixgbe_netmap.h Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Thu Dec 20 22:22:57 2012 (r244513) +++ head/sys/dev/ixgbe/ixgbe.c Thu Dec 20 22:26:03 2012 (r244514) @@ -3721,8 +3721,8 @@ ixgbe_refresh_mbufs(struct rx_ring *rxr, */ if ((rxbuf->flags & IXGBE_RX_COPY) == 0) { /* Get the memory mapping */ - error = bus_dmamap_load_mbuf_sg(rxr->tag, - rxbuf->map, mp, seg, &nsegs, BUS_DMA_NOWAIT); + error = bus_dmamap_load_mbuf_sg(rxr->ptag, + rxbuf->pmap, mp, seg, &nsegs, BUS_DMA_NOWAIT); if (error != 0) { printf("Refresh mbufs: payload dmamap load" " failure - %d\n", error); @@ -3731,7 +3731,7 @@ ixgbe_refresh_mbufs(struct rx_ring *rxr, goto update; } rxbuf->buf = mp; - bus_dmamap_sync(rxr->tag, rxbuf->map, + bus_dmamap_sync(rxr->ptag, rxbuf->pmap, BUS_DMASYNC_PREREAD); rxbuf->addr = rxr->rx_base[i].read.pkt_addr = htole64(seg[0].ds_addr); @@ -3790,15 +3790,15 @@ ixgbe_allocate_receive_buffers(struct rx 0, /* flags */ NULL, /* lockfunc */ NULL, /* lockfuncarg */ - &rxr->tag))) { + &rxr->ptag))) { device_printf(dev, "Unable to create RX DMA tag\n"); goto fail; } for (i = 0; i < rxr->num_desc; i++, rxbuf++) { rxbuf = &rxr->rx_buffers[i]; - error = bus_dmamap_create(rxr->tag, - BUS_DMA_NOWAIT, &rxbuf->map); + error = bus_dmamap_create(rxr->ptag, + BUS_DMA_NOWAIT, &rxbuf->pmap); if (error) { device_printf(dev, "Unable to create RX dma map\n"); goto fail; @@ -3897,9 +3897,9 @@ ixgbe_free_receive_ring(struct rx_ring * for (i = 0; i < rxr->num_desc; i++) { rxbuf = &rxr->rx_buffers[i]; if (rxbuf->buf != NULL) { - bus_dmamap_sync(rxr->tag, rxbuf->map, + bus_dmamap_sync(rxr->ptag, rxbuf->pmap, BUS_DMASYNC_POSTREAD); - bus_dmamap_unload(rxr->tag, rxbuf->map); + bus_dmamap_unload(rxr->ptag, rxbuf->pmap); rxbuf->buf->m_flags |= M_PKTHDR; m_freem(rxbuf->buf); rxbuf->buf = NULL; @@ -3966,7 +3966,7 @@ ixgbe_setup_receive_ring(struct rx_ring void *addr; addr = PNMB(slot + sj, &paddr); - netmap_load_map(rxr->tag, rxbuf->map, addr); + netmap_load_map(rxr->ptag, rxbuf->pmap, addr); /* Update descriptor */ rxr->rx_base[j].read.pkt_addr = htole64(paddr); continue; @@ -3981,13 +3981,13 @@ ixgbe_setup_receive_ring(struct rx_ring mp = rxbuf->buf; mp->m_pkthdr.len = mp->m_len = rxr->mbuf_sz; /* Get the memory mapping */ - error = bus_dmamap_load_mbuf_sg(rxr->tag, - rxbuf->map, mp, seg, + error = bus_dmamap_load_mbuf_sg(rxr->ptag, + rxbuf->pmap, mp, seg, &nsegs, BUS_DMA_NOWAIT); if (error != 0) goto fail; - bus_dmamap_sync(rxr->tag, - rxbuf->map, BUS_DMASYNC_PREREAD); + bus_dmamap_sync(rxr->ptag, + rxbuf->pmap, BUS_DMASYNC_PREREAD); /* Update descriptor */ rxr->rx_base[j].read.pkt_addr = htole64(seg[0].ds_addr); } @@ -4237,16 +4237,16 @@ ixgbe_free_receive_buffers(struct rx_rin for (int i = 0; i < adapter->num_rx_desc; i++) { rxbuf = &rxr->rx_buffers[i]; if (rxbuf->buf != NULL) { - bus_dmamap_sync(rxr->tag, rxbuf->map, + bus_dmamap_sync(rxr->ptag, rxbuf->pmap, BUS_DMASYNC_POSTREAD); - bus_dmamap_unload(rxr->tag, rxbuf->map); + bus_dmamap_unload(rxr->ptag, rxbuf->pmap); rxbuf->buf->m_flags |= M_PKTHDR; m_freem(rxbuf->buf); } rxbuf->buf = NULL; - if (rxbuf->map != NULL) { - bus_dmamap_destroy(rxr->tag, rxbuf->map); - rxbuf->map = NULL; + if (rxbuf->pmap != NULL) { + bus_dmamap_destroy(rxr->ptag, rxbuf->pmap); + rxbuf->pmap = NULL; } } if (rxr->rx_buffers != NULL) { @@ -4255,9 +4255,9 @@ ixgbe_free_receive_buffers(struct rx_rin } } - if (rxr->tag != NULL) { - bus_dma_tag_destroy(rxr->tag); - rxr->tag = NULL; + if (rxr->ptag != NULL) { + bus_dma_tag_destroy(rxr->ptag); + rxr->ptag = NULL; } return; Modified: head/sys/dev/ixgbe/ixgbe.h ============================================================================== --- head/sys/dev/ixgbe/ixgbe.h Thu Dec 20 22:22:57 2012 (r244513) +++ head/sys/dev/ixgbe/ixgbe.h Thu Dec 20 22:26:03 2012 (r244514) @@ -247,7 +247,7 @@ struct ixgbe_tx_buf { struct ixgbe_rx_buf { struct mbuf *buf; struct mbuf *fmp; - bus_dmamap_t map; + bus_dmamap_t pmap; u_int flags; #define IXGBE_RX_COPY 0x01 uint64_t addr; @@ -348,7 +348,7 @@ struct rx_ring { u16 process_limit; char mtx_name[16]; struct ixgbe_rx_buf *rx_buffers; - bus_dma_tag_t tag; + bus_dma_tag_t ptag; u32 bytes; /* Used for AIM calc */ u32 packets; Modified: head/sys/dev/netmap/ixgbe_netmap.h ============================================================================== --- head/sys/dev/netmap/ixgbe_netmap.h Thu Dec 20 22:22:57 2012 (r244513) +++ head/sys/dev/netmap/ixgbe_netmap.h Thu Dec 20 22:26:03 2012 (r244514) @@ -503,8 +503,8 @@ ixgbe_netmap_rxsync(struct ifnet *ifp, u ring->slot[j].len = le16toh(curr->wb.upper.length) - crclen; if (ix_write_len) D("rx[%d] len %d", j, ring->slot[j].len); - bus_dmamap_sync(rxr->tag, - rxr->rx_buffers[l].map, BUS_DMASYNC_POSTREAD); + bus_dmamap_sync(rxr->ptag, + rxr->rx_buffers[l].pmap, BUS_DMASYNC_POSTREAD); j = (j == lim) ? 0 : j + 1; l = (l == lim) ? 0 : l + 1; } @@ -556,12 +556,12 @@ ixgbe_netmap_rxsync(struct ifnet *ifp, u goto ring_reset; if (slot->flags & NS_BUF_CHANGED) { - netmap_reload_map(rxr->tag, rxbuf->map, addr); + netmap_reload_map(rxr->ptag, rxbuf->pmap, addr); slot->flags &= ~NS_BUF_CHANGED; } curr->wb.upper.status_error = 0; curr->read.pkt_addr = htole64(paddr); - bus_dmamap_sync(rxr->tag, rxbuf->map, + bus_dmamap_sync(rxr->ptag, rxbuf->pmap, BUS_DMASYNC_PREREAD); j = (j == lim) ? 0 : j + 1; l = (l == lim) ? 0 : l + 1;