svn commit: r297625 - stable/7/sys/dev/bxe
David C Somayajulu
davidcs at FreeBSD.org
Wed Apr 6 21:59:53 UTC 2016
Author: davidcs
Date: Wed Apr 6 21:59:52 2016
New Revision: 297625
URL: https://svnweb.freebsd.org/changeset/base/297625
Log:
MFC r297155
Modifications to achieve a common source base from FreeBSD7.x thru 10.x
Modified:
stable/7/sys/dev/bxe/bxe.c
stable/7/sys/dev/bxe/bxe.h
Directory Properties:
stable/7/ (props changed)
stable/7/sys/ (props changed)
Modified: stable/7/sys/dev/bxe/bxe.c
==============================================================================
--- stable/7/sys/dev/bxe/bxe.c Wed Apr 6 21:45:31 2016 (r297624)
+++ stable/7/sys/dev/bxe/bxe.c Wed Apr 6 21:59:52 2016 (r297625)
@@ -3074,7 +3074,7 @@ bxe_tpa_stop(struct bxe_softc *
#if __FreeBSD_version >= 800000
/* specify what RSS queue was used for this flow */
m->m_pkthdr.flowid = fp->index;
- m->m_flags |= M_FLOWID;
+ BXE_SET_FLOWID(m);
#endif
ifp->if_ipackets++;
@@ -3363,7 +3363,7 @@ bxe_rxeof(struct bxe_softc *sc,
#if __FreeBSD_version >= 800000
/* specify what RSS queue was used for this flow */
m->m_pkthdr.flowid = fp->index;
- m->m_flags |= M_FLOWID;
+ BXE_SET_FLOWID(m);
#endif
next_rx:
@@ -4835,6 +4835,19 @@ 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);
+
+ 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, 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,
@@ -4853,6 +4866,7 @@ bxe_dump_mbuf(struct bxe_softc *sc,
"\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) {
@@ -5236,9 +5250,9 @@ bxe_tx_encap(struct bxe_fastpath *fp, st
sc = fp->sc;
- /* XXX compile error with _.amd64.LINT with m_hdr?
+#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;
@@ -5757,7 +5771,7 @@ bxe_tx_mq_start_locked(struct bxe_softc
if (!sc->link_vars.link_up ||
(ifp->if_drv_flags &
(IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != IFF_DRV_RUNNING) {
- rc = drbr_enqueue_drv(ifp, tx_br, m);
+ rc = drbr_enqueue(ifp, tx_br, m);
goto bxe_tx_mq_start_locked_exit;
}
@@ -5852,10 +5866,10 @@ bxe_tx_mq_start(struct ifnet *ifp,
fp_index = 0; /* default is the first queue */
- /* change the queue if using flow ID */
- if ((m->m_flags & M_FLOWID) != 0) {
+ /* check if flowid is set */
+
+ if (BXE_VALID_FLOWID(m))
fp_index = (m->m_pkthdr.flowid % sc->num_queues);
- }
fp = &sc->fp[fp_index];
@@ -5863,7 +5877,7 @@ bxe_tx_mq_start(struct ifnet *ifp,
rc = bxe_tx_mq_start_locked(sc, ifp, fp, m);
BXE_FP_TX_UNLOCK(fp);
} else
- rc = drbr_enqueue_drv(ifp, fp->tx_br, m);
+ rc = drbr_enqueue(ifp, fp->tx_br, m);
return (rc);
}
@@ -15720,18 +15734,11 @@ bxe_add_sysctls(struct bxe_softc *sc)
CTLFLAG_RD, BXE_DRIVER_VERSION, 0,
"version");
- SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "bc_version",
- CTLFLAG_RD, &sc->devinfo.bc_ver_str, 0,
- "bootcode version");
-
snprintf(sc->fw_ver_str, sizeof(sc->fw_ver_str), "%d.%d.%d.%d",
BCM_5710_FW_MAJOR_VERSION,
BCM_5710_FW_MINOR_VERSION,
BCM_5710_FW_REVISION_VERSION,
BCM_5710_FW_ENGINEERING_VERSION);
- SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "fw_version",
- CTLFLAG_RD, &sc->fw_ver_str, 0,
- "firmware version");
snprintf(sc->mf_mode_str, sizeof(sc->mf_mode_str), "%s",
((sc->devinfo.mf_info.mf_mode == SINGLE_FUNCTION) ? "Single" :
@@ -15739,32 +15746,58 @@ bxe_add_sysctls(struct bxe_softc *sc)
(sc->devinfo.mf_info.mf_mode == MULTI_FUNCTION_SI) ? "MF-SI" :
(sc->devinfo.mf_info.mf_mode == MULTI_FUNCTION_AFEX) ? "MF-AFEX" :
"Unknown"));
- SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "mf_mode",
- CTLFLAG_RD, &sc->mf_mode_str, 0,
- "multifunction mode");
-
SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "mf_vnics",
CTLFLAG_RD, &sc->devinfo.mf_info.vnics_per_port, 0,
"multifunction vnics per port");
- SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "mac_addr",
- CTLFLAG_RD, &sc->mac_addr_str, 0,
- "mac address");
-
snprintf(sc->pci_link_str, sizeof(sc->pci_link_str), "%s x%d",
((sc->devinfo.pcie_link_speed == 1) ? "2.5GT/s" :
(sc->devinfo.pcie_link_speed == 2) ? "5.0GT/s" :
(sc->devinfo.pcie_link_speed == 4) ? "8.0GT/s" :
"???GT/s"),
sc->devinfo.pcie_link_width);
+
+ 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");
+ 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");
+#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");
-
- sc->debug = bxe_debug;
SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "debug",
CTLFLAG_RW, &sc->debug, 0,
"debug logging mode");
+#endif /* #if __FreeBSD_version >= 900000 */
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "trigger_grcdump",
CTLTYPE_UINT | CTLFLAG_RW, sc, 0,
Modified: stable/7/sys/dev/bxe/bxe.h
==============================================================================
--- stable/7/sys/dev/bxe/bxe.h Wed Apr 6 21:45:31 2016 (r297624)
+++ stable/7/sys/dev/bxe/bxe.h Wed Apr 6 21:59:52 2016 (r297625)
@@ -2271,6 +2271,17 @@ void bxe_dump_mem(struct bxe_softc *sc,
void bxe_dump_mbuf_data(struct bxe_softc *sc, char *pTag,
struct mbuf *m, uint8_t contents);
+
+#if __FreeBSD_version >= 800000
+#if __FreeBSD_version >= 1000000
+#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 */
/***********/
More information about the svn-src-stable-7
mailing list