net/txgbe: add build and doc infrastructure
[dpdk.git] / drivers / net / bnxt / bnxt.h
index f0b0800..a951bca 100644 (file)
 #define        BNXT_DEFAULT_VNIC_CHANGE_VF_ID_SFT              \
        HWRM_ASYNC_EVENT_CMPL_DEFAULT_VNIC_CHANGE_EVENT_DATA1_VF_ID_SFT
 
+#define BNXT_HWRM_CMD_TO_FORWARD(cmd)  \
+               (bp->pf->vf_req_fwd[(cmd) / 32] |= (1 << ((cmd) % 32)))
+
 struct bnxt_led_info {
        uint8_t      num_leds;
        uint8_t      led_id;
@@ -268,8 +271,8 @@ struct bnxt_pf_info {
 };
 
 /* Max wait time for link up is 10s and link down is 500ms */
-#define BNXT_LINK_UP_WAIT_CNT  200
-#define BNXT_LINK_DOWN_WAIT_CNT        10
+#define BNXT_MAX_LINK_WAIT_CNT 200
+#define BNXT_MIN_LINK_WAIT_CNT 10
 #define BNXT_LINK_WAIT_INTERVAL        50
 struct bnxt_link_info {
        uint32_t                phy_flags;
@@ -292,6 +295,13 @@ struct bnxt_link_info {
        uint32_t                preemphasis;
        uint8_t                 phy_type;
        uint8_t                 media_type;
+       uint16_t                support_auto_speeds;
+       uint8_t                 link_signal_mode;
+       uint16_t                force_pam4_link_speed;
+       uint16_t                support_pam4_speeds;
+       uint16_t                auto_pam4_link_speeds;
+       uint16_t                support_pam4_auto_speeds;
+       uint8_t                 req_signal_mode;
 };
 
 #define BNXT_COS_QUEUE_COUNT   8
@@ -551,7 +561,8 @@ struct bnxt_rep_info {
        ETH_RSS_NONFRAG_IPV4_UDP |      \
        ETH_RSS_IPV6 |          \
        ETH_RSS_NONFRAG_IPV6_TCP |      \
-       ETH_RSS_NONFRAG_IPV6_UDP)
+       ETH_RSS_NONFRAG_IPV6_UDP |      \
+       ETH_RSS_LEVEL_MASK)
 
 #define BNXT_DEV_TX_OFFLOAD_SUPPORT (DEV_TX_OFFLOAD_VLAN_INSERT | \
                                     DEV_TX_OFFLOAD_IPV4_CKSUM | \
@@ -656,14 +667,16 @@ struct bnxt {
 #define BNXT_FW_CAP_IF_CHANGE          BIT(1)
 #define BNXT_FW_CAP_ERROR_RECOVERY     BIT(2)
 #define BNXT_FW_CAP_ERR_RECOVER_RELOAD BIT(3)
+#define BNXT_FW_CAP_HCOMM_FW_STATUS    BIT(4)
 #define BNXT_FW_CAP_ADV_FLOW_MGMT      BIT(5)
 #define BNXT_FW_CAP_ADV_FLOW_COUNTERS  BIT(6)
-#define BNXT_FW_CAP_HCOMM_FW_STATUS    BIT(7)
+#define BNXT_FW_CAP_LINK_ADMIN         BIT(7)
 
        pthread_mutex_t         flow_lock;
 
        uint32_t                vnic_cap_flags;
 #define BNXT_VNIC_CAP_COS_CLASSIFY     BIT(0)
+#define BNXT_VNIC_CAP_OUTER_RSS                BIT(1)
        unsigned int            rx_nr_rings;
        unsigned int            rx_cp_nr_rings;
        unsigned int            rx_num_qs_per_vnic;
@@ -712,6 +725,7 @@ struct bnxt {
        rte_iova_t                      hwrm_short_cmd_req_dma_addr;
        rte_spinlock_t                  hwrm_lock;
        pthread_mutex_t                 def_cp_lock;
+       pthread_mutex_t                 health_check_lock;
        uint16_t                        max_req_len;
        uint16_t                        max_resp_len;
        uint16_t                        hwrm_max_ext_req_len;
@@ -814,15 +828,26 @@ struct bnxt {
 /**
  * Structure to store private data for each VF representor instance
  */
-struct bnxt_vf_representor {
+struct bnxt_representor {
        uint16_t                switch_domain_id;
        uint16_t                vf_id;
+#define BNXT_REP_IS_PF         BIT(0)
+#define BNXT_REP_Q_R2F_VALID           BIT(1)
+#define BNXT_REP_Q_F2R_VALID           BIT(2)
+#define BNXT_REP_FC_R2F_VALID          BIT(3)
+#define BNXT_REP_FC_F2R_VALID          BIT(4)
+       uint32_t                flags;
        uint16_t                fw_fid;
 #define        BNXT_DFLT_VNIC_ID_INVALID       0xFFFF
        uint16_t                dflt_vnic_id;
        uint16_t                svif;
        uint16_t                vfr_tx_cfa_action;
        uint32_t                dpdk_port_id;
+       uint32_t                rep_based_pf;
+       uint8_t                 rep_q_r2f;
+       uint8_t                 rep_q_f2r;
+       uint8_t                 rep_fc_r2f;
+       uint8_t                 rep_fc_f2r;
        /* Private data store of associated PF/Trusted VF */
        struct rte_eth_dev      *parent_dev;
        uint8_t                 mac_addr[RTE_ETHER_ADDR_LEN];
@@ -838,9 +863,11 @@ struct bnxt_vf_representor {
        uint64_t                rx_drop_bytes[BNXT_MAX_VF_REP_RINGS];
 };
 
+#define BNXT_REP_PF(vfr_bp)    ((vfr_bp)->flags & BNXT_REP_IS_PF)
+
 struct bnxt_vf_rep_tx_queue {
        struct bnxt_tx_queue *txq;
-       struct bnxt_vf_representor *bp;
+       struct bnxt_representor *bp;
 };
 
 int bnxt_mtu_set_op(struct rte_eth_dev *eth_dev, uint16_t new_mtu);
@@ -899,7 +926,7 @@ void bnxt_ulp_destroy_df_rules(struct bnxt *bp, bool global);
 int32_t
 bnxt_ulp_create_vfr_default_rules(struct rte_eth_dev *vfr_ethdev);
 int32_t
-bnxt_ulp_delete_vfr_default_rules(struct bnxt_vf_representor *vfr);
+bnxt_ulp_delete_vfr_default_rules(struct bnxt_representor *vfr);
 uint16_t bnxt_get_vnic_id(uint16_t port, enum bnxt_ulp_intf_type type);
 uint16_t bnxt_get_svif(uint16_t port_id, bool func_svif,
                       enum bnxt_ulp_intf_type type);
@@ -909,7 +936,7 @@ uint16_t bnxt_get_phy_port_id(uint16_t port);
 uint16_t bnxt_get_vport(uint16_t port);
 enum bnxt_ulp_intf_type
 bnxt_get_interface_type(uint16_t port);
-int bnxt_vf_rep_dev_start_op(struct rte_eth_dev *eth_dev);
+int bnxt_rep_dev_start_op(struct rte_eth_dev *eth_dev);
 
 void bnxt_cancel_fc_thread(struct bnxt *bp);
 void bnxt_flow_cnt_alarm_cb(void *arg);