[PATCH RFC net-next 02/12] net: enic: tag work queue descriptor ownership

From: Satish Kharat

Date: Mon Nov 30 2026 - 20:17:05 EST


Record whether a WQ descriptor belongs to an skb, XDP frame, or AF_XDP
TX. Initialize normal skb postings explicitly so later completion paths
can use the tag without changing existing skb behavior. Store the DMA
mapping and XSK pool ownership alongside the descriptor for the
corresponding completion path.

Signed-off-by: Satish Kharat <satishkh@xxxxxxxxx>
---
drivers/net/ethernet/cisco/enic/vnic_wq.h | 15 +++++++++++++++
1 file changed, 15 insertions(+)

diff --git a/drivers/net/ethernet/cisco/enic/vnic_wq.h b/drivers/net/ethernet/cisco/enic/vnic_wq.h
index 1d448b7a9ba2..b631bab49b1c 100644
--- a/drivers/net/ethernet/cisco/enic/vnic_wq.h
+++ b/drivers/net/ethernet/cisco/enic/vnic_wq.h
@@ -12,6 +12,8 @@
#include "vnic_dev.h"
#include "vnic_cq.h"

+struct xsk_buff_pool;
+
/* Work queue control */
struct vnic_wq_ctrl {
u64 ring_base; /* 0x00 */
@@ -37,6 +39,13 @@ struct vnic_wq_ctrl {
u32 pad9;
};

+enum vnic_wq_buf_type {
+ VNIC_WQ_BUF_SKB,
+ VNIC_WQ_BUF_XDP,
+ VNIC_WQ_BUF_XSK,
+ VNIC_WQ_BUF_XSK_RX,
+};
+
struct vnic_wq_buf {
struct vnic_wq_buf *next;
dma_addr_t dma_addr;
@@ -49,6 +58,9 @@ struct vnic_wq_buf {
uint8_t cq_entry; /* Gets completion event from hw */
uint8_t desc_skip_cnt; /* Num descs to occupy */
uint8_t compressed_send; /* Both hdr and payload in one desc */
+ u8 type;
+ bool xdp_dma_mapped;
+ struct xsk_buff_pool *xsk_pool;
struct vnic_wq_buf *prev;
};

@@ -131,6 +143,9 @@ static inline void vnic_wq_post(struct vnic_wq *wq,
buf->dma_addr = dma_addr;
buf->len = len;
buf->wr_id = wrid;
+ buf->type = VNIC_WQ_BUF_SKB;
+ buf->xdp_dma_mapped = false;
+ buf->xsk_pool = NULL;

buf = buf->next;
wq->to_use = buf;

--
2.43.0