fm10k/base: document ITR scale workaround
[dpdk.git] / drivers / net / fm10k / base / fm10k_type.h
index c3f1c63..4ec18fb 100644 (file)
@@ -43,6 +43,12 @@ struct fm10k_hw;
 #define FM10K_INTEL_VENDOR_ID          0x8086
 #define FM10K_DEV_ID_PF                        0x15A4
 #define FM10K_DEV_ID_VF                        0x15A5
+#ifdef BOULDER_RAPIDS_HW
+#define FM10K_DEV_ID_SDI_FM10420_QDA2  0x15D0
+#endif /* BOULDER_RAPIDS_HW */
+#ifdef ATWOOD_CHANNEL_HW
+#define FM10K_DEV_ID_SDI_FM10420_DA2   0x15D5
+#endif /* ATWOOD_CHANNEL_HW */
 
 #define FM10K_MAX_QUEUES               256
 #define FM10K_MAX_QUEUES_PF            128
@@ -344,11 +350,20 @@ struct fm10k_hw;
 #define FM10K_TDBAL(_n)                ((0x40 * (_n)) + 0x8000)
 #define FM10K_TDBAH(_n)                ((0x40 * (_n)) + 0x8001)
 #define FM10K_TDLEN(_n)                ((0x40 * (_n)) + 0x8002)
+/* When fist initialized, VFs need to know the Interrupt Throttle Rate (ITR)
+ * scale which is based on the PCIe speed but the speed information in the PCI
+ * configuration space may not be accurate. The PF already knows the ITR scale
+ * but there is no defined method to pass that information from the PF to the
+ * VF. This is accomplished during VF initialization by temporarily co-opting
+ * the yet-to-be-used TDLEN register to have the PF store the ITR shift for
+ * the VF to retrieve before the VF needs to use the TDLEN register for its
+ * intended purpose, i.e. before the Tx resources are allocated.
+ */
 #define FM10K_TDLEN_ITR_SCALE_SHIFT            9
 #define FM10K_TDLEN_ITR_SCALE_MASK             0x00000E00
-#define FM10K_TDLEN_ITR_SCALE_GEN1             4
-#define FM10K_TDLEN_ITR_SCALE_GEN2             2
-#define FM10K_TDLEN_ITR_SCALE_GEN3             1
+#define FM10K_TDLEN_ITR_SCALE_GEN1             2
+#define FM10K_TDLEN_ITR_SCALE_GEN2             1
+#define FM10K_TDLEN_ITR_SCALE_GEN3             0
 #define FM10K_TPH_TXCTRL(_n)   ((0x40 * (_n)) + 0x8003)
 #define FM10K_TPH_TXCTRL_DESC_TPHEN            0x00000020
 #define FM10K_TPH_TXCTRL_DESC_RROEN            0x00000200
@@ -486,7 +501,7 @@ struct fm10k_hw;
 #define FM10K_SW_SYSTIME_CFG_ADJUST_MASK       0xFF000000
 #define FM10K_SW_SYSTIME_ADJUST        0x0224D
 #define FM10K_SW_SYSTIME_ADJUST_MASK           0x3FFFFFFF
-#define FM10K_SW_SYSTIME_ADJUST_DIR_NEGATIVE   0x80000000
+#define FM10K_SW_SYSTIME_ADJUST_DIR_POSITIVE   0x80000000
 #define FM10K_SW_SYSTIME_PULSE(_n)     ((_n) + 0x02252)
 
 #ifndef ETH_ALEN
@@ -675,8 +690,8 @@ struct fm10k_mac_ops {
        s32 (*get_fault)(struct fm10k_hw *, int, struct fm10k_fault *);
        void (*request_lport_map)(struct fm10k_hw *);
        s32 (*adjust_systime)(struct fm10k_hw *, s32 ppb);
+       s32 (*notify_offset)(struct fm10k_hw *, u64 offset);
        u64 (*read_systime)(struct fm10k_hw *);
-       s32 (*request_tx_timestamp_mode)(struct fm10k_hw *, u16, u8);
 };
 
 enum fm10k_mac_type {
@@ -776,7 +791,7 @@ struct fm10k_iov_ops {
        s32 (*set_lport)(struct fm10k_hw *, struct fm10k_vf_info *, u16, u8);
        void (*reset_lport)(struct fm10k_hw *, struct fm10k_vf_info *);
        void (*update_stats)(struct fm10k_hw *, struct fm10k_hw_stats_q *, u16);
-       s32 (*report_timestamp)(struct fm10k_hw *, struct fm10k_vf_info *, u64);
+       void (*notify_offset)(struct fm10k_hw *, struct fm10k_vf_info*, u64);
 };
 
 struct fm10k_iov_info {
@@ -801,6 +816,8 @@ struct fm10k_hw {
        u16 subsystem_device_id;
        u16 subsystem_vendor_id;
        u8 revision_id;
+       u32 flags;
+#define FM10K_HW_FLAG_CLOCK_OWNER      (u32)(1 << 0)
 };
 
 /* Number of Transmit and Receive Descriptors must be a multiple of 8 */