aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/qlxgbe
diff options
context:
space:
mode:
authorDavid C Somayajulu <davidcs@FreeBSD.org>2018-03-29 17:36:34 +0000
committerDavid C Somayajulu <davidcs@FreeBSD.org>2018-03-29 17:36:34 +0000
commit971e53c9378a7041ecf7cbfb0ced29b05376a4a1 (patch)
treedd3b359b26c55de1347c6b19819bf768c107d23f /sys/dev/qlxgbe
parentaf00071dbacb52eb95a07e5b247f13702e157598 (diff)
downloadsrc-971e53c9378a7041ecf7cbfb0ced29b05376a4a1.tar.gz
src-971e53c9378a7041ecf7cbfb0ced29b05376a4a1.zip
1. Add additional debug prints.
2. Break transmit when IFF_DRV_RUNNING is OFF. 3. set desc_count=0 for default case in switch in ql_rcv_isr() MFC after:5 days
Notes
Notes: svn path=/head/; revision=331739
Diffstat (limited to 'sys/dev/qlxgbe')
-rw-r--r--sys/dev/qlxgbe/ql_dbg.h1
-rw-r--r--sys/dev/qlxgbe/ql_hw.c35
-rw-r--r--sys/dev/qlxgbe/ql_ioctl.c5
-rw-r--r--sys/dev/qlxgbe/ql_isr.c1
-rw-r--r--sys/dev/qlxgbe/ql_os.c22
-rw-r--r--sys/dev/qlxgbe/ql_ver.h2
6 files changed, 54 insertions, 12 deletions
diff --git a/sys/dev/qlxgbe/ql_dbg.h b/sys/dev/qlxgbe/ql_dbg.h
index 1ccf7bdc995b..db1b6890fc83 100644
--- a/sys/dev/qlxgbe/ql_dbg.h
+++ b/sys/dev/qlxgbe/ql_dbg.h
@@ -59,6 +59,7 @@ extern void ql_dump_buf32(qla_host_t *ha, const char *str, void *dbuf,
#define INJCT_SGL_RCV_INV_DESC_COUNT 0x0000D
#define INJCT_SGL_LRO_INV_DESC_COUNT 0x0000E
#define INJCT_PEER_PORT_FAILURE_ERR_RECOVERY 0x0000F
+#define INJCT_TXBUF_MBUF_NON_NULL 0x00010
#ifdef QL_DBG
diff --git a/sys/dev/qlxgbe/ql_hw.c b/sys/dev/qlxgbe/ql_hw.c
index fb879f46a5cf..1937a2bb6315 100644
--- a/sys/dev/qlxgbe/ql_hw.c
+++ b/sys/dev/qlxgbe/ql_hw.c
@@ -1090,7 +1090,11 @@ ql_hw_add_sysctls(qla_host_t *ha)
"\t\t\t 8: mbx: mailbox command failure\n"
"\t\t\t 9: heartbeat failure\n"
"\t\t\t A: temperature failure\n"
- "\t\t\t 11: m_getcl or m_getjcl failure\n" );
+ "\t\t\t 11: m_getcl or m_getjcl failure\n"
+ "\t\t\t 13: Invalid Descriptor Count in SGL Receive\n"
+ "\t\t\t 14: Invalid Descriptor Count in LRO Receive\n"
+ "\t\t\t 15: peer port error recovery failure\n"
+ "\t\t\t 16: tx_buf[next_prod_index].mbuf != NULL\n" );
SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
@@ -2906,7 +2910,7 @@ ql_del_hw_if_exit:
void
qla_confirm_9kb_enable(qla_host_t *ha)
{
- uint32_t supports_9kb = 0;
+// uint32_t supports_9kb = 0;
ha->hw.mbx_intr_mask_offset = READ_REG32(ha, Q8_MBOX_INT_MASK_MSIX);
@@ -2914,10 +2918,12 @@ qla_confirm_9kb_enable(qla_host_t *ha)
WRITE_REG32(ha, Q8_MBOX_INT_ENABLE, BIT_2);
WRITE_REG32(ha, ha->hw.mbx_intr_mask_offset, 0x0);
+#if 0
qla_get_nic_partition(ha, &supports_9kb, NULL);
if (!supports_9kb)
- ha->hw.enable_9kb = 0;
+#endif
+ ha->hw.enable_9kb = 0;
return;
}
@@ -3589,6 +3595,13 @@ qla_hw_all_mcast(qla_host_t *ha, uint32_t add_mcast)
bcopy(ha->hw.mcast[i].addr, mcast, ETHER_ADDR_LEN);
mcast = mcast + ETHER_ADDR_LEN;
count++;
+
+ device_printf(ha->pci_dev,
+ "%s: %x:%x:%x:%x:%x:%x \n",
+ __func__, ha->hw.mcast[i].addr[0],
+ ha->hw.mcast[i].addr[1], ha->hw.mcast[i].addr[2],
+ ha->hw.mcast[i].addr[3], ha->hw.mcast[i].addr[4],
+ ha->hw.mcast[i].addr[5]);
if (count == Q8_MAX_MAC_ADDRS) {
if (qla_config_mac_addr(ha, ha->hw.mac_addr_arr,
@@ -3825,6 +3838,18 @@ ql_hw_tx_done_locked(qla_host_t *ha, uint32_t txr_idx)
}
hw_tx_cntxt->txr_free += comp_count;
+
+ if (hw_tx_cntxt->txr_free > NUM_TX_DESCRIPTORS)
+ device_printf(ha->pci_dev, "%s [%d]: txr_idx = %d txr_free = %d"
+ "txr_next = %d txr_comp = %d\n", __func__, __LINE__,
+ txr_idx, hw_tx_cntxt->txr_free,
+ hw_tx_cntxt->txr_next, hw_tx_cntxt->txr_comp);
+
+ QL_ASSERT(ha, (hw_tx_cntxt->txr_free <= NUM_TX_DESCRIPTORS), \
+ ("%s [%d]: txr_idx = %d txr_free = %d txr_next = %d txr_comp = %d\n",\
+ __func__, __LINE__, txr_idx, hw_tx_cntxt->txr_free, \
+ hw_tx_cntxt->txr_next, hw_tx_cntxt->txr_comp));
+
return;
}
@@ -3961,7 +3986,9 @@ qla_init_nic_func(qla_host_t *ha)
if (err) {
device_printf(dev, "%s: failed [0x%08x]\n", __func__, err);
- }
+ } else {
+ device_printf(dev, "%s: successful\n", __func__);
+ }
return 0;
}
diff --git a/sys/dev/qlxgbe/ql_ioctl.c b/sys/dev/qlxgbe/ql_ioctl.c
index 101d05f44604..f45e263a989a 100644
--- a/sys/dev/qlxgbe/ql_ioctl.c
+++ b/sys/dev/qlxgbe/ql_ioctl.c
@@ -269,7 +269,8 @@ ql_eioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag,
}
} else {
- if (QLA_LOCK(ha, __func__, QLA_LOCK_DEFAULT_MS_TIMEOUT, 0) == 0) {
+#define QLA_LOCK_MDUMP_MS_TIMEOUT (QLA_LOCK_DEFAULT_MS_TIMEOUT * 5)
+ if (QLA_LOCK(ha, __func__, QLA_LOCK_MDUMP_MS_TIMEOUT, 0) == 0) {
if (!ha->hw.mdump_done) {
fw_dump->saved = 0;
QL_INITIATE_RECOVERY(ha);
@@ -303,7 +304,7 @@ ql_eioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag,
}
fw_dump->usec_ts = ha->hw.mdump_usec_ts;
- if (QLA_LOCK(ha, __func__, QLA_LOCK_DEFAULT_MS_TIMEOUT, 0) == 0) {
+ if (QLA_LOCK(ha, __func__, QLA_LOCK_MDUMP_MS_TIMEOUT, 0) == 0) {
ha->hw.mdump_done = 0;
QLA_UNLOCK(ha, __func__);
} else {
diff --git a/sys/dev/qlxgbe/ql_isr.c b/sys/dev/qlxgbe/ql_isr.c
index 587daa66fd72..47bae0b155e4 100644
--- a/sys/dev/qlxgbe/ql_isr.c
+++ b/sys/dev/qlxgbe/ql_isr.c
@@ -703,6 +703,7 @@ ql_rcv_isr(qla_host_t *ha, uint32_t sds_idx, uint32_t count)
break;
default:
+ desc_count = 0;
device_printf(dev, "%s: default 0x%llx!\n", __func__,
(long long unsigned int)sdesc->data[0]);
break;
diff --git a/sys/dev/qlxgbe/ql_os.c b/sys/dev/qlxgbe/ql_os.c
index 0927496aa8b7..f895fd917823 100644
--- a/sys/dev/qlxgbe/ql_os.c
+++ b/sys/dev/qlxgbe/ql_os.c
@@ -1289,13 +1289,20 @@ qla_send(qla_host_t *ha, struct mbuf **m_headp, uint32_t txr_idx,
tx_idx = ha->hw.tx_cntxt[txr_idx].txr_next;
- if (NULL != ha->tx_ring[txr_idx].tx_buf[tx_idx].m_head) {
+ if ((NULL != ha->tx_ring[txr_idx].tx_buf[tx_idx].m_head) ||
+ (QL_ERR_INJECT(ha, INJCT_TXBUF_MBUF_NON_NULL))){
QL_ASSERT(ha, 0, ("%s [%d]: txr_idx = %d tx_idx = %d "\
"mbuf = %p\n", __func__, __LINE__, txr_idx, tx_idx,\
ha->tx_ring[txr_idx].tx_buf[tx_idx].m_head));
+
+ device_printf(ha->pci_dev, "%s [%d]: txr_idx = %d tx_idx = %d "
+ "mbuf = %p\n", __func__, __LINE__, txr_idx, tx_idx,
+ ha->tx_ring[txr_idx].tx_buf[tx_idx].m_head);
+
if (m_head)
m_freem(m_head);
*m_headp = NULL;
+ QL_INITIATE_RECOVERY(ha);
return (ret);
}
@@ -1428,8 +1435,8 @@ qla_fp_taskqueue(void *context, int pending)
qla_tx_fp_t *fp;
qla_host_t *ha;
struct ifnet *ifp;
- struct mbuf *mp;
- int ret;
+ struct mbuf *mp = NULL;
+ int ret = 0;
uint32_t txr_idx;
uint32_t iscsi_pdu = 0;
uint32_t rx_pkts_left = -1;
@@ -1453,7 +1460,7 @@ qla_fp_taskqueue(void *context, int pending)
}
while (rx_pkts_left && !ha->stop_rcv &&
- (ifp->if_drv_flags & IFF_DRV_RUNNING)) {
+ (ifp->if_drv_flags & IFF_DRV_RUNNING) && ha->hw.link_up) {
rx_pkts_left = ql_rcv_isr(ha, fp->txr_idx, 64);
#ifdef QL_ENABLE_ISCSI_TLV
@@ -1498,7 +1505,9 @@ qla_fp_taskqueue(void *context, int pending)
/* Send a copy of the frame to the BPF listener */
ETHER_BPF_MTAP(ifp, mp);
- if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
+
+ if (((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) ||
+ (!ha->hw.link_up))
break;
mp = drbr_peek(ifp, fp->tx_br);
@@ -1506,6 +1515,9 @@ qla_fp_taskqueue(void *context, int pending)
}
mtx_unlock(&fp->tx_mtx);
+ if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
+ goto qla_fp_taskqueue_exit;
+
qla_fp_taskqueue_exit0:
if (rx_pkts_left || ((mp != NULL) && ret)) {
diff --git a/sys/dev/qlxgbe/ql_ver.h b/sys/dev/qlxgbe/ql_ver.h
index d9e26b56f936..8c1433dfdaea 100644
--- a/sys/dev/qlxgbe/ql_ver.h
+++ b/sys/dev/qlxgbe/ql_ver.h
@@ -38,6 +38,6 @@
#define QLA_VERSION_MAJOR 3
#define QLA_VERSION_MINOR 10
-#define QLA_VERSION_BUILD 36
+#define QLA_VERSION_BUILD 37
#endif /* #ifndef _QL_VER_H_ */