On 10/23/25 11:39 AM, Meghana Malladi wrote:
> @@ -1200,6 +1218,109 @@ static int emac_xdp_setup(struct prueth_emac *emac,
> struct netdev_bpf *bpf)
> return 0;
> }
>
> +static int prueth_xsk_pool_enable(struct prueth_emac *emac,
> + struct xsk_buff_pool *pool, u16 queue_id)
> +{
> + struct prueth_rx_chn *rx_chn = &emac->rx_chns;
> + u32 frame_size;
> + int ret;
> +
> + if (queue_id >= PRUETH_MAX_RX_FLOWS ||
> + queue_id >= emac->tx_ch_num) {
> + netdev_err(emac->ndev, "Invalid XSK queue ID %d\n", queue_id);
> + return -EINVAL;
> + }
> +
> + frame_size = xsk_pool_get_rx_frame_size(pool);
> + if (frame_size < PRUETH_MAX_PKT_SIZE)
> + return -EOPNOTSUPP;
> +
> + ret = xsk_pool_dma_map(pool, rx_chn->dma_dev, PRUETH_RX_DMA_ATTR);
> + if (ret) {
> + netdev_err(emac->ndev, "Failed to map XSK pool: %d\n", ret);
> + return ret;
> + }
> +
> + if (netif_running(emac->ndev)) {
> + /* stop packets from wire for graceful teardown */
> + ret = icssg_set_port_state(emac, ICSSG_EMAC_PORT_DISABLE);
> + if (ret)
> + return ret;
> + prueth_destroy_rxq(emac);
> + }
> +
> + emac->xsk_qid = queue_id;
> + prueth_set_xsk_pool(emac, queue_id);
> +
> + if (netif_running(emac->ndev)) {
> + ret = prueth_create_rxq(emac);
It looks like this falls short of Jakub's request on v2:
https://lore.kernel.org/netdev/[email protected]/
about not freeing the rx queue for reconfig.
I think you should:
- stop the H/W from processing incoming packets,
- spool all the pending packets
- attach/detach the xsk_pool
- refill the ring
- re-enable the H/W
/P