net/bnxt: remove unnecessary structure variable
authorKalesh AP <kalesh-anakkur.purayil@broadcom.com>
Tue, 28 Jan 2020 07:29:20 +0000 (12:59 +0530)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 5 Feb 2020 08:51:20 +0000 (09:51 +0100)
This change could help in reducing the size of bnxt PMD private
data structure by converting a uint8_t variable to use bit map flag.

Fixes: 5cd0e2889c43 ("net/bnxt: support NIC Partitioning")
Cc: stable@dpdk.org
Reviewed-by: Santoshkumar Karanappa Rastapur <santosh.rastapur@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
drivers/net/bnxt/bnxt.h
drivers/net/bnxt/bnxt_hwrm.c

index 95f1f1a..434ce28 100644 (file)
@@ -520,12 +520,13 @@ struct bnxt {
 #define BNXT_FLAG_FW_HEALTH_CHECK_SCHEDULED    BIT(18)
 #define BNXT_FLAG_EXT_STATS_SUPPORTED          BIT(19)
 #define BNXT_FLAG_NEW_RM                       BIT(20)
+#define BNXT_FLAG_NPAR_PF                      BIT(21)
 #define BNXT_FLAG_FW_CAP_ONE_STEP_TX_TS                BIT(22)
 #define BNXT_FLAG_ADV_FLOW_MGMT                        BIT(23)
 #define BNXT_FLAG_RX_VECTOR_PKT_MODE           BIT(24)
 #define BNXT_PF(bp)            (!((bp)->flags & BNXT_FLAG_VF))
 #define BNXT_VF(bp)            ((bp)->flags & BNXT_FLAG_VF)
-#define BNXT_NPAR(bp)          ((bp)->port_partition_type)
+#define BNXT_NPAR(bp)          ((bp)->flags & BNXT_FLAG_NPAR_PF)
 #define BNXT_MH(bp)             ((bp)->flags & BNXT_FLAG_MULTI_HOST)
 #define BNXT_SINGLE_PF(bp)      (BNXT_PF(bp) && !BNXT_NPAR(bp) && !BNXT_MH(bp))
 #define BNXT_USE_CHIMP_MB      0 //For non-CFA commands, everything uses Chimp.
@@ -647,7 +648,6 @@ struct bnxt {
 #define BNXT_OUTER_TPID_BD_SHFT        16
        uint32_t                outer_tpid_bd;
        struct bnxt_pf_info     pf;
-       uint8_t                 port_partition_type;
        uint8_t                 dev_stopped;
        uint8_t                 vxlan_port_cnt;
        uint8_t                 geneve_port_cnt;
index 460cc48..f325aff 100644 (file)
@@ -2952,10 +2952,10 @@ int bnxt_hwrm_func_qcfg(struct bnxt *bp, uint16_t *mtu)
        case HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR1_5:
        case HWRM_FUNC_QCFG_OUTPUT_PORT_PARTITION_TYPE_NPAR2_0:
                /* FALLTHROUGH */
-               bp->port_partition_type = resp->port_partition_type;
+               bp->flags |= BNXT_FLAG_NPAR_PF;
                break;
        default:
-               bp->port_partition_type = 0;
+               bp->flags &= ~BNXT_FLAG_NPAR_PF;
                break;
        }