fbnic_remove_rx_ring(fbn, &nv->qt[i].sub0);
fbnic_remove_rx_ring(fbn, &nv->qt[i].sub1);
fbnic_remove_rx_ring(fbn, &nv->qt[i].cmpl);
- fbnic_free_qt_page_pools(&nv->qt[i]);
}
fbnic_napi_free_irq(fbd, nv);
fbnic_ring_init(&qt->cmpl, db, rxq_idx, FBNIC_RING_F_STATS);
fbn->rx[rxq_idx] = &qt->cmpl;
- err = fbnic_alloc_qt_page_pools(fbn, nv, qt);
- if (err)
- goto free_ring_cur_qt;
-
/* Update Rx queue index */
rxt_count--;
rxq_idx += v_count;
return 0;
- while (rxt_count < nv->rxt_count) {
- qt--;
-
- fbnic_free_qt_page_pools(qt);
-free_ring_cur_qt:
- fbnic_remove_rx_ring(fbn, &qt->sub0);
- fbnic_remove_rx_ring(fbn, &qt->sub1);
- fbnic_remove_rx_ring(fbn, &qt->cmpl);
- rxt_count++;
- }
- while (txt_count < nv->txt_count) {
- qt--;
-
- fbnic_remove_tx_ring(fbn, &qt->sub0);
- fbnic_remove_xdp_ring(fbn, &qt->sub1);
- fbnic_remove_tx_ring(fbn, &qt->cmpl);
-
- txt_count++;
- }
- fbnic_napi_free_irq(fbd, nv);
napi_del:
netif_napi_del(&nv->napi);
fbn->napi[fbnic_napi_idx(nv)] = NULL;
if (xdp_rxq_info_is_reg(&qt->xdp_rxq)) {
xdp_rxq_info_unreg_mem_model(&qt->xdp_rxq);
xdp_rxq_info_unreg(&qt->xdp_rxq);
+ fbnic_free_qt_page_pools(qt);
}
}
struct device *dev = fbn->netdev->dev.parent;
int err;
+ err = fbnic_alloc_qt_page_pools(fbn, nv, qt);
+ if (err)
+ return err;
+
err = xdp_rxq_info_reg(&qt->xdp_rxq, fbn->netdev, qt->sub0.q_idx,
nv->napi.napi_id);
if (err)
- return err;
+ goto free_page_pools;
- /* Register XDP memory model for completion queue */
err = xdp_rxq_info_reg_mem_model(&qt->xdp_rxq, MEM_TYPE_PAGE_POOL,
qt->sub0.page_pool);
if (err)
xdp_rxq_info_unreg_mem_model(&qt->xdp_rxq);
unreg_rxq:
xdp_rxq_info_unreg(&qt->xdp_rxq);
+free_page_pools:
+ fbnic_free_qt_page_pools(qt);
return err;
}