net/bnxt: fix TruFlow devarg handling
authorSomnath Kotur <somnath.kotur@broadcom.com>
Tue, 22 Sep 2020 07:06:28 +0000 (12:36 +0530)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 30 Sep 2020 17:19:10 +0000 (19:19 +0200)
Set the TRUFLOW Enable bit in bp->flags only if the value passed in
devargs was 1. Otherwise set it to 0.

Fixes: 313ac35ac701 ("net/bnxt: support ULP session manager init")
Cc: stable@dpdk.org
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
drivers/net/bnxt/bnxt_ethdev.c

index e0afaac..b42c6a0 100644 (file)
@@ -5581,9 +5581,13 @@ bnxt_parse_devarg_truflow(__rte_unused const char *key,
                return -EINVAL;
        }
 
-       bp->flags |= BNXT_FLAG_TRUFLOW_EN;
-       if (BNXT_TRUFLOW_EN(bp))
+       if (truflow) {
+               bp->flags |= BNXT_FLAG_TRUFLOW_EN;
                PMD_DRV_LOG(INFO, "Host-based truflow feature enabled.\n");
+       } else {
+               bp->flags &= ~BNXT_FLAG_TRUFLOW_EN;
+               PMD_DRV_LOG(INFO, "Host-based truflow feature disabled.\n");
+       }
 
        return 0;
 }