From owner-svn-src-head@freebsd.org Sun Mar 1 17:46:29 2020 Return-Path: Delivered-To: svn-src-head@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 EAD3D246FAA; Sun, 1 Mar 2020 17:46:29 +0000 (UTC) (envelope-from imp@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) server-signature RSA-PSS (4096 bits) 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 48VrLF5YkQz4Srm; Sun, 1 Mar 2020 17:46:29 +0000 (UTC) (envelope-from imp@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 3C2B47377; Sun, 1 Mar 2020 17:46:29 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 021HkTRj088683; Sun, 1 Mar 2020 17:46:29 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 021HkSsl088681; Sun, 1 Mar 2020 17:46:28 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202003011746.021HkSsl088681@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 1 Mar 2020 17:46:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r358488 - head/sys/dev/bxe X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/bxe X-SVN-Commit-Revision: 358488 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2020 17:46:30 -0000 Author: imp Date: Sun Mar 1 17:46:28 2020 New Revision: 358488 URL: https://svnweb.freebsd.org/changeset/base/358488 Log: Remove FreeBSD 7-10 support from bxe driver. Use new PCIER and PCIEM names in the driver rather than relying on old, compat shims. Modified: head/sys/dev/bxe/bxe.c head/sys/dev/bxe/bxe.h Modified: head/sys/dev/bxe/bxe.c ============================================================================== --- head/sys/dev/bxe/bxe.c Sun Mar 1 17:27:35 2020 (r358487) +++ head/sys/dev/bxe/bxe.c Sun Mar 1 17:46:28 2020 (r358488) @@ -13261,8 +13261,8 @@ bxe_pcie_capability_read(struct bxe_softc *sc, static uint8_t bxe_is_pcie_pending(struct bxe_softc *sc) { - return (bxe_pcie_capability_read(sc, PCIR_EXPRESS_DEVICE_STA, 2) & - PCIM_EXP_STA_TRANSACTION_PND); + return (bxe_pcie_capability_read(sc, PCIER_DEVICE_STA, 2) & + PCIEM_STA_TRANSACTION_PND); } /* @@ -13286,7 +13286,7 @@ bxe_probe_pci_caps(struct bxe_softc *sc) } } - link_status = bxe_pcie_capability_read(sc, PCIR_EXPRESS_LINK_STA, 2); + link_status = bxe_pcie_capability_read(sc, PCIER_LINK_STA, 2); /* handle PCIe 2.0 workarounds for 57710 */ if (CHIP_IS_E1(sc)) { @@ -13296,16 +13296,16 @@ bxe_probe_pci_caps(struct bxe_softc *sc) /* workaround for 57710 errata E4_57710_27488 */ sc->devinfo.pcie_link_width = - ((link_status & PCIM_LINK_STA_WIDTH) >> 4); + ((link_status & PCIEM_LINK_STA_WIDTH) >> 4); if (sc->devinfo.pcie_link_speed > 1) { sc->devinfo.pcie_link_width = - ((link_status & PCIM_LINK_STA_WIDTH) >> 4) >> 1; + ((link_status & PCIEM_LINK_STA_WIDTH) >> 4) >> 1; } } else { sc->devinfo.pcie_link_speed = - (link_status & PCIM_LINK_STA_SPEED); + (link_status & PCIEM_LINK_STA_SPEED); sc->devinfo.pcie_link_width = - ((link_status & PCIM_LINK_STA_WIDTH) >> 4); + ((link_status & PCIEM_LINK_STA_WIDTH) >> 4); } BLOGD(sc, DBG_LOAD, "PCIe link speed=%d width=%d\n", @@ -16746,14 +16746,14 @@ bxe_init_pxp(struct bxe_softc *sc) uint16_t devctl; int r_order, w_order; - devctl = bxe_pcie_capability_read(sc, PCIR_EXPRESS_DEVICE_CTL, 2); + devctl = bxe_pcie_capability_read(sc, PCIER_DEVICE_CTL, 2); BLOGD(sc, DBG_LOAD, "read 0x%08x from devctl\n", devctl); - w_order = ((devctl & PCIM_EXP_CTL_MAX_PAYLOAD) >> 5); + w_order = ((devctl & PCIEM_CTL_MAX_PAYLOAD) >> 5); if (sc->mrrs == -1) { - r_order = ((devctl & PCIM_EXP_CTL_MAX_READ_REQUEST) >> 12); + r_order = ((devctl & PCIEM_CTL_MAX_READ_REQUEST) >> 12); } else { BLOGD(sc, DBG_LOAD, "forcing read order to %d\n", sc->mrrs); r_order = sc->mrrs; Modified: head/sys/dev/bxe/bxe.h ============================================================================== --- head/sys/dev/bxe/bxe.h Sun Mar 1 17:27:35 2020 (r358487) +++ head/sys/dev/bxe/bxe.h Sun Mar 1 17:46:28 2020 (r358488) @@ -117,34 +117,6 @@ __FBSDID("$FreeBSD$"); #define VF_MAC_CREDIT_CNT 0 #define VF_VLAN_CREDIT_CNT (0) -#if __FreeBSD_version < 800054 -#if defined(__i386__) || defined(__amd64__) -#define mb() __asm volatile("mfence;" : : : "memory") -#define wmb() __asm volatile("sfence;" : : : "memory") -#define rmb() __asm volatile("lfence;" : : : "memory") -static __inline void prefetch(void *x) -{ - __asm volatile("prefetcht0 %0" :: "m" (*(unsigned long *)x)); -} -#else -#define mb() -#define rmb() -#define wmb() -#define prefetch(x) -#endif -#endif - -#if __FreeBSD_version >= 1000000 -#define PCIR_EXPRESS_DEVICE_STA PCIER_DEVICE_STA -#define PCIM_EXP_STA_TRANSACTION_PND PCIEM_STA_TRANSACTION_PND -#define PCIR_EXPRESS_LINK_STA PCIER_LINK_STA -#define PCIM_LINK_STA_WIDTH PCIEM_LINK_STA_WIDTH -#define PCIM_LINK_STA_SPEED PCIEM_LINK_STA_SPEED -#define PCIR_EXPRESS_DEVICE_CTL PCIER_DEVICE_CTL -#define PCIM_EXP_CTL_MAX_PAYLOAD PCIEM_CTL_MAX_PAYLOAD -#define PCIM_EXP_CTL_MAX_READ_REQUEST PCIEM_CTL_MAX_READ_REQUEST -#endif - #ifndef ARRAY_SIZE #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) #endif @@ -708,10 +680,8 @@ struct bxe_fastpath { //uint8_t segs; -#if __FreeBSD_version >= 800000 #define BXE_BR_SIZE 4096 struct buf_ring *tx_br; -#endif }; /* struct bxe_fastpath */ /* sriov XXX */ @@ -2300,16 +2270,8 @@ void bxe_dump_mem(struct bxe_softc *sc, char *tag, void bxe_dump_mbuf_data(struct bxe_softc *sc, char *pTag, struct mbuf *m, uint8_t contents); -#if __FreeBSD_version >= 800000 -#if (__FreeBSD_version >= 1001513 && __FreeBSD_version < 1100000) ||\ - __FreeBSD_version >= 1100048 #define BXE_SET_FLOWID(m) M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE) #define BXE_VALID_FLOWID(m) (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) -#else -#define BXE_VALID_FLOWID(m) ((m->m_flags & M_FLOWID) != 0) -#define BXE_SET_FLOWID(m) m->m_flags |= M_FLOWID -#endif -#endif /* #if __FreeBSD_version >= 800000 */ /***********/ /* INLINES */