1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright (c) 2019, Intel Corporation. */
4 #include <linux/bpf_trace.h>
5 #include <net/xdp_sock_drv.h>
12 #include "ice_txrx_lib.h"
15 static struct xdp_buff **ice_xdp_buf(struct ice_rx_ring *rx_ring, u32 idx)
17 return &rx_ring->xdp_buf[idx];
21 * ice_qp_reset_stats - Resets all stats for rings of given index
22 * @vsi: VSI that contains rings of interest
23 * @q_idx: ring index in array
25 static void ice_qp_reset_stats(struct ice_vsi *vsi, u16 q_idx)
27 memset(&vsi->rx_rings[q_idx]->rx_stats, 0,
28 sizeof(vsi->rx_rings[q_idx]->rx_stats));
29 memset(&vsi->tx_rings[q_idx]->stats, 0,
30 sizeof(vsi->tx_rings[q_idx]->stats));
31 if (ice_is_xdp_ena_vsi(vsi))
32 memset(&vsi->xdp_rings[q_idx]->stats, 0,
33 sizeof(vsi->xdp_rings[q_idx]->stats));
37 * ice_qp_clean_rings - Cleans all the rings of a given index
38 * @vsi: VSI that contains rings of interest
39 * @q_idx: ring index in array
41 static void ice_qp_clean_rings(struct ice_vsi *vsi, u16 q_idx)
43 ice_clean_tx_ring(vsi->tx_rings[q_idx]);
44 if (ice_is_xdp_ena_vsi(vsi))
45 ice_clean_tx_ring(vsi->xdp_rings[q_idx]);
46 ice_clean_rx_ring(vsi->rx_rings[q_idx]);
50 * ice_qvec_toggle_napi - Enables/disables NAPI for a given q_vector
51 * @vsi: VSI that has netdev
52 * @q_vector: q_vector that has NAPI context
53 * @enable: true for enable, false for disable
56 ice_qvec_toggle_napi(struct ice_vsi *vsi, struct ice_q_vector *q_vector,
59 if (!vsi->netdev || !q_vector)
63 napi_enable(&q_vector->napi);
65 napi_disable(&q_vector->napi);
69 * ice_qvec_dis_irq - Mask off queue interrupt generation on given ring
70 * @vsi: the VSI that contains queue vector being un-configured
71 * @rx_ring: Rx ring that will have its IRQ disabled
72 * @q_vector: queue vector
75 ice_qvec_dis_irq(struct ice_vsi *vsi, struct ice_rx_ring *rx_ring,
76 struct ice_q_vector *q_vector)
78 struct ice_pf *pf = vsi->back;
79 struct ice_hw *hw = &pf->hw;
80 int base = vsi->base_vector;
84 /* QINT_TQCTL is being cleared in ice_vsi_stop_tx_ring, so handle
85 * here only QINT_RQCTL
87 reg = rx_ring->reg_idx;
88 val = rd32(hw, QINT_RQCTL(reg));
89 val &= ~QINT_RQCTL_CAUSE_ENA_M;
90 wr32(hw, QINT_RQCTL(reg), val);
93 u16 v_idx = q_vector->v_idx;
95 wr32(hw, GLINT_DYN_CTL(q_vector->reg_idx), 0);
97 synchronize_irq(pf->msix_entries[v_idx + base].vector);
102 * ice_qvec_cfg_msix - Enable IRQ for given queue vector
103 * @vsi: the VSI that contains queue vector
104 * @q_vector: queue vector
107 ice_qvec_cfg_msix(struct ice_vsi *vsi, struct ice_q_vector *q_vector)
109 u16 reg_idx = q_vector->reg_idx;
110 struct ice_pf *pf = vsi->back;
111 struct ice_hw *hw = &pf->hw;
112 struct ice_tx_ring *tx_ring;
113 struct ice_rx_ring *rx_ring;
115 ice_cfg_itr(hw, q_vector);
117 ice_for_each_tx_ring(tx_ring, q_vector->tx)
118 ice_cfg_txq_interrupt(vsi, tx_ring->reg_idx, reg_idx,
119 q_vector->tx.itr_idx);
121 ice_for_each_rx_ring(rx_ring, q_vector->rx)
122 ice_cfg_rxq_interrupt(vsi, rx_ring->reg_idx, reg_idx,
123 q_vector->rx.itr_idx);
129 * ice_qvec_ena_irq - Enable IRQ for given queue vector
130 * @vsi: the VSI that contains queue vector
131 * @q_vector: queue vector
133 static void ice_qvec_ena_irq(struct ice_vsi *vsi, struct ice_q_vector *q_vector)
135 struct ice_pf *pf = vsi->back;
136 struct ice_hw *hw = &pf->hw;
138 ice_irq_dynamic_ena(hw, vsi, q_vector);
144 * ice_qp_dis - Disables a queue pair
145 * @vsi: VSI of interest
146 * @q_idx: ring index in array
148 * Returns 0 on success, negative on failure.
150 static int ice_qp_dis(struct ice_vsi *vsi, u16 q_idx)
152 struct ice_txq_meta txq_meta = { };
153 struct ice_q_vector *q_vector;
154 struct ice_tx_ring *tx_ring;
155 struct ice_rx_ring *rx_ring;
159 if (q_idx >= vsi->num_rxq || q_idx >= vsi->num_txq)
162 tx_ring = vsi->tx_rings[q_idx];
163 rx_ring = vsi->rx_rings[q_idx];
164 q_vector = rx_ring->q_vector;
166 while (test_and_set_bit(ICE_CFG_BUSY, vsi->state)) {
170 usleep_range(1000, 2000);
172 netif_tx_stop_queue(netdev_get_tx_queue(vsi->netdev, q_idx));
174 ice_qvec_dis_irq(vsi, rx_ring, q_vector);
176 ice_fill_txq_meta(vsi, tx_ring, &txq_meta);
177 err = ice_vsi_stop_tx_ring(vsi, ICE_NO_RESET, 0, tx_ring, &txq_meta);
180 if (ice_is_xdp_ena_vsi(vsi)) {
181 struct ice_tx_ring *xdp_ring = vsi->xdp_rings[q_idx];
183 memset(&txq_meta, 0, sizeof(txq_meta));
184 ice_fill_txq_meta(vsi, xdp_ring, &txq_meta);
185 err = ice_vsi_stop_tx_ring(vsi, ICE_NO_RESET, 0, xdp_ring,
190 err = ice_vsi_ctrl_one_rx_ring(vsi, false, q_idx, true);
194 ice_qvec_toggle_napi(vsi, q_vector, false);
195 ice_qp_clean_rings(vsi, q_idx);
196 ice_qp_reset_stats(vsi, q_idx);
202 * ice_qp_ena - Enables a queue pair
203 * @vsi: VSI of interest
204 * @q_idx: ring index in array
206 * Returns 0 on success, negative on failure.
208 static int ice_qp_ena(struct ice_vsi *vsi, u16 q_idx)
210 struct ice_aqc_add_tx_qgrp *qg_buf;
211 struct ice_q_vector *q_vector;
212 struct ice_tx_ring *tx_ring;
213 struct ice_rx_ring *rx_ring;
217 if (q_idx >= vsi->num_rxq || q_idx >= vsi->num_txq)
220 size = struct_size(qg_buf, txqs, 1);
221 qg_buf = kzalloc(size, GFP_KERNEL);
225 qg_buf->num_txqs = 1;
227 tx_ring = vsi->tx_rings[q_idx];
228 rx_ring = vsi->rx_rings[q_idx];
229 q_vector = rx_ring->q_vector;
231 err = ice_vsi_cfg_txq(vsi, tx_ring, qg_buf);
235 if (ice_is_xdp_ena_vsi(vsi)) {
236 struct ice_tx_ring *xdp_ring = vsi->xdp_rings[q_idx];
238 memset(qg_buf, 0, size);
239 qg_buf->num_txqs = 1;
240 err = ice_vsi_cfg_txq(vsi, xdp_ring, qg_buf);
243 ice_set_ring_xdp(xdp_ring);
244 xdp_ring->xsk_pool = ice_tx_xsk_pool(xdp_ring);
247 err = ice_vsi_cfg_rxq(rx_ring);
251 ice_qvec_cfg_msix(vsi, q_vector);
253 err = ice_vsi_ctrl_one_rx_ring(vsi, true, q_idx, true);
257 clear_bit(ICE_CFG_BUSY, vsi->state);
258 ice_qvec_toggle_napi(vsi, q_vector, true);
259 ice_qvec_ena_irq(vsi, q_vector);
261 netif_tx_start_queue(netdev_get_tx_queue(vsi->netdev, q_idx));
268 * ice_xsk_pool_disable - disable a buffer pool region
272 * Returns 0 on success, negative on failure
274 static int ice_xsk_pool_disable(struct ice_vsi *vsi, u16 qid)
276 struct xsk_buff_pool *pool = xsk_get_pool_from_qid(vsi->netdev, qid);
281 clear_bit(qid, vsi->af_xdp_zc_qps);
282 xsk_pool_dma_unmap(pool, ICE_RX_DMA_ATTR);
288 * ice_xsk_pool_enable - enable a buffer pool region
290 * @pool: pointer to a requested buffer pool region
293 * Returns 0 on success, negative on failure
296 ice_xsk_pool_enable(struct ice_vsi *vsi, struct xsk_buff_pool *pool, u16 qid)
300 if (vsi->type != ICE_VSI_PF)
303 if (qid >= vsi->netdev->real_num_rx_queues ||
304 qid >= vsi->netdev->real_num_tx_queues)
307 err = xsk_pool_dma_map(pool, ice_pf_to_dev(vsi->back),
312 set_bit(qid, vsi->af_xdp_zc_qps);
318 * ice_xsk_pool_setup - enable/disable a buffer pool region depending on its state
320 * @pool: buffer pool to enable/associate to a ring, NULL to disable
323 * Returns 0 on success, negative on failure
325 int ice_xsk_pool_setup(struct ice_vsi *vsi, struct xsk_buff_pool *pool, u16 qid)
327 bool if_running, pool_present = !!pool;
328 int ret = 0, pool_failure = 0;
330 if_running = netif_running(vsi->netdev) && ice_is_xdp_ena_vsi(vsi);
333 ret = ice_qp_dis(vsi, qid);
335 netdev_err(vsi->netdev, "ice_qp_dis error = %d\n", ret);
340 pool_failure = pool_present ? ice_xsk_pool_enable(vsi, pool, qid) :
341 ice_xsk_pool_disable(vsi, qid);
345 ret = ice_qp_ena(vsi, qid);
346 if (!ret && pool_present)
347 napi_schedule(&vsi->xdp_rings[qid]->q_vector->napi);
349 netdev_err(vsi->netdev, "ice_qp_ena error = %d\n", ret);
353 netdev_err(vsi->netdev, "Could not %sable buffer pool, error = %d\n",
354 pool_present ? "en" : "dis", pool_failure);
362 * ice_alloc_rx_bufs_zc - allocate a number of Rx buffers
364 * @count: The number of buffers to allocate
366 * This function allocates a number of Rx buffers from the fill ring
367 * or the internal recycle mechanism and places them on the Rx ring.
369 * Returns true if all allocations were successful, false if any fail.
371 bool ice_alloc_rx_bufs_zc(struct ice_rx_ring *rx_ring, u16 count)
373 union ice_32b_rx_flex_desc *rx_desc;
374 u16 ntu = rx_ring->next_to_use;
375 struct xdp_buff **xdp;
379 rx_desc = ICE_RX_DESC(rx_ring, ntu);
380 xdp = ice_xdp_buf(rx_ring, ntu);
382 nb_buffs = min_t(u16, count, rx_ring->count - ntu);
383 nb_buffs = xsk_buff_alloc_batch(rx_ring->xsk_pool, xdp, nb_buffs);
389 dma = xsk_buff_xdp_get_dma(*xdp);
390 rx_desc->read.pkt_addr = cpu_to_le64(dma);
391 rx_desc->wb.status_error0 = 0;
398 if (ntu == rx_ring->count)
401 ice_release_rx_desc(rx_ring, ntu);
403 return count == nb_buffs;
407 * ice_bump_ntc - Bump the next_to_clean counter of an Rx ring
410 static void ice_bump_ntc(struct ice_rx_ring *rx_ring)
412 int ntc = rx_ring->next_to_clean + 1;
414 ntc = (ntc < rx_ring->count) ? ntc : 0;
415 rx_ring->next_to_clean = ntc;
416 prefetch(ICE_RX_DESC(rx_ring, ntc));
420 * ice_construct_skb_zc - Create an sk_buff from zero-copy buffer
422 * @xdp: Pointer to XDP buffer
424 * This function allocates a new skb from a zero-copy Rx buffer.
426 * Returns the skb on success, NULL on failure.
428 static struct sk_buff *
429 ice_construct_skb_zc(struct ice_rx_ring *rx_ring, struct xdp_buff *xdp)
431 unsigned int totalsize = xdp->data_end - xdp->data_meta;
432 unsigned int metasize = xdp->data - xdp->data_meta;
435 net_prefetch(xdp->data_meta);
437 skb = __napi_alloc_skb(&rx_ring->q_vector->napi, totalsize,
438 GFP_ATOMIC | __GFP_NOWARN);
442 memcpy(__skb_put(skb, totalsize), xdp->data_meta,
443 ALIGN(totalsize, sizeof(long)));
446 skb_metadata_set(skb, metasize);
447 __skb_pull(skb, metasize);
455 * ice_run_xdp_zc - Executes an XDP program in zero-copy path
457 * @xdp: xdp_buff used as input to the XDP program
458 * @xdp_prog: XDP program to run
459 * @xdp_ring: ring to be used for XDP_TX action
461 * Returns any of ICE_XDP_{PASS, CONSUMED, TX, REDIR}
464 ice_run_xdp_zc(struct ice_rx_ring *rx_ring, struct xdp_buff *xdp,
465 struct bpf_prog *xdp_prog, struct ice_tx_ring *xdp_ring)
467 int err, result = ICE_XDP_PASS;
470 act = bpf_prog_run_xdp(xdp_prog, xdp);
472 if (likely(act == XDP_REDIRECT)) {
473 err = xdp_do_redirect(rx_ring->netdev, xdp, xdp_prog);
476 return ICE_XDP_REDIR;
483 result = ice_xmit_xdp_buff(xdp, xdp_ring);
484 if (result == ICE_XDP_CONSUMED)
488 bpf_warn_invalid_xdp_action(rx_ring->netdev, xdp_prog, act);
492 trace_xdp_exception(rx_ring->netdev, xdp_prog, act);
495 result = ICE_XDP_CONSUMED;
503 * ice_clean_rx_irq_zc - consumes packets from the hardware ring
504 * @rx_ring: AF_XDP Rx ring
505 * @budget: NAPI budget
507 * Returns number of processed packets on success, remaining budget on failure.
509 int ice_clean_rx_irq_zc(struct ice_rx_ring *rx_ring, int budget)
511 unsigned int total_rx_bytes = 0, total_rx_packets = 0;
512 struct ice_tx_ring *xdp_ring;
513 unsigned int xdp_xmit = 0;
514 struct bpf_prog *xdp_prog;
515 bool failure = false;
517 /* ZC patch is enabled only when XDP program is set,
518 * so here it can not be NULL
520 xdp_prog = READ_ONCE(rx_ring->xdp_prog);
521 xdp_ring = rx_ring->xdp_ring;
523 while (likely(total_rx_packets < (unsigned int)budget)) {
524 union ice_32b_rx_flex_desc *rx_desc;
525 unsigned int size, xdp_res = 0;
526 struct xdp_buff *xdp;
532 rx_desc = ICE_RX_DESC(rx_ring, rx_ring->next_to_clean);
534 stat_err_bits = BIT(ICE_RX_FLEX_DESC_STATUS0_DD_S);
535 if (!ice_test_staterr(rx_desc, stat_err_bits))
538 /* This memory barrier is needed to keep us from reading
539 * any other fields out of the rx_desc until we have
540 * verified the descriptor has been written back.
544 xdp = *ice_xdp_buf(rx_ring, rx_ring->next_to_clean);
546 size = le16_to_cpu(rx_desc->wb.pkt_len) &
547 ICE_RX_FLX_DESC_PKT_LEN_M;
550 xdp->data_end = NULL;
551 xdp->data_hard_start = NULL;
552 xdp->data_meta = NULL;
556 xsk_buff_set_size(xdp, size);
557 xsk_buff_dma_sync_for_cpu(xdp, rx_ring->xsk_pool);
559 xdp_res = ice_run_xdp_zc(rx_ring, xdp, xdp_prog, xdp_ring);
561 if (xdp_res & (ICE_XDP_TX | ICE_XDP_REDIR))
566 total_rx_bytes += size;
569 ice_bump_ntc(rx_ring);
574 skb = ice_construct_skb_zc(rx_ring, xdp);
576 rx_ring->rx_stats.alloc_buf_failed++;
580 ice_bump_ntc(rx_ring);
582 if (eth_skb_pad(skb)) {
587 total_rx_bytes += skb->len;
590 stat_err_bits = BIT(ICE_RX_FLEX_DESC_STATUS0_L2TAG1P_S);
591 if (ice_test_staterr(rx_desc, stat_err_bits))
592 vlan_tag = le16_to_cpu(rx_desc->wb.l2tag1);
594 rx_ptype = le16_to_cpu(rx_desc->wb.ptype_flex_flags0) &
595 ICE_RX_FLEX_DESC_PTYPE_M;
597 ice_process_skb_fields(rx_ring, rx_desc, skb, rx_ptype);
598 ice_receive_skb(rx_ring, skb, vlan_tag);
601 failure = !ice_alloc_rx_bufs_zc(rx_ring, ICE_DESC_UNUSED(rx_ring));
603 ice_finalize_xdp_rx(xdp_ring, xdp_xmit);
604 ice_update_rx_ring_stats(rx_ring, total_rx_packets, total_rx_bytes);
606 if (xsk_uses_need_wakeup(rx_ring->xsk_pool)) {
607 if (failure || rx_ring->next_to_clean == rx_ring->next_to_use)
608 xsk_set_rx_need_wakeup(rx_ring->xsk_pool);
610 xsk_clear_rx_need_wakeup(rx_ring->xsk_pool);
612 return (int)total_rx_packets;
615 return failure ? budget : (int)total_rx_packets;
619 * ice_xmit_zc - Completes AF_XDP entries, and cleans XDP entries
620 * @xdp_ring: XDP Tx ring
621 * @budget: max number of frames to xmit
623 * Returns true if cleanup/transmission is done.
625 static bool ice_xmit_zc(struct ice_tx_ring *xdp_ring, int budget)
627 struct ice_tx_desc *tx_desc = NULL;
628 bool work_done = true;
629 struct xdp_desc desc;
632 while (likely(budget-- > 0)) {
633 struct ice_tx_buf *tx_buf;
635 if (unlikely(!ICE_DESC_UNUSED(xdp_ring))) {
636 xdp_ring->tx_stats.tx_busy++;
641 tx_buf = &xdp_ring->tx_buf[xdp_ring->next_to_use];
643 if (!xsk_tx_peek_desc(xdp_ring->xsk_pool, &desc))
646 dma = xsk_buff_raw_get_dma(xdp_ring->xsk_pool, desc.addr);
647 xsk_buff_raw_dma_sync_for_device(xdp_ring->xsk_pool, dma,
650 tx_buf->bytecount = desc.len;
652 tx_desc = ICE_TX_DESC(xdp_ring, xdp_ring->next_to_use);
653 tx_desc->buf_addr = cpu_to_le64(dma);
654 tx_desc->cmd_type_offset_bsz =
655 ice_build_ctob(ICE_TXD_LAST_DESC_CMD, 0, desc.len, 0);
657 xdp_ring->next_to_use++;
658 if (xdp_ring->next_to_use == xdp_ring->count)
659 xdp_ring->next_to_use = 0;
663 ice_xdp_ring_update_tail(xdp_ring);
664 xsk_tx_release(xdp_ring->xsk_pool);
667 return budget > 0 && work_done;
671 * ice_clean_xdp_tx_buf - Free and unmap XDP Tx buffer
672 * @xdp_ring: XDP Tx ring
673 * @tx_buf: Tx buffer to clean
676 ice_clean_xdp_tx_buf(struct ice_tx_ring *xdp_ring, struct ice_tx_buf *tx_buf)
678 xdp_return_frame((struct xdp_frame *)tx_buf->raw_buf);
679 dma_unmap_single(xdp_ring->dev, dma_unmap_addr(tx_buf, dma),
680 dma_unmap_len(tx_buf, len), DMA_TO_DEVICE);
681 dma_unmap_len_set(tx_buf, len, 0);
685 * ice_clean_tx_irq_zc - Completes AF_XDP entries, and cleans XDP entries
686 * @xdp_ring: XDP Tx ring
687 * @budget: NAPI budget
689 * Returns true if cleanup/tranmission is done.
691 bool ice_clean_tx_irq_zc(struct ice_tx_ring *xdp_ring, int budget)
693 int total_packets = 0, total_bytes = 0;
694 s16 ntc = xdp_ring->next_to_clean;
695 struct ice_tx_desc *tx_desc;
696 struct ice_tx_buf *tx_buf;
700 tx_desc = ICE_TX_DESC(xdp_ring, ntc);
701 tx_buf = &xdp_ring->tx_buf[ntc];
702 ntc -= xdp_ring->count;
705 if (!(tx_desc->cmd_type_offset_bsz &
706 cpu_to_le64(ICE_TX_DESC_DTYPE_DESC_DONE)))
709 total_bytes += tx_buf->bytecount;
712 if (tx_buf->raw_buf) {
713 ice_clean_xdp_tx_buf(xdp_ring, tx_buf);
714 tx_buf->raw_buf = NULL;
719 tx_desc->cmd_type_offset_bsz = 0;
724 if (unlikely(!ntc)) {
725 ntc -= xdp_ring->count;
726 tx_buf = xdp_ring->tx_buf;
727 tx_desc = ICE_TX_DESC(xdp_ring, 0);
732 } while (likely(--budget));
734 ntc += xdp_ring->count;
735 xdp_ring->next_to_clean = ntc;
738 xsk_tx_completed(xdp_ring->xsk_pool, xsk_frames);
740 if (xsk_uses_need_wakeup(xdp_ring->xsk_pool))
741 xsk_set_tx_need_wakeup(xdp_ring->xsk_pool);
743 ice_update_tx_ring_stats(xdp_ring, total_packets, total_bytes);
744 xmit_done = ice_xmit_zc(xdp_ring, ICE_DFLT_IRQ_WORK);
746 return budget > 0 && xmit_done;
750 * ice_xsk_wakeup - Implements ndo_xsk_wakeup
751 * @netdev: net_device
752 * @queue_id: queue to wake up
753 * @flags: ignored in our case, since we have Rx and Tx in the same NAPI
755 * Returns negative on error, zero otherwise.
758 ice_xsk_wakeup(struct net_device *netdev, u32 queue_id,
759 u32 __always_unused flags)
761 struct ice_netdev_priv *np = netdev_priv(netdev);
762 struct ice_q_vector *q_vector;
763 struct ice_vsi *vsi = np->vsi;
764 struct ice_tx_ring *ring;
766 if (test_bit(ICE_DOWN, vsi->state))
769 if (!ice_is_xdp_ena_vsi(vsi))
772 if (queue_id >= vsi->num_txq)
775 if (!vsi->xdp_rings[queue_id]->xsk_pool)
778 ring = vsi->xdp_rings[queue_id];
780 /* The idea here is that if NAPI is running, mark a miss, so
781 * it will run again. If not, trigger an interrupt and
782 * schedule the NAPI from interrupt context. If NAPI would be
783 * scheduled here, the interrupt affinity would not be
786 q_vector = ring->q_vector;
787 if (!napi_if_scheduled_mark_missed(&q_vector->napi))
788 ice_trigger_sw_intr(&vsi->back->hw, q_vector);
794 * ice_xsk_any_rx_ring_ena - Checks if Rx rings have AF_XDP buff pool attached
795 * @vsi: VSI to be checked
797 * Returns true if any of the Rx rings has an AF_XDP buff pool attached
799 bool ice_xsk_any_rx_ring_ena(struct ice_vsi *vsi)
803 ice_for_each_rxq(vsi, i) {
804 if (xsk_get_pool_from_qid(vsi->netdev, i))
812 * ice_xsk_clean_rx_ring - clean buffer pool queues connected to a given Rx ring
813 * @rx_ring: ring to be cleaned
815 void ice_xsk_clean_rx_ring(struct ice_rx_ring *rx_ring)
817 u16 count_mask = rx_ring->count - 1;
818 u16 ntc = rx_ring->next_to_clean;
819 u16 ntu = rx_ring->next_to_use;
821 for ( ; ntc != ntu; ntc = (ntc + 1) & count_mask) {
822 struct xdp_buff *xdp = *ice_xdp_buf(rx_ring, ntc);
829 * ice_xsk_clean_xdp_ring - Clean the XDP Tx ring and its buffer pool queues
830 * @xdp_ring: XDP_Tx ring
832 void ice_xsk_clean_xdp_ring(struct ice_tx_ring *xdp_ring)
834 u16 ntc = xdp_ring->next_to_clean, ntu = xdp_ring->next_to_use;
838 struct ice_tx_buf *tx_buf = &xdp_ring->tx_buf[ntc];
841 ice_clean_xdp_tx_buf(xdp_ring, tx_buf);
845 tx_buf->raw_buf = NULL;
848 if (ntc >= xdp_ring->count)
853 xsk_tx_completed(xdp_ring->xsk_pool, xsk_frames);