From owner-svn-src-all@freebsd.org Sat Sep 9 11:49:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B3A8E11A95; Sat, 9 Sep 2017 11:49:37 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3AD8D65C16; Sat, 9 Sep 2017 11:49:37 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v89BnaTZ091070; Sat, 9 Sep 2017 11:49:36 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v89BnafW091068; Sat, 9 Sep 2017 11:49:36 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201709091149.v89BnafW091068@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Sat, 9 Sep 2017 11:49:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323361 - head/sys/dev/neta X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/dev/neta X-SVN-Commit-Revision: 323361 X-SVN-Commit-Repository: base 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.23 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: Sat, 09 Sep 2017 11:49:37 -0000 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 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];