aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2021-09-13 16:57:54 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2021-10-29 23:35:15 +0000
commit56bc3b1a95bb54ea1653c483d77871f5334637b0 (patch)
tree1c75f545284b419e751c931bf7c24d23fcb9d7a9
parent075c8d9db3281fa6de48eae2e097d00b4c7349d7 (diff)
downloadsrc-56bc3b1a95bb54ea1653c483d77871f5334637b0.tar.gz
src-56bc3b1a95bb54ea1653c483d77871f5334637b0.zip
cxgbei: Disable ISO for -SO cards without external memory.
Reported by: Jithesh Arakkan @ Chelsio Sponsored by: Chelsio Communications (cherry picked from commit 9b1bb0aee697352b39b3efa1843f581ca29068ba)
-rw-r--r--sys/dev/cxgbe/cxgbei/icl_cxgbei.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c
index 687fc545cebd..4b1eb0718e86 100644
--- a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c
+++ b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c
@@ -95,6 +95,7 @@ __FBSDID("$FreeBSD$");
#include <cam/scsi/scsi_message.h>
#include "common/common.h"
+#include "common/t4_regs.h"
#include "common/t4_tcb.h"
#include "tom/t4_tom.h"
#include "cxgbei.h"
@@ -707,6 +708,19 @@ find_offload_adapter(struct adapter *sc, void *arg)
INP_WUNLOCK(inp);
}
+static bool
+is_memfree(struct adapter *sc)
+{
+ uint32_t em;
+
+ em = t4_read_reg(sc, A_MA_TARGET_MEM_ENABLE);
+ if ((em & F_EXT_MEM_ENABLE) != 0)
+ return (false);
+ if (is_t5(sc) && (em & F_EXT_MEM1_ENABLE) != 0)
+ return (false);
+ return (true);
+}
+
/* XXXNP: move this to t4_tom. */
static void
send_iscsi_flowc_wr(struct adapter *sc, struct toepcb *toep, int maxlen)
@@ -863,7 +877,8 @@ icl_cxgbei_conn_handoff(struct icl_conn *ic, int fd)
if (ic->ic_data_crc32c)
icc->ulp_submode |= ULP_CRC_DATA;
- if (icc->sc->tt.iso && chip_id(icc->sc) >= CHELSIO_T5) {
+ if (icc->sc->tt.iso && chip_id(icc->sc) >= CHELSIO_T5 &&
+ !is_memfree(icc->sc)) {
max_iso_pdus = CXGBEI_MAX_ISO_PAYLOAD /
max_tx_pdu_len;
ic->ic_hw_isomax = max_iso_pdus *