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

nfp: abm: size threshold table to account for bands

Make sure the threshold table is large enough to hold information
for all bands.
Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: default avatarJohn Hurley <john.hurley@netronome.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 57207696
...@@ -422,7 +422,7 @@ static int nfp_abm_init(struct nfp_app *app) ...@@ -422,7 +422,7 @@ static int nfp_abm_init(struct nfp_app *app)
goto err_free_abm; goto err_free_abm;
err = -ENOMEM; err = -ENOMEM;
abm->num_thresholds = NFP_NET_MAX_RX_RINGS; abm->num_thresholds = array_size(abm->num_bands, NFP_NET_MAX_RX_RINGS);
abm->threshold_undef = bitmap_zalloc(abm->num_thresholds, GFP_KERNEL); abm->threshold_undef = bitmap_zalloc(abm->num_thresholds, GFP_KERNEL);
if (!abm->threshold_undef) if (!abm->threshold_undef)
goto err_free_abm; goto err_free_abm;
...@@ -431,7 +431,7 @@ static int nfp_abm_init(struct nfp_app *app) ...@@ -431,7 +431,7 @@ static int nfp_abm_init(struct nfp_app *app)
sizeof(*abm->thresholds), GFP_KERNEL); sizeof(*abm->thresholds), GFP_KERNEL);
if (!abm->thresholds) if (!abm->thresholds)
goto err_free_thresh_umap; goto err_free_thresh_umap;
for (i = 0; i < NFP_NET_MAX_RX_RINGS; i++) for (i = 0; i < abm->num_bands * NFP_NET_MAX_RX_RINGS; i++)
__nfp_abm_ctrl_set_q_lvl(abm, i, NFP_ABM_LVL_INFINITY); __nfp_abm_ctrl_set_q_lvl(abm, i, NFP_ABM_LVL_INFINITY);
/* We start in legacy mode, make sure advanced queuing is disabled */ /* We start in legacy mode, make sure advanced queuing is disabled */
......
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