qed: Add CONFIG_QED_SRIOV
[cascardo/linux.git] / drivers / net / ethernet / qlogic / qed / qed.h
index fcb8e9b..2e067c7 100644 (file)
 #include "qed_hsi.h"
 
 extern const struct qed_common_ops qed_common_ops_pass;
-#define DRV_MODULE_VERSION "8.7.0.0"
+#define DRV_MODULE_VERSION "8.7.1.20"
 
 #define MAX_HWFNS_PER_DEVICE    (4)
 #define NAME_SIZE 16
 #define VER_SIZE 16
 
+#define QED_WFQ_UNIT   100
+
 /* cau states */
 enum qed_coalescing_mode {
        QED_COAL_MODE_DISABLE,
@@ -74,6 +76,51 @@ struct qed_rt_data {
        bool    *b_valid;
 };
 
+enum qed_tunn_mode {
+       QED_MODE_L2GENEVE_TUNN,
+       QED_MODE_IPGENEVE_TUNN,
+       QED_MODE_L2GRE_TUNN,
+       QED_MODE_IPGRE_TUNN,
+       QED_MODE_VXLAN_TUNN,
+};
+
+enum qed_tunn_clss {
+       QED_TUNN_CLSS_MAC_VLAN,
+       QED_TUNN_CLSS_MAC_VNI,
+       QED_TUNN_CLSS_INNER_MAC_VLAN,
+       QED_TUNN_CLSS_INNER_MAC_VNI,
+       MAX_QED_TUNN_CLSS,
+};
+
+struct qed_tunn_start_params {
+       unsigned long   tunn_mode;
+       u16             vxlan_udp_port;
+       u16             geneve_udp_port;
+       u8              update_vxlan_udp_port;
+       u8              update_geneve_udp_port;
+       u8              tunn_clss_vxlan;
+       u8              tunn_clss_l2geneve;
+       u8              tunn_clss_ipgeneve;
+       u8              tunn_clss_l2gre;
+       u8              tunn_clss_ipgre;
+};
+
+struct qed_tunn_update_params {
+       unsigned long   tunn_mode_update_mask;
+       unsigned long   tunn_mode;
+       u16             vxlan_udp_port;
+       u16             geneve_udp_port;
+       u8              update_rx_pf_clss;
+       u8              update_tx_pf_clss;
+       u8              update_vxlan_udp_port;
+       u8              update_geneve_udp_port;
+       u8              tunn_clss_vxlan;
+       u8              tunn_clss_l2geneve;
+       u8              tunn_clss_ipgeneve;
+       u8              tunn_clss_l2gre;
+       u8              tunn_clss_ipgre;
+};
+
 /* The PCI personality is not quite synonymous to protocol ID:
  * 1. All personalities need CORE connections
  * 2. The Ethernet personality may support also the RoCE protocol
@@ -105,6 +152,7 @@ enum QED_RESOURCES {
 
 enum QED_FEATURE {
        QED_PF_L2_QUE,
+       QED_VF,
        QED_MAX_FEATURES,
 };
 
@@ -192,6 +240,12 @@ struct qed_dmae_info {
        struct dmae_cmd *p_dmae_cmd;
 };
 
+struct qed_wfq_data {
+       /* when feature is configured for at least 1 vport */
+       u32     min_speed;
+       bool    configured;
+};
+
 struct qed_qm_info {
        struct init_qm_pq_params        *qm_pq_params;
        struct init_qm_vport_params     *qm_vport_params;
@@ -212,6 +266,7 @@ struct qed_qm_info {
        bool                            vport_wfq_en;
        u8                              pf_wfq;
        u32                             pf_rl;
+       struct qed_wfq_data             *wfq_data;
 };
 
 struct storm_stats {
@@ -306,6 +361,7 @@ struct qed_hwfn {
        /* True if the driver requests for the link */
        bool                            b_drv_link_init;
 
+       struct qed_pf_iov               *pf_iov_info;
        struct qed_mcp_info             *mcp_info;
 
        struct qed_hw_cid_data          *p_tx_cids;
@@ -430,6 +486,11 @@ struct qed_dev {
        u8                              num_hwfns;
        struct qed_hwfn                 hwfns[MAX_HWFNS_PER_DEVICE];
 
+       /* SRIOV */
+       struct qed_hw_sriov_info *p_iov_info;
+#define IS_QED_SRIOV(cdev)              (!!(cdev)->p_iov_info)
+
+       unsigned long                   tunn_mode;
        u32                             drv_type;
 
        struct qed_eth_stats            *reset_stats;
@@ -459,6 +520,7 @@ struct qed_dev {
        const struct firmware           *firmware;
 };
 
+#define NUM_OF_VFS(dev)         MAX_NUM_VFS_BB
 #define NUM_OF_SBS(dev)         MAX_SB_PER_PATH_BB
 #define NUM_OF_ENG_PFS(dev)     MAX_NUM_PFS_BB
 
@@ -480,6 +542,8 @@ static inline u8 qed_concrete_to_sw_fid(struct qed_dev *cdev,
 
 #define PURE_LB_TC 8
 
+void qed_configure_vp_wfq_on_link_change(struct qed_dev *cdev, u32 min_pf_rate);
+
 #define QED_LEADING_HWFN(dev)   (&dev->hwfns[0])
 
 /* Other Linux specific common definitions */
@@ -507,6 +571,4 @@ u32 qed_unzip_data(struct qed_hwfn *p_hwfn,
 
 int qed_slowpath_irq_req(struct qed_hwfn *hwfn);
 
-#define QED_ETH_INTERFACE_VERSION       300
-
 #endif /* _QED_H */