Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F112553089
D48968.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D48968.diff
View Options
diff --git a/sys/dev/gve/gve_tx_dqo.c b/sys/dev/gve/gve_tx_dqo.c
--- a/sys/dev/gve/gve_tx_dqo.c
+++ b/sys/dev/gve/gve_tx_dqo.c
@@ -43,6 +43,13 @@
bus_dmamap_unload(tx->dqo.buf_dmatag, pending_pkt->dmamap);
}
+static void
+gve_clear_qpl_pending_pkt(struct gve_tx_pending_pkt_dqo *pending_pkt)
+{
+ pending_pkt->qpl_buf_head = -1;
+ pending_pkt->num_qpl_bufs = 0;
+}
+
static void
gve_free_tx_mbufs_dqo(struct gve_tx_ring *tx)
{
@@ -54,10 +61,9 @@
if (!pending_pkt->mbuf)
continue;
- if (gve_is_qpl(tx->com.priv)) {
- pending_pkt->qpl_buf_head = -1;
- pending_pkt->num_qpl_bufs = 0;
- } else
+ if (gve_is_qpl(tx->com.priv))
+ gve_clear_qpl_pending_pkt(pending_pkt);
+ else
gve_unmap_packet(tx, pending_pkt);
m_freem(pending_pkt->mbuf);
@@ -880,8 +886,7 @@
*/
atomic_add_rel_32(&tx->dqo.qpl_bufs_produced, pkt->num_qpl_bufs);
- pkt->qpl_buf_head = -1;
- pkt->num_qpl_bufs = 0;
+ gve_clear_qpl_pending_pkt(pkt);
}
static uint64_t
@@ -981,11 +986,13 @@
gve_free_tx_mbufs_dqo(tx);
- for (j = 0; j < tx->dqo.num_pending_pkts - 1; j++) {
- tx->dqo.pending_pkts[j].next = j + 1;
+ for (j = 0; j < tx->dqo.num_pending_pkts; j++) {
+ if (gve_is_qpl(tx->com.priv))
+ gve_clear_qpl_pending_pkt(&tx->dqo.pending_pkts[j]);
+ tx->dqo.pending_pkts[j].next =
+ (j == tx->dqo.num_pending_pkts - 1) ? -1 : j + 1;
tx->dqo.pending_pkts[j].state = GVE_PACKET_STATE_FREE;
}
- tx->dqo.pending_pkts[tx->dqo.num_pending_pkts - 1].next = -1;
tx->dqo.free_pending_pkts_csm = 0;
atomic_store_rel_32(&tx->dqo.free_pending_pkts_prd, -1);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Mar 20, 6:33 PM (21 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16649125
Default Alt Text
D48968.diff (1 KB)
Attached To
Mode
D48968: gve: Fix qpl_buf_head being initialized improperly
Attached
Detach File
Event Timeline
Log In to Comment