aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/qlxgbe/ql_os.c
diff options
context:
space:
mode:
authorDavid C Somayajulu <davidcs@FreeBSD.org>2017-09-20 20:07:45 +0000
committerDavid C Somayajulu <davidcs@FreeBSD.org>2017-09-20 20:07:45 +0000
commit203f9d1828f96abaf3b47d17329d7755bc6c4d4b (patch)
tree374f43c9d425b73ce271b09b0393b765121512d9 /sys/dev/qlxgbe/ql_os.c
parentd616681cecb774a1780daf7351cc62458d1643f5 (diff)
Notes
Diffstat (limited to 'sys/dev/qlxgbe/ql_os.c')
-rw-r--r--sys/dev/qlxgbe/ql_os.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/sys/dev/qlxgbe/ql_os.c b/sys/dev/qlxgbe/ql_os.c
index 46e6715cfc3b..e89e71b92665 100644
--- a/sys/dev/qlxgbe/ql_os.c
+++ b/sys/dev/qlxgbe/ql_os.c
@@ -1287,6 +1287,7 @@ qla_send(qla_host_t *ha, struct mbuf **m_headp, uint32_t txr_idx,
ha->tx_ring[txr_idx].iscsi_pkt_count++;
ha->tx_ring[txr_idx].tx_buf[tx_idx].m_head = m_head;
} else {
+ bus_dmamap_unload(ha->tx_tag, map);
if (ret == EINVAL) {
if (m_head)
m_freem(m_head);
@@ -1372,7 +1373,8 @@ qla_fp_taskqueue(void *context, int pending)
goto qla_fp_taskqueue_exit;
}
- while (rx_pkts_left && !ha->stop_rcv) {
+ while (rx_pkts_left && !ha->stop_rcv &&
+ (ifp->if_drv_flags & IFF_DRV_RUNNING)) {
rx_pkts_left = ql_rcv_isr(ha, fp->txr_idx, 64);
#ifdef QL_ENABLE_ISCSI_TLV
@@ -1415,6 +1417,11 @@ qla_fp_taskqueue(void *context, int pending)
drbr_advance(ifp, fp->tx_br);
}
+ /* Send a copy of the frame to the BPF listener */
+ ETHER_BPF_MTAP(ifp, mp);
+ if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
+ break;
+
mp = drbr_peek(ifp, fp->tx_br);
}
}
@@ -1677,16 +1684,24 @@ qla_clear_tx_buf(qla_host_t *ha, qla_tx_buf_t *txb)
{
QL_DPRINT2(ha, (ha->pci_dev, "%s: enter\n", __func__));
- if (txb->m_head && txb->map) {
+ if (txb->m_head) {
+ bus_dmamap_sync(ha->tx_tag, txb->map,
+ BUS_DMASYNC_POSTWRITE);
bus_dmamap_unload(ha->tx_tag, txb->map);
m_freem(txb->m_head);
txb->m_head = NULL;
+
+ bus_dmamap_destroy(ha->tx_tag, txb->map);
+ txb->map = NULL;
}
- if (txb->map)
+ if (txb->map) {
+ bus_dmamap_unload(ha->tx_tag, txb->map);
bus_dmamap_destroy(ha->tx_tag, txb->map);
+ txb->map = NULL;
+ }
QL_DPRINT2(ha, (ha->pci_dev, "%s: exit\n", __func__));
}