aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Bowling <kbowling@FreeBSD.org>2023-08-04 01:21:00 +0000
committerKevin Bowling <kbowling@FreeBSD.org>2023-08-04 01:21:00 +0000
commitd7dd3b56301142bf12bdc8149e370c428195a2bc (patch)
treee5a84e8225604f402b5a06d8b9ee4bb1c6dfe0e2
parentbd07d5c451995353cbf1d86f97c5264232ea401b (diff)
downloadsrc-d7dd3b56301142bf12bdc8149e370c428195a2bc.tar.gz
src-d7dd3b56301142bf12bdc8149e370c428195a2bc.zip
Revert "e1000: lem(4)/em(4) ifcaps, TSO and hwcsum fixes"
This reverts commit bd07d5c451995353cbf1d86f97c5264232ea401b.
-rw-r--r--sys/dev/e1000/em_txrx.c15
-rw-r--r--sys/dev/e1000/if_em.c48
2 files changed, 23 insertions, 40 deletions
diff --git a/sys/dev/e1000/em_txrx.c b/sys/dev/e1000/em_txrx.c
index 069a1c00a4b2..47f9b187aa14 100644
--- a/sys/dev/e1000/em_txrx.c
+++ b/sys/dev/e1000/em_txrx.c
@@ -674,12 +674,12 @@ lem_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri)
i++;
} while (!eop);
- if (scctx->isc_capenable & IFCAP_RXCSUM)
+ /* XXX add a faster way to look this up */
+ if (sc->hw.mac.type >= e1000_82543)
em_receive_checksum(status, errors, ri);
- if (scctx->isc_capenable & IFCAP_VLAN_HWTAGGING &&
- status & E1000_RXD_STAT_VP) {
- ri->iri_vtag = le16toh(rxd->special & E1000_RXD_SPC_VLAN_MASK);
+ if (status & E1000_RXD_STAT_VP) {
+ ri->iri_vtag = le16toh(rxd->special);
ri->iri_flags |= M_VLANTAG;
}
@@ -699,11 +699,11 @@ em_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri)
uint16_t len;
uint32_t pkt_info;
- uint32_t staterr;
+ uint32_t staterr = 0;
bool eop;
int i, cidx;
- staterr = i = 0;
+ i = 0;
cidx = ri->iri_cidx;
do {
@@ -739,8 +739,7 @@ em_isc_rxd_pkt_get(void *arg, if_rxd_info_t ri)
if (scctx->isc_capenable & IFCAP_RXCSUM)
em_receive_checksum(staterr, staterr >> 24, ri);
- if (scctx->isc_capenable & IFCAP_VLAN_HWTAGGING &&
- staterr & E1000_RXD_STAT_VP) {
+ if (staterr & E1000_RXD_STAT_VP) {
ri->iri_vtag = le16toh(rxd->wb.upper.vlan);
ri->iri_flags |= M_VLANTAG;
}
diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c
index 1338206e5ed0..09a063191107 100644
--- a/sys/dev/e1000/if_em.c
+++ b/sys/dev/e1000/if_em.c
@@ -783,21 +783,19 @@ em_set_num_queues(if_ctx_t ctx)
return (maxqueues);
}
-#define LEM_CAPS \
- IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \
- IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER | IFCAP_TSO4 | \
- IFCAP_LRO | IFCAP_JUMBO_MTU
-
-#define EM_CAPS \
- IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \
- IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER | IFCAP_TSO4 | \
- IFCAP_LRO | IFCAP_VLAN_HWTSO | IFCAP_JUMBO_MTU | IFCAP_HWCSUM_IPV6 | \
- IFCAP_TSO6
-
-#define IGB_CAPS \
- IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \
- IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER | IFCAP_TSO4 | \
- IFCAP_LRO | IFCAP_VLAN_HWTSO | IFCAP_JUMBO_MTU | IFCAP_HWCSUM_IPV6 | \
+#define LEM_CAPS \
+ IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \
+ IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER
+
+#define EM_CAPS \
+ IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \
+ IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER | IFCAP_TSO4 | \
+ IFCAP_LRO | IFCAP_VLAN_HWTSO
+
+#define IGB_CAPS \
+ IFCAP_HWCSUM | IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING | \
+ IFCAP_VLAN_HWCSUM | IFCAP_WOL | IFCAP_VLAN_HWFILTER | IFCAP_TSO4 | \
+ IFCAP_LRO | IFCAP_VLAN_HWTSO | IFCAP_JUMBO_MTU | IFCAP_HWCSUM_IPV6 |\
IFCAP_TSO6
/*********************************************************************
@@ -901,7 +899,7 @@ em_if_attach_pre(if_ctx_t ctx)
scctx->isc_tx_tso_segsize_max = EM_TSO_SEG_SIZE;
scctx->isc_capabilities = scctx->isc_capenable = EM_CAPS;
/*
- * For EM-class devices, don't enable IFCAP_{TSO4,VLAN_HWTSO,TSO6}
+ * For EM-class devices, don't enable IFCAP_{TSO4,VLAN_HWTSO}
* by default as we don't have workarounds for all associated
* silicon errata. E. g., with several MACs such as 82573E,
* TSO only works at Gigabit speed and otherwise can cause the
@@ -916,9 +914,8 @@ em_if_attach_pre(if_ctx_t ctx)
* work for a few MACs of this class - at least when sticking
* with Gigabit - in which case users may enable TSO manually.
*/
- scctx->isc_capenable &= ~(IFCAP_TSO4 | IFCAP_VLAN_HWTSO | IFCAP_TSO6);
- scctx->isc_tx_csum_flags = CSUM_TCP | CSUM_UDP | CSUM_IP_TSO |
- CSUM_IP6_TCP | CSUM_IP6_UDP;
+ scctx->isc_capenable &= ~(IFCAP_TSO4 | IFCAP_VLAN_HWTSO);
+ scctx->isc_tx_csum_flags = CSUM_TCP | CSUM_UDP | CSUM_IP_TSO;
/*
* We support MSI-X with 82574 only, but indicate to iflib(4)
* that it shall give MSI at least a try with other devices.
@@ -937,19 +934,6 @@ em_if_attach_pre(if_ctx_t ctx)
scctx->isc_tx_csum_flags = CSUM_TCP | CSUM_UDP;
scctx->isc_txrx = &lem_txrx;
scctx->isc_capabilities = LEM_CAPS;
-
- /*
- * For LEM-class devices, don't enable IFCAP {TSO4,VLAN_HWTSO}
- * by default as we don't have workarounds for all associated
- * silicon errata. TSO4 may work on > 82544 but its status
- * is unknown by the authors. Please report any success or failures.
- */
- scctx->isc_capenable &= ~(IFCAP_TSO4 | IFCAP_VLAN_HWTSO);
-
- /* 8254x SDM4.0 page 33 - FDX requirement on these chips */
- if (hw->mac.type == e1000_82547 || hw->mac.type == e1000_82547_rev_2)
- scctx->isc_capenable &= ~(IFCAP_HWCSUM|IFCAP_VLAN_HWCSUM);
-
if (hw->mac.type < e1000_82543)
scctx->isc_capabilities &= ~(IFCAP_HWCSUM|IFCAP_VLAN_HWCSUM);
/* 82541ER doesn't do HW tagging */