net/dpaa2: remove loop for unused pool entries
authorGavin Hu <gavin.hu@arm.com>
Tue, 31 Jul 2018 07:51:37 +0000 (15:51 +0800)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 3 Aug 2018 15:09:44 +0000 (17:09 +0200)
Currently only one buffer pool is configured and in use,
looping for up to maxmum 8 times is unnecessary and might
be buggy as assigned uninititalized values.

The fix is to loop for the configured times with initialize
with valid values.

Fixes: 16bbc98a3e ("bus/fslmc: update MC to 10.3.x")
Cc: stable@dpdk.org
Signed-off-by: Gavin Hu <gavin.hu@arm.com>
Reviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>
drivers/net/dpaa2/mc/dpni.c

index 69cf119..9f22816 100644 (file)
@@ -198,7 +198,7 @@ int dpni_set_pools(struct fsl_mc_io *mc_io,
                                          token);
        cmd_params = (struct dpni_cmd_set_pools *)cmd.params;
        cmd_params->num_dpbp = cfg->num_dpbp;
-       for (i = 0; i < DPNI_MAX_DPBP; i++) {
+       for (i = 0; i < cmd_params->num_dpbp; i++) {
                cmd_params->pool[i].dpbp_id =
                        cpu_to_le16(cfg->pools[i].dpbp_id);
                cmd_params->pool[i].priority_mask =