Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 9 Sep 2017 11:49:36 +0000 (UTC)
From:      Marcin Wojtas <mw@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r323361 - head/sys/dev/neta
Message-ID:  <201709091149.v89BnafW091068@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mw
Date: Sat Sep  9 11:49:36 2017
New Revision: 323361
URL: https://svnweb.freebsd.org/changeset/base/323361

Log:
  Store virtual address of buffer in mvneta_rx_ring
  
  Now the virtual address of received buffer is taken from a software ring.
  Thanks to this, we can use the NETA driver on 64 bits architecture and
  avoid 32-bit buf_cookie descriptor field limitation.
  
  Submitted by: Patryk Duda <pdk@semihalf.com>
  Obtained from: Semihalf
  Sponsored by: Semihalf
  Differential Revision: https://reviews.freebsd.org/D12257

Modified:
  head/sys/dev/neta/if_mvneta.c
  head/sys/dev/neta/if_mvnetavar.h

Modified: head/sys/dev/neta/if_mvneta.c
==============================================================================
--- head/sys/dev/neta/if_mvneta.c	Sat Sep  9 11:46:34 2017	(r323360)
+++ head/sys/dev/neta/if_mvneta.c	Sat Sep  9 11:49:36 2017	(r323361)
@@ -3008,7 +3008,7 @@ mvneta_rx_queue(struct mvneta_softc *sc, int q, int np
 		 * bytecnt cover MH, PKT, CRC
 		 */
 		pktlen = r->bytecnt - ETHER_CRC_LEN - MVNETA_HWHEADER_SIZE;
-		pktbuf = (uint8_t *)r->bufptr_va + MVNETA_PACKET_OFFSET +
+		pktbuf = (uint8_t *)rx->rxbuf_virt_addr[rx->dma] + MVNETA_PACKET_OFFSET +
                     MVNETA_HWHEADER_SIZE;
 
 		/* Prefetch mbuf data. */
@@ -3135,7 +3135,7 @@ mvneta_rx_queue_refill(struct mvneta_softc *sc, int q)
 		rxbuf->m = m;
 		r = &rx->desc[rx->cpu];
 		r->bufptr_pa = segs.ds_addr;
-		r->bufptr_va = (uint32_t)m->m_data;
+		rx->rxbuf_virt_addr[rx->cpu] = m->m_data;
 
 		rx->cpu = rx_counter_adv(rx->cpu, 1);
 	}

Modified: head/sys/dev/neta/if_mvnetavar.h
==============================================================================
--- head/sys/dev/neta/if_mvnetavar.h	Sat Sep  9 11:46:34 2017	(r323360)
+++ head/sys/dev/neta/if_mvnetavar.h	Sat Sep  9 11:49:36 2017	(r323361)
@@ -118,6 +118,9 @@ struct mvneta_rx_ring {
 	bus_dmamap_t			desc_map;
 	bus_addr_t			desc_pa;
 
+	/* Virtual address of the RX buffer */
+	void 				*rxbuf_virt_addr[MVNETA_RX_RING_CNT];
+
 	/* Managment entries for each of descritors */
 	struct mvneta_buf		rxbuf[MVNETA_RX_RING_CNT];
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201709091149.v89BnafW091068>