From owner-svn-src-stable@freebsd.org Thu Apr 5 00:03:39 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA5F1F81C2E; Thu, 5 Apr 2018 00:03:39 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6A9CC7B5E7; Thu, 5 Apr 2018 00:03:39 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 64F981AE2C; Thu, 5 Apr 2018 00:03:39 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3503d70083657; Thu, 5 Apr 2018 00:03:39 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3503cNA083648; Thu, 5 Apr 2018 00:03:38 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201804050003.w3503cNA083648@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Thu, 5 Apr 2018 00:03:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r332054 - stable/9/sys/dev/qlxgbe X-SVN-Group: stable-9 X-SVN-Commit-Author: davidcs X-SVN-Commit-Paths: stable/9/sys/dev/qlxgbe X-SVN-Commit-Revision: 332054 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Apr 2018 00:03:40 -0000 Author: davidcs Date: Thu Apr 5 00:03:38 2018 New Revision: 332054 URL: https://svnweb.freebsd.org/changeset/base/332054 Log: MFC r331739 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() Modified: stable/9/sys/dev/qlxgbe/ql_dbg.h stable/9/sys/dev/qlxgbe/ql_hw.c stable/9/sys/dev/qlxgbe/ql_ioctl.c stable/9/sys/dev/qlxgbe/ql_isr.c stable/9/sys/dev/qlxgbe/ql_os.c stable/9/sys/dev/qlxgbe/ql_ver.h Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/dev/qlxgbe/ql_dbg.h ============================================================================== --- stable/9/sys/dev/qlxgbe/ql_dbg.h Wed Apr 4 23:58:35 2018 (r332053) +++ stable/9/sys/dev/qlxgbe/ql_dbg.h Thu Apr 5 00:03:38 2018 (r332054) @@ -57,6 +57,7 @@ extern void ql_dump_buf32(qla_host_t *ha, const char * #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 Modified: stable/9/sys/dev/qlxgbe/ql_hw.c ============================================================================== --- stable/9/sys/dev/qlxgbe/ql_hw.c Wed Apr 4 23:58:35 2018 (r332053) +++ stable/9/sys/dev/qlxgbe/ql_hw.c Thu Apr 5 00:03:38 2018 (r332054) @@ -1088,7 +1088,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)), @@ -2904,7 +2908,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); @@ -2912,10 +2916,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; } @@ -3587,6 +3593,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, @@ -3823,6 +3836,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; } @@ -3959,7 +3984,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; } Modified: stable/9/sys/dev/qlxgbe/ql_ioctl.c ============================================================================== --- stable/9/sys/dev/qlxgbe/ql_ioctl.c Wed Apr 4 23:58:35 2018 (r332053) +++ stable/9/sys/dev/qlxgbe/ql_ioctl.c Thu Apr 5 00:03:38 2018 (r332054) @@ -267,7 +267,8 @@ ql_eioctl(struct cdev *dev, u_long cmd, caddr_t data, } } 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); @@ -301,7 +302,7 @@ ql_eioctl(struct cdev *dev, u_long cmd, caddr_t data, } 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 { Modified: stable/9/sys/dev/qlxgbe/ql_isr.c ============================================================================== --- stable/9/sys/dev/qlxgbe/ql_isr.c Wed Apr 4 23:58:35 2018 (r332053) +++ stable/9/sys/dev/qlxgbe/ql_isr.c Thu Apr 5 00:03:38 2018 (r332054) @@ -703,6 +703,7 @@ ql_rcv_isr(qla_host_t *ha, uint32_t sds_idx, uint32_t break; default: + desc_count = 0; device_printf(dev, "%s: default 0x%llx!\n", __func__, (long long unsigned int)sdesc->data[0]); break; Modified: stable/9/sys/dev/qlxgbe/ql_os.c ============================================================================== --- stable/9/sys/dev/qlxgbe/ql_os.c Wed Apr 4 23:58:35 2018 (r332053) +++ stable/9/sys/dev/qlxgbe/ql_os.c Thu Apr 5 00:03:38 2018 (r332054) @@ -1308,13 +1308,20 @@ qla_send(qla_host_t *ha, struct mbuf **m_headp, uint32 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); } @@ -1472,7 +1479,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 @@ -1517,13 +1524,18 @@ 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); } } mtx_unlock(&fp->tx_mtx); + + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + goto qla_fp_taskqueue_exit; qla_fp_taskqueue_exit0: Modified: stable/9/sys/dev/qlxgbe/ql_ver.h ============================================================================== --- stable/9/sys/dev/qlxgbe/ql_ver.h Wed Apr 4 23:58:35 2018 (r332053) +++ stable/9/sys/dev/qlxgbe/ql_ver.h Thu Apr 5 00:03:38 2018 (r332054) @@ -36,6 +36,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_ */