i40e: fix race conditions on queuing skb for HW time stamp
[cascardo/linux.git] / drivers / net / ethernet / intel / i40e / i40e.h
index 9c27d8b..29cd81a 100644 (file)
@@ -72,6 +72,7 @@
 #define I40E_MIN_NUM_DESCRIPTORS      64
 #define I40E_MIN_MSIX                 2
 #define I40E_DEFAULT_NUM_VMDQ_VSI     8 /* max 256 VSIs */
+#define I40E_MIN_VSI_ALLOC            51 /* LAN, ATR, FCOE, 32 VF, 16 VMDQ */
 #define I40E_DEFAULT_QUEUES_PER_VMDQ  2 /* max 16 qps */
 #define I40E_DEFAULT_QUEUES_PER_VF    4
 #define I40E_DEFAULT_QUEUES_PER_TC    1 /* should be a power of 2 */
@@ -83,6 +84,7 @@
 #define I40E_AQ_WORK_LIMIT            16
 #define I40E_MAX_USER_PRIORITY        8
 #define I40E_DEFAULT_MSG_ENABLE       4
+#define I40E_QUEUE_WAIT_RETRY_LIMIT   10
 
 #define I40E_NVM_VERSION_LO_SHIFT  0
 #define I40E_NVM_VERSION_LO_MASK   (0xff << I40E_NVM_VERSION_LO_SHIFT)
@@ -132,7 +134,9 @@ enum i40e_state_t {
        __I40E_EMP_RESET_REQUESTED,
        __I40E_FILTER_OVERFLOW_PROMISC,
        __I40E_SUSPENDED,
+       __I40E_PTP_TX_IN_PROGRESS,
        __I40E_BAD_EEPROM,
+       __I40E_DOWN_REQUESTED,
 };
 
 enum i40e_interrupt_policy {
@@ -151,13 +155,25 @@ struct i40e_lump_tracking {
 #define I40E_DEFAULT_ATR_SAMPLE_RATE   20
 #define I40E_FDIR_MAX_RAW_PACKET_SIZE  512
 #define I40E_FDIR_BUFFER_FULL_MARGIN   10
-#define I40E_FDIR_BUFFER_HEAD_ROOM     200
+#define I40E_FDIR_BUFFER_HEAD_ROOM     32
+
+enum i40e_fd_stat_idx {
+       I40E_FD_STAT_ATR,
+       I40E_FD_STAT_SB,
+       I40E_FD_STAT_PF_COUNT
+};
+#define I40E_FD_STAT_PF_IDX(pf_id) ((pf_id) * I40E_FD_STAT_PF_COUNT)
+#define I40E_FD_ATR_STAT_IDX(pf_id) \
+                       (I40E_FD_STAT_PF_IDX(pf_id) + I40E_FD_STAT_ATR)
+#define I40E_FD_SB_STAT_IDX(pf_id)  \
+                       (I40E_FD_STAT_PF_IDX(pf_id) + I40E_FD_STAT_SB)
 
 struct i40e_fdir_filter {
        struct hlist_node fdir_node;
        /* filter ipnut set */
        u8 flow_type;
        u8 ip4_proto;
+       /* TX packet view of src and dst */
        __be32 dst_ip[4];
        __be32 src_ip[4];
        __be16 src_port;
@@ -201,7 +217,6 @@ struct i40e_pf {
        unsigned long state;
        unsigned long link_check_timeout;
        struct msix_entry *msix_entries;
-       u16 num_msix_entries;
        bool fc_autoneg_status;
 
        u16 eeprom_version;
@@ -216,11 +231,14 @@ struct i40e_pf {
        u16 rss_size;              /* num queues in the RSS array */
        u16 rss_size_max;          /* HW defined max RSS queues */
        u16 fdir_pf_filter_count;  /* num of guaranteed filters for this PF */
+       u16 num_alloc_vsi;         /* num VSIs this driver supports */
        u8 atr_sample_rate;
        bool wol_en;
 
        struct hlist_head fdir_filter_list;
        u16 fdir_pf_active_filters;
+       u16 fd_sb_cnt_idx;
+       u16 fd_atr_cnt_idx;
 
 #ifdef CONFIG_I40E_VXLAN
        __be16  vxlan_ports[I40E_MAX_PF_UDP_OFFLOAD_PORTS];
@@ -262,6 +280,8 @@ struct i40e_pf {
 #ifdef CONFIG_I40E_VXLAN
 #define I40E_FLAG_VXLAN_FILTER_SYNC            (u64)(1 << 27)
 #endif
+#define I40E_FLAG_PORT_ID_VALID                (u64)(1 << 28)
+#define I40E_FLAG_DCB_CAPABLE                  (u64)(1 << 29)
 
        /* tracks features that get auto disabled by errors */
        u64 auto_disable_flags;
@@ -296,7 +316,6 @@ struct i40e_pf {
        u16 pf_seid;
        u16 main_vsi_seid;
        u16 mac_seid;
-       struct i40e_aqc_get_switch_config_data *sw_config;
        struct kobject *switch_kobj;
 #ifdef CONFIG_DEBUG_FS
        struct dentry *i40e_dbg_pf;
@@ -333,6 +352,7 @@ struct i40e_pf {
        u32 rx_hwtstamp_cleared;
        bool ptp_tx;
        bool ptp_rx;
+       u16 rss_table_size;
 };
 
 struct i40e_mac_filter {
@@ -344,6 +364,7 @@ struct i40e_mac_filter {
        bool is_vf;             /* filter belongs to a VF */
        bool is_netdev;         /* filter belongs to a netdev */
        bool changed;           /* filter needs to be sync'd to the HW */
+       bool is_laa;            /* filter is a Locally Administered Address */
 };
 
 struct i40e_veb {
@@ -563,6 +584,7 @@ int i40e_add_del_fdir(struct i40e_vsi *vsi,
                      struct i40e_fdir_filter *input, bool add);
 void i40e_fdir_check_and_reenable(struct i40e_pf *pf);
 int i40e_get_current_fd_count(struct i40e_pf *pf);
+int i40e_get_cur_guaranteed_fd_count(struct i40e_pf *pf);
 bool i40e_set_ntuple(struct i40e_pf *pf, netdev_features_t features);
 void i40e_set_ethtool_ops(struct net_device *netdev);
 struct i40e_mac_filter *i40e_add_filter(struct i40e_vsi *vsi,
@@ -599,6 +621,7 @@ static inline void i40e_dbg_init(void) {}
 static inline void i40e_dbg_exit(void) {}
 #endif /* CONFIG_DEBUG_FS*/
 void i40e_irq_dynamic_enable(struct i40e_vsi *vsi, int vector);
+void i40e_irq_dynamic_disable(struct i40e_vsi *vsi, int vector);
 void i40e_irq_dynamic_disable_icr0(struct i40e_pf *pf);
 void i40e_irq_dynamic_enable_icr0(struct i40e_pf *pf);
 int i40e_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd);