svn commit: r358491 - head/sys/dev/bxe

Warner Losh imp at FreeBSD.org
Sun Mar 1 18:17:54 UTC 2020


Author: imp
Date: Sun Mar  1 18:17:51 2020
New Revision: 358491
URL: https://svnweb.freebsd.org/changeset/base/358491

Log:
  Finish removing support from old versions
  
  Eliminate code for old versions, inline pci_find_cap instead of relying on
  compat ifdef.
  
  This commit should have been combined with r358488 before pushing it in.

Modified:
  head/sys/dev/bxe/bxe.c

Modified: head/sys/dev/bxe/bxe.c
==============================================================================
--- head/sys/dev/bxe/bxe.c	Sun Mar  1 18:03:09 2020	(r358490)
+++ head/sys/dev/bxe/bxe.c	Sun Mar  1 18:17:51 2020	(r358491)
@@ -59,14 +59,6 @@ __FBSDID("$FreeBSD$");
 #define CSUM_UDP_IPV6 0
 #endif
 
-/*
- * pci_find_cap was added in r219865. Re-define this at pci_find_extcap
- * for older kernels that don't include this changeset.
- */
-#if __FreeBSD_version < 900035
-#define pci_find_cap pci_find_extcap
-#endif
-
 #define BXE_DEF_SB_ATT_IDX 0x0001
 #define BXE_DEF_SB_IDX     0x0002
 
@@ -3106,11 +3098,9 @@ bxe_tpa_stop(struct bxe_softc          *sc,
         /* assign packet to this interface interface */
         if_setrcvif(m, ifp);
 
-#if __FreeBSD_version >= 800000
         /* specify what RSS queue was used for this flow */
         m->m_pkthdr.flowid = fp->index;
         BXE_SET_FLOWID(m);
-#endif
 
         if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1);
         fp->eth_q_stats.rx_tpa_pkts++;
@@ -3395,11 +3385,9 @@ bxe_rxeof(struct bxe_softc    *sc,
             m->m_flags |= M_VLANTAG;
         }
 
-#if __FreeBSD_version >= 800000
         /* specify what RSS queue was used for this flow */
         m->m_pkthdr.flowid = fp->index;
         BXE_SET_FLOWID(m);
-#endif
 
 next_rx:
 
@@ -4749,7 +4737,6 @@ bxe_dump_mbuf(struct bxe_softc *sc,
 
     while (m) {
 
-#if __FreeBSD_version >= 1000000
         BLOGD(sc, DBG_MBUF,
               "%02d: mbuf=%p m_len=%d m_flags=0x%b m_data=%p\n",
               i, m, m->m_len, m->m_flags, M_FLAG_BITS, m->m_data);
@@ -4760,27 +4747,7 @@ bxe_dump_mbuf(struct bxe_softc *sc,
                    i, m->m_pkthdr.len, m->m_flags, M_FLAG_BITS,
                    (int)m->m_pkthdr.csum_flags, CSUM_BITS);
         }
-#else
-        BLOGD(sc, DBG_MBUF,
-              "%02d: mbuf=%p m_len=%d m_flags=0x%b m_data=%p\n",
-              i, m, m->m_len, m->m_flags,
-              "\20\1M_EXT\2M_PKTHDR\3M_EOR\4M_RDONLY", m->m_data);
 
-        if (m->m_flags & M_PKTHDR) {
-             BLOGD(sc, DBG_MBUF,
-                   "%02d: - m_pkthdr: tot_len=%d flags=0x%b csum_flags=%b\n",
-                   i, m->m_pkthdr.len, m->m_flags,
-                   "\20\12M_BCAST\13M_MCAST\14M_FRAG"
-                   "\15M_FIRSTFRAG\16M_LASTFRAG\21M_VLANTAG"
-                   "\22M_PROMISC\23M_NOFREE",
-                   (int)m->m_pkthdr.csum_flags,
-                   "\20\1CSUM_IP\2CSUM_TCP\3CSUM_UDP\4CSUM_IP_FRAGS"
-                   "\5CSUM_FRAGMENT\6CSUM_TSO\11CSUM_IP_CHECKED"
-                   "\12CSUM_IP_VALID\13CSUM_DATA_VALID"
-                   "\14CSUM_PSEUDO_HDR");
-        }
-#endif /* #if __FreeBSD_version >= 1000000 */
-
         if (m->m_flags & M_EXT) {
             switch (m->m_ext.ext_type) {
             case EXT_CLUSTER:    type = "EXT_CLUSTER";    break;
@@ -5163,9 +5130,7 @@ bxe_tx_encap(struct bxe_fastpath *fp, struct mbuf **m_
 
     sc = fp->sc;
 
-#if __FreeBSD_version >= 800000
     M_ASSERTPKTHDR(*m_head);
-#endif /* #if __FreeBSD_version >= 800000 */
 
     m0 = *m_head;
     rc = defragged = nbds = ovlan = vlan_off = total_pkt_size = 0;
@@ -5671,8 +5636,6 @@ bxe_tx_start(if_t ifp)
     BXE_FP_TX_UNLOCK(fp);
 }
 
-#if __FreeBSD_version >= 901504
-
 static int
 bxe_tx_mq_start_locked(struct bxe_softc    *sc,
                        if_t                ifp,
@@ -5860,8 +5823,6 @@ bxe_mq_flush(struct ifnet *ifp)
     if_qflush(ifp);
 }
 
-#endif /* FreeBSD_version >= 901504 */
-
 static uint16_t
 bxe_cid_ilt_lines(struct bxe_softc *sc)
 {
@@ -6221,7 +6182,6 @@ bxe_free_fp_buffers(struct bxe_softc *sc)
     for (i = 0; i < sc->num_queues; i++) {
         fp = &sc->fp[i];
 
-#if __FreeBSD_version >= 901504
         if (fp->tx_br != NULL) {
             /* just in case bxe_mq_flush() wasn't called */
             if (mtx_initialized(&fp->tx_mtx)) {
@@ -6233,7 +6193,6 @@ bxe_free_fp_buffers(struct bxe_softc *sc)
                 BXE_FP_TX_UNLOCK(fp);
             }
         }
-#endif
 
         /* free all RX buffers */
         bxe_free_rx_bd_chain(fp);
@@ -11315,9 +11274,7 @@ bxe_get_q_flags(struct bxe_softc    *sc,
 
     if (if_getcapenable(sc->ifp) & IFCAP_LRO) {
         bxe_set_bit(ECORE_Q_FLG_TPA, &flags);
-#if __FreeBSD_version >= 800000
         bxe_set_bit(ECORE_Q_FLG_TPA_IPV6, &flags);
-#endif
     }
 
     if (leading) {
@@ -13065,13 +13022,8 @@ bxe_init_ifnet(struct bxe_softc *sc)
     if_setioctlfn(ifp, bxe_ioctl);
     if_setstartfn(ifp, bxe_tx_start);
     if_setgetcounterfn(ifp, bxe_get_counter);
-#if __FreeBSD_version >= 901504
     if_settransmitfn(ifp, bxe_tx_mq_start);
     if_setqflushfn(ifp, bxe_mq_flush);
-#endif
-#ifdef FreeBSD8_0
-    if_settimer(ifp, 0);
-#endif
     if_setinitfn(ifp, bxe_init);
     if_setmtu(ifp, sc->mtu);
     if_sethwassist(ifp, (CSUM_IP      |
@@ -13082,15 +13034,8 @@ bxe_init_ifnet(struct bxe_softc *sc)
                         CSUM_UDP_IPV6));
 
     capabilities =
-#if __FreeBSD_version < 700000
         (IFCAP_VLAN_MTU       |
          IFCAP_VLAN_HWTAGGING |
-         IFCAP_HWCSUM         |
-         IFCAP_JUMBO_MTU      |
-         IFCAP_LRO);
-#else
-        (IFCAP_VLAN_MTU       |
-         IFCAP_VLAN_HWTAGGING |
          IFCAP_VLAN_HWTSO     |
          IFCAP_VLAN_HWFILTER  |
          IFCAP_VLAN_HWCSUM    |
@@ -13100,7 +13045,6 @@ bxe_init_ifnet(struct bxe_softc *sc)
          IFCAP_TSO4           |
          IFCAP_TSO6           |
          IFCAP_WOL_MAGIC);
-#endif
     if_setcapabilitiesbit(ifp, capabilities, 0); /* XXX */
     if_setcapenable(ifp, if_getcapabilities(ifp));
     if_setbaudrate(ifp, IF_Gbps(10));
@@ -16107,7 +16051,6 @@ bxe_add_sysctls(struct bxe_softc *sc)
 
     sc->debug = bxe_debug;
 
-#if __FreeBSD_version >= 900000
     SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "bc_version",
                       CTLFLAG_RD, sc->devinfo.bc_ver_str, 0,
                       "bootcode version");
@@ -16126,26 +16069,6 @@ bxe_add_sysctls(struct bxe_softc *sc)
     SYSCTL_ADD_ULONG(ctx, children, OID_AUTO, "debug",
                     CTLFLAG_RW, &sc->debug,
                     "debug logging mode");
-#else
-    SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "bc_version",
-                      CTLFLAG_RD, &sc->devinfo.bc_ver_str, 0,
-                      "bootcode version");
-    SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "fw_version",
-                      CTLFLAG_RD, &sc->fw_ver_str, 0,
-                      "firmware version");
-    SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "mf_mode",
-                      CTLFLAG_RD, &sc->mf_mode_str, 0,
-                      "multifunction mode");
-    SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "mac_addr",
-                      CTLFLAG_RD, &sc->mac_addr_str, 0,
-                      "mac address");
-    SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "pci_link",
-                      CTLFLAG_RD, &sc->pci_link_str, 0,
-                      "pci link status");
-    SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "debug",
-                    CTLFLAG_RW, &sc->debug, 0,
-                    "debug logging mode");
-#endif /* #if __FreeBSD_version >= 900000 */
 
     sc->trigger_grcdump = 0;
     SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "trigger_grcdump",
@@ -16206,8 +16129,6 @@ bxe_add_sysctls(struct bxe_softc *sc)
 static int
 bxe_alloc_buf_rings(struct bxe_softc *sc)
 {
-#if __FreeBSD_version >= 901504
-
     int i;
     struct bxe_fastpath *fp;
 
@@ -16220,15 +16141,13 @@ bxe_alloc_buf_rings(struct bxe_softc *sc)
         if (fp->tx_br == NULL)
             return (-1);
     }
-#endif
+
     return (0);
 }
 
 static void
 bxe_free_buf_rings(struct bxe_softc *sc)
 {
-#if __FreeBSD_version >= 901504
-
     int i;
     struct bxe_fastpath *fp;
 
@@ -16241,8 +16160,6 @@ bxe_free_buf_rings(struct bxe_softc *sc)
             fp->tx_br = NULL;
         }
     }
-
-#endif
 }
 
 static void


More information about the svn-src-all mailing list