diff options
author | Yinjun Zhang <yinjun.zhang@corigine.com> | 2022-03-09 16:55:33 +0300 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-03-11 07:25:18 +0300 |
commit | 87ed3de674c69f4d998a6e0e1eb04e008ca93f84 (patch) | |
tree | c7c5b71e5d5e69ac01462cb7877f6e879f856626 /drivers | |
parent | 4c7d2e179576e821b461bb4a58d0a834916601fa (diff) | |
download | linux-87ed3de674c69f4d998a6e0e1eb04e008ca93f84.tar.xz |
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: 6402528b7a0b ("nfp: xsk: add AF_XDP zero-copy Rx and Tx support")
Signed-off-by: Yinjun Zhang <yinjun.zhang@corigine.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@corigine.com>
Signed-off-by: Simon Horman <simon.horman@corigine.com>
Link: https://lore.kernel.org/r/20220309135533.10162-1-simon.horman@corigine.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/netronome/nfp/nfp_net_common.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c index d5ff80a62882..67a87fdf7564 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c @@ -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)); |