From owner-svn-soc-all@freebsd.org Wed Aug 1 20:04:42 2018 Return-Path: Delivered-To: svn-soc-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82A0C1067DD1 for ; Wed, 1 Aug 2018 20:04:42 +0000 (UTC) (envelope-from sduo@FreeBSD.org) Received: from mxrelay.ysv.freebsd.org (mxrelay.ysv.freebsd.org [IPv6:2001:1900:2254:206a::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.ysv.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 13E0A85464 for ; Wed, 1 Aug 2018 20:04:42 +0000 (UTC) (envelope-from sduo@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.ysv.freebsd.org (Postfix) with ESMTPS id 465EA1F3EC for ; Wed, 1 Aug 2018 20:04:41 +0000 (UTC) (envelope-from sduo@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.15.2/8.15.2) with ESMTP id w71K4foC052957 for ; Wed, 1 Aug 2018 20:04:41 GMT (envelope-from sduo@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.15.2/8.15.2/Submit) id w71K4cX3052945 for svn-soc-all@FreeBSD.org; Wed, 1 Aug 2018 20:04:38 GMT (envelope-from sduo@FreeBSD.org) Date: Wed, 1 Aug 2018 20:04:38 GMT Message-Id: <201808012004.w71K4cX3052945@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to sduo@FreeBSD.org using -f From: sduo@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r337272 - in soc2018/sduo/head/sys: dev/cxgbe dev/ixl net MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Aug 2018 20:04:42 -0000 Author: sduo Date: Wed Aug 1 20:04:37 2018 New Revision: 337272 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=337272 Log: Updated calls to NMB(), PNMB() and NETMAP_BUF_SIZE(). Modified: soc2018/sduo/head/sys/dev/cxgbe/t4_netmap.c soc2018/sduo/head/sys/dev/ixl/ixl_txrx.c soc2018/sduo/head/sys/net/iflib.c Modified: soc2018/sduo/head/sys/dev/cxgbe/t4_netmap.c ============================================================================== --- soc2018/sduo/head/sys/dev/cxgbe/t4_netmap.c Wed Aug 1 19:54:10 2018 (r337271) +++ soc2018/sduo/head/sys/dev/cxgbe/t4_netmap.c Wed Aug 1 20:04:37 2018 (r337272) @@ -328,12 +328,12 @@ hwb = &sc->sge.hw_buf_info[0]; for (i = 0; i < SGE_FLBUF_SIZES; i++, hwb++) { - if (hwb->size == NETMAP_BUF_SIZE(na)) + if (hwb->size == NETMAP_BUF_SIZE(na, 0)) break; } if (i >= SGE_FLBUF_SIZES) { if_printf(ifp, "no hwidx for netmap buffer size %d.\n", - NETMAP_BUF_SIZE(na)); + NETMAP_BUF_SIZE(na, 0)); return (ENXIO); } hwidx = i; @@ -360,7 +360,7 @@ for (j = 0; j < nm_rxq->fl_sidx; j++) { uint64_t ba; - PNMB(na, &slot[j], &ba); + PNMB(kring, &slot[j], &ba); MPASS(ba != 0); nm_rxq->fl_desc[j] = htobe64(ba | hwidx); } @@ -598,7 +598,7 @@ for (i = 0; i < n; i++) { slot = &ring->slot[kring->nr_hwcur]; - PNMB(kring->na, slot, &ba); + PNMB(kring, slot, &ba); MPASS(ba != 0); cpl->ctrl0 = nm_txq->cpl_ctrl0; @@ -825,7 +825,7 @@ while (n > 0) { for (i = 0; i < 8; i++, fl_pidx++, slot++) { - PNMB(na, slot, &ba); + PNMB(kring, slot, &ba); MPASS(ba != 0); nm_rxq->fl_desc[fl_pidx] = htobe64(ba | hwidx); slot->flags &= ~NS_BUF_CHANGED; Modified: soc2018/sduo/head/sys/dev/ixl/ixl_txrx.c ============================================================================== --- soc2018/sduo/head/sys/dev/ixl/ixl_txrx.c Wed Aug 1 19:54:10 2018 (r337271) +++ soc2018/sduo/head/sys/dev/ixl/ixl_txrx.c Wed Aug 1 20:04:37 2018 (r337272) @@ -616,8 +616,9 @@ * netmap slot index, si */ if (slot) { - int si = netmap_idx_n2k(na->tx_rings[que->me], i); - netmap_load_map(na, buf->tag, buf->map, NMB(na, slot + si)); + struct netmap_kring *kring = na->tx_rings[que->me]; + int si = netmap_idx_n2k(kring, i); + netmap_load_map(na, buf->tag, buf->map, NMB(kring, slot + si)); } #endif /* DEV_NETMAP */ /* Clear the EOP index */ @@ -1417,11 +1418,12 @@ * an mbuf, so end the block with a continue; */ if (slot) { - int sj = netmap_idx_n2k(na->rx_rings[que->me], j); + struct netmap_kring *kring = na->rx_rings[que->me]; + int sj = netmap_idx_n2k(kring, j); uint64_t paddr; void *addr; - addr = PNMB(na, slot + sj, &paddr); + addr = PNMB(kring, slot + sj, &paddr); netmap_load_map(na, rxr->dma.tag, buf->pmap, addr); /* Update descriptor and the cached value */ rxr->base[j].read.pkt_addr = htole64(paddr); Modified: soc2018/sduo/head/sys/net/iflib.c ============================================================================== --- soc2018/sduo/head/sys/net/iflib.c Wed Aug 1 19:54:10 2018 (r337271) +++ soc2018/sduo/head/sys/net/iflib.c Wed Aug 1 20:04:37 2018 (r337272) @@ -847,7 +847,7 @@ while (nm_i != head) { for (int tmp_pidx = 0; tmp_pidx < IFLIB_MAX_RX_REFRESH && nm_i != head; tmp_pidx++) { struct netmap_slot *slot = &ring->slot[nm_i]; - void *addr = PNMB(na, slot, &fl->ifl_bus_addrs[tmp_pidx]); + void *addr = PNMB(kring, slot, &fl->ifl_bus_addrs[tmp_pidx]); uint32_t nic_i_dma = refill_pidx; nic_i = netmap_idx_k2n(kring, nm_i); @@ -975,7 +975,7 @@ struct netmap_slot *slot = &ring->slot[nm_i]; u_int len = slot->len; uint64_t paddr; - void *addr = PNMB(na, slot, &paddr); + void *addr = PNMB(kring, slot, &paddr); int flags = (slot->flags & NS_REPORT || nic_i == 0 || nic_i == report_frequency) ? IPI_TX_INTR : 0; @@ -1201,8 +1201,9 @@ * netmap_idx_n2k() maps a nic index, i, into the corresponding * netmap slot index, si */ - int si = netmap_idx_n2k(na->tx_rings[txq->ift_id], i); - netmap_load_map(na, txq->ift_desc_tag, txq->ift_sds.ifsd_map[i], NMB(na, slot + si)); + struct netmap_kring *kring = na->tx_rings[txq->ift_id]; + int si = netmap_idx_n2k(kring, i); + netmap_load_map(na, txq->ift_desc_tag, txq->ift_sds.ifsd_map[i], NMB(kring, slot + si)); } }