Commit ee200a73 authored by Jakub Kicinski's avatar Jakub Kicinski Committed by David S. Miller

nfp: fix free list buffer size reporting

XDP headroom should not be included in free list buffer size.

Fixes: 6fe0c3b4 ("nfp: add support for xdp_adjust_head()")
Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 010e2f9c
...@@ -2165,7 +2165,7 @@ nfp_net_tx_ring_hw_cfg_write(struct nfp_net *nn, ...@@ -2165,7 +2165,7 @@ nfp_net_tx_ring_hw_cfg_write(struct nfp_net *nn,
*/ */
static int nfp_net_set_config_and_enable(struct nfp_net *nn) static int nfp_net_set_config_and_enable(struct nfp_net *nn)
{ {
u32 new_ctrl, update = 0; u32 bufsz, new_ctrl, update = 0;
unsigned int r; unsigned int r;
int err; int err;
...@@ -2199,8 +2199,9 @@ static int nfp_net_set_config_and_enable(struct nfp_net *nn) ...@@ -2199,8 +2199,9 @@ static int nfp_net_set_config_and_enable(struct nfp_net *nn)
nfp_net_write_mac_addr(nn); nfp_net_write_mac_addr(nn);
nn_writel(nn, NFP_NET_CFG_MTU, nn->dp.netdev->mtu); nn_writel(nn, NFP_NET_CFG_MTU, nn->dp.netdev->mtu);
nn_writel(nn, NFP_NET_CFG_FLBUFSZ,
nn->dp.fl_bufsz - NFP_NET_RX_BUF_NON_DATA); bufsz = nn->dp.fl_bufsz - nn->dp.rx_dma_off - NFP_NET_RX_BUF_NON_DATA;
nn_writel(nn, NFP_NET_CFG_FLBUFSZ, bufsz);
/* Enable device */ /* Enable device */
new_ctrl |= NFP_NET_CFG_CTRL_ENABLE; new_ctrl |= NFP_NET_CFG_CTRL_ENABLE;
......
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