hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/net/ethernet/intel/igc/igc.h
....@@ -13,6 +13,7 @@
1313 #include <linux/ptp_clock_kernel.h>
1414 #include <linux/timecounter.h>
1515 #include <linux/net_tstamp.h>
16
+#include <linux/bitfield.h>
1617
1718 #include "igc_hw.h"
1819
....@@ -87,6 +88,8 @@
8788 u8 queue_index; /* logical index of the ring*/
8889 u8 reg_idx; /* physical index of the ring */
8990 bool launchtime_enable; /* true if LaunchTime is enabled */
91
+ ktime_t last_tx_cycle; /* end of the cycle with a launchtime transmission */
92
+ ktime_t last_ff_cycle; /* Last cycle with an active first flag */
9093
9194 u32 start_time;
9295 u32 end_time;
....@@ -207,6 +210,10 @@
207210 struct ptp_clock *ptp_clock;
208211 struct ptp_clock_info ptp_caps;
209212 struct work_struct ptp_tx_work;
213
+ /* Access to ptp_tx_skb and ptp_tx_start are protected by the
214
+ * ptp_tx_lock.
215
+ */
216
+ spinlock_t ptp_tx_lock;
210217 struct sk_buff *ptp_tx_skb;
211218 struct hwtstamp_config tstamp_config;
212219 unsigned long ptp_tx_start;
....@@ -270,6 +277,33 @@
270277 #define IGC_MRQC_RSS_FIELD_IPV4_UDP 0x00400000
271278 #define IGC_MRQC_RSS_FIELD_IPV6_UDP 0x00800000
272279
280
+/* RX-desc Write-Back format RSS Type's */
281
+enum igc_rss_type_num {
282
+ IGC_RSS_TYPE_NO_HASH = 0,
283
+ IGC_RSS_TYPE_HASH_TCP_IPV4 = 1,
284
+ IGC_RSS_TYPE_HASH_IPV4 = 2,
285
+ IGC_RSS_TYPE_HASH_TCP_IPV6 = 3,
286
+ IGC_RSS_TYPE_HASH_IPV6_EX = 4,
287
+ IGC_RSS_TYPE_HASH_IPV6 = 5,
288
+ IGC_RSS_TYPE_HASH_TCP_IPV6_EX = 6,
289
+ IGC_RSS_TYPE_HASH_UDP_IPV4 = 7,
290
+ IGC_RSS_TYPE_HASH_UDP_IPV6 = 8,
291
+ IGC_RSS_TYPE_HASH_UDP_IPV6_EX = 9,
292
+ IGC_RSS_TYPE_MAX = 10,
293
+};
294
+#define IGC_RSS_TYPE_MAX_TABLE 16
295
+#define IGC_RSS_TYPE_MASK GENMASK(3,0) /* 4-bits (3:0) = mask 0x0F */
296
+
297
+/* igc_rss_type - Rx descriptor RSS type field */
298
+static inline u32 igc_rss_type(const union igc_adv_rx_desc *rx_desc)
299
+{
300
+ /* RSS Type 4-bits (3:0) number: 0-9 (above 9 is reserved)
301
+ * Accessing the same bits via u16 (wb.lower.lo_dword.hs_rss.pkt_info)
302
+ * is slightly slower than via u32 (wb.lower.lo_dword.data)
303
+ */
304
+ return le32_get_bits(rx_desc->wb.lower.lo_dword.data, IGC_RSS_TYPE_MASK);
305
+}
306
+
273307 /* Interrupt defines */
274308 #define IGC_START_ITR 648 /* ~6000 ints/sec */
275309 #define IGC_4K_ITR 980
....@@ -285,11 +319,11 @@
285319 /* TX/RX descriptor defines */
286320 #define IGC_DEFAULT_TXD 256
287321 #define IGC_DEFAULT_TX_WORK 128
288
-#define IGC_MIN_TXD 80
322
+#define IGC_MIN_TXD 64
289323 #define IGC_MAX_TXD 4096
290324
291325 #define IGC_DEFAULT_RXD 256
292
-#define IGC_MIN_RXD 80
326
+#define IGC_MIN_RXD 64
293327 #define IGC_MAX_RXD 4096
294328
295329 /* Supported Rx Buffer Sizes */
....@@ -359,7 +393,6 @@
359393 __IGC_TESTING,
360394 __IGC_RESETTING,
361395 __IGC_DOWN,
362
- __IGC_PTP_TX_IN_PROGRESS,
363396 };
364397
365398 enum igc_tx_flags {