From owner-svn-ports-all@freebsd.org Thu Jul 16 06:09:18 2020 Return-Path: Delivered-To: svn-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 86CA8356840; Thu, 16 Jul 2020 06:09:18 +0000 (UTC) (envelope-from ale@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B6kNZ310vz44T5; Thu, 16 Jul 2020 06:09:18 +0000 (UTC) (envelope-from ale@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4648323C13; Thu, 16 Jul 2020 06:09:18 +0000 (UTC) (envelope-from ale@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06G69I1Q048179; Thu, 16 Jul 2020 06:09:18 GMT (envelope-from ale@FreeBSD.org) Received: (from ale@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06G69Hok048173; Thu, 16 Jul 2020 06:09:17 GMT (envelope-from ale@FreeBSD.org) Message-Id: <202007160609.06G69Hok048173@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ale set sender to ale@FreeBSD.org using -f From: Alex Dupre Date: Thu, 16 Jul 2020 06:09:17 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r542324 - in head/net: . realtek-re-kmod realtek-re-kmod/files X-SVN-Group: ports-head X-SVN-Commit-Author: ale X-SVN-Commit-Paths: in head/net: . realtek-re-kmod realtek-re-kmod/files X-SVN-Commit-Revision: 542324 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jul 2020 06:09:18 -0000 Author: ale Date: Thu Jul 16 06:09:16 2020 New Revision: 542324 URL: https://svnweb.freebsd.org/changeset/ports/542324 Log: Realtek PCIe FE / GBE / 2.5G / Gaming Ethernet Family Controller kernel driver. This is the official driver from Realtek and can be loaded instead of the FreeBSD driver built into the GENERIC kernel if you experience issues with it (eg. watchdog timeouts), or your card is not supported. Supported devices: * 2.5G Gigabit Ethernet - RTL8125 / RTL8125B(S) * 10/100/1000M Gigabit Ethernet - RTL8111B / RTL8111C / RTL8111D / RTL8111E / RTL8111F / RTL8111G(S) RTL8111H(S) / RTL8118(A)(S) / RTL8119i / RTL8111L / RTL8111K - RTL8168B / RTL8168E / RTL8168H - RTL8111DP / RTL8111EP / RTL8111FP - RTL8411 / RTL8411B * 10/100M Fast Ethernet - RTL8101E / RTL8102E / RTL8103E / RTL8105E / RTL8106E / RTL8107E - RTL8401 / RTL8402 WWW: https://www.realtek.com/en/component/zoo/category/network-interface-controllers-10-100-1000m-gigabit-ethernet-pci-express-software Added: head/net/realtek-re-kmod/ head/net/realtek-re-kmod/Makefile (contents, props changed) head/net/realtek-re-kmod/distinfo (contents, props changed) head/net/realtek-re-kmod/files/ head/net/realtek-re-kmod/files/patch-if__re.c (contents, props changed) head/net/realtek-re-kmod/pkg-descr (contents, props changed) head/net/realtek-re-kmod/pkg-message (contents, props changed) Modified: head/net/Makefile Modified: head/net/Makefile ============================================================================== --- head/net/Makefile Thu Jul 16 06:06:58 2020 (r542323) +++ head/net/Makefile Thu Jul 16 06:09:16 2020 (r542324) @@ -1158,6 +1158,7 @@ SUBDIR += rdapper SUBDIR += rdesktop SUBDIR += rdist6 + SUBDIR += realtek-re-kmod SUBDIR += reaver SUBDIR += recvnet SUBDIR += redir Added: head/net/realtek-re-kmod/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/realtek-re-kmod/Makefile Thu Jul 16 06:09:16 2020 (r542324) @@ -0,0 +1,21 @@ +# Created by: Alex Dupre +# $FreeBSD$ + +PORTNAME= re +DISTVERSION= v196.04 +CATEGORIES= net +MASTER_SITES= LOCAL/ale +PKGNAMEPREFIX= realtek- +PKGNAMESUFFIX= -kmod +DISTNAME= rtl_bsd_drv_${DISTVERSION} + +MAINTAINER= ale@FreeBSD.org +COMMENT= Kernel driver for Realtek PCIe Ethernet Controllers + +LICENSE= BSD4CLAUSE + +USES= kmod tar:tgz uidfix + +PLIST_FILES= ${KMODDIR}/if_re.ko + +.include Added: head/net/realtek-re-kmod/distinfo ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/realtek-re-kmod/distinfo Thu Jul 16 06:09:16 2020 (r542324) @@ -0,0 +1,3 @@ +TIMESTAMP = 1594744100 +SHA256 (rtl_bsd_drv_v196.04.tgz) = 1bffd5cc81da797474bd097cc88c03aac288970a0b7e7185b92a74070e9998a7 +SIZE (rtl_bsd_drv_v196.04.tgz) = 114985 Added: head/net/realtek-re-kmod/files/patch-if__re.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/realtek-re-kmod/files/patch-if__re.c Thu Jul 16 06:09:16 2020 (r542324) @@ -0,0 +1,139 @@ +--- if_re.c.orig 2020-06-18 16:22:59 UTC ++++ if_re.c +@@ -62,8 +62,8 @@ __FBSDID("$FreeBSD: src/sys/dev/re/if_re.c,v " RE_VERS + #include + #include + #include ++#include + #include +-#include + + #include + #include +@@ -85,7 +85,7 @@ __FBSDID("$FreeBSD: src/sys/dev/re/if_re.c,v " RE_VERS + #include + + #include +-#include ++#include "if_rereg.h" + #ifdef ENABLE_FIBER_SUPPORT + #include + #endif //ENABLE_FIBER_SUPPORT +@@ -258,34 +258,48 @@ static void re_hw_start_unlock(struct re_softc *sc); + static void re_hw_start_unlock_8125(struct re_softc *sc); + + /* Tunables. */ ++SYSCTL_NODE(_hw, OID_AUTO, re, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, ""); + static int msi_disable = 1; +-TUNABLE_INT("hw.re.msi_disable", &msi_disable); ++SYSCTL_INT(_hw_re, OID_AUTO, msi_disable, CTLFLAG_RDTUN, &msi_disable, 0, ++ ""); + static int msix_disable = 0; +-TUNABLE_INT("hw.re.msix_disable", &msix_disable); ++SYSCTL_INT(_hw_re, OID_AUTO, msix_disable, CTLFLAG_RDTUN, &msix_disable, 0, ++ ""); + static int prefer_iomap = 0; +-TUNABLE_INT("hw.re.prefer_iomap", &prefer_iomap); ++SYSCTL_INT(_hw_re, OID_AUTO, prefer_iomap, CTLFLAG_RDTUN, &prefer_iomap, 0, ++ ""); + #ifdef ENABLE_EEE + static int eee_enable = 1; + #else + static int eee_enable = 0; + #endif +-TUNABLE_INT("hw.re.eee_enable", &eee_enable); ++SYSCTL_INT(_hw_re, OID_AUTO, eee_enable, CTLFLAG_RDTUN, &eee_enable, 0, ++ ""); + static int phy_power_saving = 1; +-TUNABLE_INT("hw.re.phy_power_saving", &phy_power_saving); ++SYSCTL_INT(_hw_re, OID_AUTO, phy_power_saving, CTLFLAG_RDTUN, ++ &phy_power_saving, 0, ++ ""); + static int phy_mdix_mode = RE_ETH_PHY_AUTO_MDI_MDIX; +-TUNABLE_INT("hw.re.phy_mdix_mode", &phy_mdix_mode); ++SYSCTL_INT(_hw_re, OID_AUTO, phy_mdix_mode, CTLFLAG_RDTUN, &phy_mdix_mode, 0, ++ ""); + #ifdef ENABLE_S5WOL + static int s5wol = 1; + #else + static int s5wol = 0; +-TUNABLE_INT("hw.re.s5wol", &s5wol); ++SYSCTL_INT(_hw_re, OID_AUTO, s5wol, CTLFLAG_RDTUN, &s5wol, 0, ++ ""); + #endif + #ifdef ENABLE_S0_MAGIC_PACKET + static int s0_magic_packet = 1; + #else + static int s0_magic_packet = 0; + #endif +-TUNABLE_INT("hw.re.s0_magic_packet", &s0_magic_packet); ++SYSCTL_INT(_hw_re, OID_AUTO, s0_magic_packet, CTLFLAG_RDTUN, ++ &s0_magic_packet, 0, ++ ""); ++static int max_rx_mbuf_sz = MJUM9BYTES; ++SYSCTL_INT(_hw_re, OID_AUTO, max_rx_mbuf_sz, CTLFLAG_RDTUN, &max_rx_mbuf_sz, 0, ++ ""); + + #define RE_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP) + +@@ -3428,16 +3442,6 @@ is_valid_ether_addr(const u_int8_t * addr) + return !is_multicast_ether_addr(addr) && !is_zero_ether_addr(addr); + } + +-static inline void +-random_ether_addr(u_int8_t * dst) +-{ +- if (read_random(dst, 6) == 0) +- arc4rand(dst, 6, 0); +- +- dst[0] &= 0xfe; +- dst[0] |= 0x02; +-} +- + static void re_disable_now_is_oob(struct re_softc *sc) + { + if (sc->re_hw_supp_now_is_oob_ver == 1) +@@ -3889,7 +3893,7 @@ static void re_get_hw_mac_address(struct re_softc *sc, + + if (!is_valid_ether_addr(eaddr)) { + device_printf(dev,"Invalid ether addr: %6D\n", eaddr, ":"); +- random_ether_addr(eaddr); ++ ether_gen_addr(sc->re_ifp, (struct ether_addr *)eaddr); + device_printf(dev,"Random ether addr: %6D\n", eaddr, ":"); + } + +@@ -4291,9 +4295,9 @@ static void re_init_software_variable(struct re_softc + + sc->re_rx_mbuf_sz = sc->max_jumbo_frame_size + ETHER_VLAN_ENCAP_LEN + ETHER_HDR_LEN + ETHER_CRC_LEN + RE_ETHER_ALIGN + 1; + +- if (sc->re_rx_mbuf_sz > MJUM9BYTES) { +- sc->max_jumbo_frame_size -= (sc->re_rx_mbuf_sz - MJUM9BYTES); +- sc->re_rx_mbuf_sz = MJUM9BYTES; ++ if (sc->re_rx_mbuf_sz > max_rx_mbuf_sz) { ++ sc->max_jumbo_frame_size -= (sc->re_rx_mbuf_sz - max_rx_mbuf_sz); ++ sc->re_rx_mbuf_sz = max_rx_mbuf_sz; + } + + switch(sc->re_type) { +@@ -8640,7 +8644,9 @@ struct re_softc *sc; + } + + /* now program new ones */ +-#if OS_VER > VERSION(6,0) ++#if OS_VER >= VERSION(12,0) ++ if_maddr_rlock(ifp); ++#elif OS_VER > VERSION(6,0) + IF_ADDR_LOCK(ifp); + #endif + #if OS_VER < VERSION(4,9) +@@ -8662,7 +8668,9 @@ struct re_softc *sc; + hashes[1] |= (1 << (h - 32)); + mcnt++; + } +-#if OS_VER > VERSION(6,0) ++#if OS_VER >= VERSION(12,0) ++ if_maddr_runlock(ifp); ++#elif OS_VER > VERSION(6,0) + IF_ADDR_UNLOCK(ifp); + #endif + Added: head/net/realtek-re-kmod/pkg-descr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/realtek-re-kmod/pkg-descr Thu Jul 16 06:09:16 2020 (r542324) @@ -0,0 +1,24 @@ +Realtek PCIe FE / GBE / 2.5G / Gaming Ethernet Family Controller +kernel driver. + +This is the official driver from Realtek and can be loaded instead of +the FreeBSD driver built into the GENERIC kernel if you experience +issues with it (eg. watchdog timeouts), or your card is not supported. + +Supported devices: + +* 2.5G Gigabit Ethernet + - RTL8125 / RTL8125B(S) + +* 10/100/1000M Gigabit Ethernet + - RTL8111B / RTL8111C / RTL8111D / RTL8111E / RTL8111F / RTL8111G(S) + RTL8111H(S) / RTL8118(A)(S) / RTL8119i / RTL8111L / RTL8111K + - RTL8168B / RTL8168E / RTL8168H + - RTL8111DP / RTL8111EP / RTL8111FP + - RTL8411 / RTL8411B + +* 10/100M Fast Ethernet + - RTL8101E / RTL8102E / RTL8103E / RTL8105E / RTL8106E / RTL8107E + - RTL8401 / RTL8402 + +WWW: https://www.realtek.com/en/component/zoo/category/network-interface-controllers-10-100-1000m-gigabit-ethernet-pci-express-software Added: head/net/realtek-re-kmod/pkg-message ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/realtek-re-kmod/pkg-message Thu Jul 16 06:09:16 2020 (r542324) @@ -0,0 +1,11 @@ +[ +{ type: install + message: <