summaryrefslogtreecommitdiff
path: root/sys/dev/qlxgbe
diff options
context:
space:
mode:
authorDavid C Somayajulu <davidcs@FreeBSD.org>2017-10-11 18:25:05 +0000
committerDavid C Somayajulu <davidcs@FreeBSD.org>2017-10-11 18:25:05 +0000
commitc6acf96aac649c34f9455db5eef042522ae19745 (patch)
tree9997fb776d69acc01bc7c6442671b727222ee99d /sys/dev/qlxgbe
parent1356a2e6fa2dd0cba0e7e25df3815b51d7ee988e (diff)
Notes
Diffstat (limited to 'sys/dev/qlxgbe')
-rw-r--r--sys/dev/qlxgbe/ql_hw.c14
-rw-r--r--sys/dev/qlxgbe/ql_os.c11
2 files changed, 25 insertions, 0 deletions
diff --git a/sys/dev/qlxgbe/ql_hw.c b/sys/dev/qlxgbe/ql_hw.c
index 03bb9260f3c2..5bd8c9397ff4 100644
--- a/sys/dev/qlxgbe/ql_hw.c
+++ b/sys/dev/qlxgbe/ql_hw.c
@@ -2374,6 +2374,20 @@ ql_hw_send(qla_host_t *ha, bus_dma_segment_t *segs, int nsegs,
}
}
+ for (i = 0; i < num_tx_cmds; i++) {
+ int j;
+
+ j = (tx_idx+i) & (NUM_TX_DESCRIPTORS - 1);
+
+ if (NULL != ha->tx_ring[txr_idx].tx_buf[j].m_head) {
+ QL_ASSERT(ha, 0, \
+ ("%s [%d]: txr_idx = %d tx_idx = %d mbuf = %p\n",\
+ __func__, __LINE__, txr_idx, j,\
+ ha->tx_ring[txr_idx].tx_buf[j].m_head));
+ return (EINVAL);
+ }
+ }
+
tx_cmd = &hw->tx_cntxt[txr_idx].tx_ring_base[tx_idx];
if (!(mp->m_pkthdr.csum_flags & CSUM_TSO)) {
diff --git a/sys/dev/qlxgbe/ql_os.c b/sys/dev/qlxgbe/ql_os.c
index c4391a1b9871..039bbfe74eb7 100644
--- a/sys/dev/qlxgbe/ql_os.c
+++ b/sys/dev/qlxgbe/ql_os.c
@@ -1232,6 +1232,17 @@ qla_send(qla_host_t *ha, struct mbuf **m_headp, uint32_t txr_idx,
QL_DPRINT8(ha, (ha->pci_dev, "%s: enter\n", __func__));
tx_idx = ha->hw.tx_cntxt[txr_idx].txr_next;
+
+ if (NULL != ha->tx_ring[txr_idx].tx_buf[tx_idx].m_head) {
+ 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));
+ if (m_head)
+ m_freem(m_head);
+ *m_headp = NULL;
+ return (ret);
+ }
+
map = ha->tx_ring[txr_idx].tx_buf[tx_idx].map;
ret = bus_dmamap_load_mbuf_sg(ha->tx_tag, map, m_head, segs, &nsegs,