Commit 87ed3de6 authored by Yinjun Zhang's avatar Yinjun Zhang Committed by Jakub Kicinski

nfp: xsk: fix a warning when allocating rx rings

Previous commits introduced AF_XDP zero-copy support, in which
we need register different mem model for xdp_rxq when AF_XDP
zero-copy is enabled or not. And this should be done after xdp_rxq
info is registered, which is not needed for ctrl port, otherwise
there complaints warnings: "Missing register, driver bug".

Fix this by not registering mem model for ctrl port, just like we
don't register xdp_rxq info for ctrl port.

Fixes: 6402528b ("nfp: xsk: add AF_XDP zero-copy Rx and Tx support")
Signed-off-by: default avatarYinjun Zhang <yinjun.zhang@corigine.com>
Reviewed-by: default avatarNiklas Söderlund <niklas.soderlund@corigine.com>
Signed-off-by: default avatarSimon Horman <simon.horman@corigine.com>
Link: https://lore.kernel.org/r/20220309135533.10162-1-simon.horman@corigine.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 4c7d2e17
......@@ -2622,11 +2622,12 @@ nfp_net_rx_ring_alloc(struct nfp_net_dp *dp, struct nfp_net_rx_ring *rx_ring)
rx_ring->idx, rx_ring->r_vec->napi.napi_id);
if (err < 0)
return err;
}
err = xdp_rxq_info_reg_mem_model(&rx_ring->xdp_rxq, mem_type, NULL);
if (err)
goto err_alloc;
err = xdp_rxq_info_reg_mem_model(&rx_ring->xdp_rxq,
mem_type, NULL);
if (err)
goto err_alloc;
}
rx_ring->cnt = dp->rxd_cnt;
rx_ring->size = array_size(rx_ring->cnt, sizeof(*rx_ring->rxds));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment