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
This commit is contained in:
David C Somayajulu 2018-03-29 17:36:34 +00:00
parent af00071dba
commit 971e53c937
6 changed files with 54 additions and 12 deletions

View File

@ -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

View File

@ -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;
}

View File

@ -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 {

View File

@ -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;

View File

@ -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)) {

View File

@ -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_ */