net/bnxt: fix allocation of PF info struct
[dpdk.git] / drivers / net / bnxt / bnxt.h
index f4b39b3..7410db5 100644 (file)
@@ -219,11 +219,12 @@ struct bnxt_child_vf_info {
 
 struct bnxt_pf_info {
 #define BNXT_FIRST_PF_FID      1
-#define BNXT_MAX_VFS(bp)       (bp->pf.max_vfs)
-#define BNXT_TOTAL_VFS(bp)     ((bp)->pf.total_vfs)
+#define BNXT_MAX_VFS(bp)       ((bp)->pf->max_vfs)
+#define BNXT_TOTAL_VFS(bp)     ((bp)->pf->total_vfs)
 #define BNXT_FIRST_VF_FID      128
 #define BNXT_PF_RINGS_USED(bp) bnxt_get_num_queues(bp)
-#define BNXT_PF_RINGS_AVAIL(bp)        (bp->pf.max_cp_rings - BNXT_PF_RINGS_USED(bp))
+#define BNXT_PF_RINGS_AVAIL(bp)        ((bp)->pf->max_cp_rings - \
+                                BNXT_PF_RINGS_USED(bp))
        uint16_t                port_id;
        uint16_t                first_vf_id;
        uint16_t                active_vfs;
@@ -515,6 +516,16 @@ struct bnxt_mark_info {
 #define BNXT_FW_STATUS_SHUTDOWN                0x100000
 
 #define BNXT_HWRM_SHORT_REQ_LEN                sizeof(struct hwrm_short_input)
+
+struct bnxt_flow_stat_info {
+       uint16_t                max_fc;
+       uint16_t                flow_count;
+       struct bnxt_ctx_mem_buf_info rx_fc_in_tbl;
+       struct bnxt_ctx_mem_buf_info rx_fc_out_tbl;
+       struct bnxt_ctx_mem_buf_info tx_fc_in_tbl;
+       struct bnxt_ctx_mem_buf_info tx_fc_out_tbl;
+};
+
 struct bnxt {
        void                            *bar0;
 
@@ -549,6 +560,7 @@ struct bnxt {
 #define BNXT_FLAG_FW_CAP_ONE_STEP_TX_TS                BIT(22)
 #define BNXT_FLAG_FC_THREAD                    BIT(23)
 #define BNXT_FLAG_RX_VECTOR_PKT_MODE           BIT(24)
+#define BNXT_FLAG_FLOW_XSTATS_EN               BIT(25)
 #define BNXT_PF(bp)            (!((bp)->flags & BNXT_FLAG_VF))
 #define BNXT_VF(bp)            ((bp)->flags & BNXT_FLAG_VF)
 #define BNXT_NPAR(bp)          ((bp)->flags & BNXT_FLAG_NPAR_PF)
@@ -561,6 +573,7 @@ struct bnxt {
 #define BNXT_STINGRAY(bp)      ((bp)->flags & BNXT_FLAG_STINGRAY)
 #define BNXT_HAS_NQ(bp)                BNXT_CHIP_THOR(bp)
 #define BNXT_HAS_RING_GRPS(bp) (!BNXT_CHIP_THOR(bp))
+#define BNXT_FLOW_XSTATS_EN(bp)        ((bp)->flags & BNXT_FLAG_FLOW_XSTATS_EN)
 
        uint32_t                fw_cap;
 #define BNXT_FW_CAP_HOT_RESET          BIT(0)
@@ -636,9 +649,9 @@ struct bnxt {
        /* default HWRM request timeout value */
        uint32_t                        hwrm_cmd_timeout;
 
-       struct bnxt_link_info   link_info;
-       struct bnxt_cos_queue_info      rx_cos_queue[BNXT_COS_QUEUE_COUNT];
-       struct bnxt_cos_queue_info      tx_cos_queue[BNXT_COS_QUEUE_COUNT];
+       struct bnxt_link_info           *link_info;
+       struct bnxt_cos_queue_info      *rx_cos_queue;
+       struct bnxt_cos_queue_info      *tx_cos_queue;
        uint8_t                 tx_cosq_id[BNXT_COS_QUEUE_COUNT];
        uint8_t                 rx_cosq_cnt;
        uint8_t                 max_tc;
@@ -677,7 +690,7 @@ struct bnxt {
 #define BNXT_OUTER_TPID_BD_MASK        0xffff0000
 #define BNXT_OUTER_TPID_BD_SHFT        16
        uint32_t                outer_tpid_bd;
-       struct bnxt_pf_info     pf;
+       struct bnxt_pf_info     *pf;
        uint8_t                 vxlan_port_cnt;
        uint8_t                 geneve_port_cnt;
        uint16_t                vxlan_port;
@@ -709,12 +722,7 @@ struct bnxt {
        struct tf               tfp;
        struct bnxt_ulp_context ulp_ctx;
        uint8_t                 truflow;
-       uint16_t                max_fc;
-       struct bnxt_ctx_mem_buf_info rx_fc_in_tbl;
-       struct bnxt_ctx_mem_buf_info rx_fc_out_tbl;
-       struct bnxt_ctx_mem_buf_info tx_fc_in_tbl;
-       struct bnxt_ctx_mem_buf_info tx_fc_out_tbl;
-       uint16_t                flow_count;
+       struct bnxt_flow_stat_info *flow_stat;
        uint8_t                 flow_xstat;
 };