.. | .. |
---|
13 | 13 | #include <linux/ptp_clock_kernel.h> |
---|
14 | 14 | #include <linux/timecounter.h> |
---|
15 | 15 | #include <linux/net_tstamp.h> |
---|
| 16 | +#include <linux/bitfield.h> |
---|
16 | 17 | |
---|
17 | 18 | #include "igc_hw.h" |
---|
18 | 19 | |
---|
.. | .. |
---|
87 | 88 | u8 queue_index; /* logical index of the ring*/ |
---|
88 | 89 | u8 reg_idx; /* physical index of the ring */ |
---|
89 | 90 | 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 */ |
---|
90 | 93 | |
---|
91 | 94 | u32 start_time; |
---|
92 | 95 | u32 end_time; |
---|
.. | .. |
---|
207 | 210 | struct ptp_clock *ptp_clock; |
---|
208 | 211 | struct ptp_clock_info ptp_caps; |
---|
209 | 212 | 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; |
---|
210 | 217 | struct sk_buff *ptp_tx_skb; |
---|
211 | 218 | struct hwtstamp_config tstamp_config; |
---|
212 | 219 | unsigned long ptp_tx_start; |
---|
.. | .. |
---|
270 | 277 | #define IGC_MRQC_RSS_FIELD_IPV4_UDP 0x00400000 |
---|
271 | 278 | #define IGC_MRQC_RSS_FIELD_IPV6_UDP 0x00800000 |
---|
272 | 279 | |
---|
| 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 | + |
---|
273 | 307 | /* Interrupt defines */ |
---|
274 | 308 | #define IGC_START_ITR 648 /* ~6000 ints/sec */ |
---|
275 | 309 | #define IGC_4K_ITR 980 |
---|
.. | .. |
---|
285 | 319 | /* TX/RX descriptor defines */ |
---|
286 | 320 | #define IGC_DEFAULT_TXD 256 |
---|
287 | 321 | #define IGC_DEFAULT_TX_WORK 128 |
---|
288 | | -#define IGC_MIN_TXD 80 |
---|
| 322 | +#define IGC_MIN_TXD 64 |
---|
289 | 323 | #define IGC_MAX_TXD 4096 |
---|
290 | 324 | |
---|
291 | 325 | #define IGC_DEFAULT_RXD 256 |
---|
292 | | -#define IGC_MIN_RXD 80 |
---|
| 326 | +#define IGC_MIN_RXD 64 |
---|
293 | 327 | #define IGC_MAX_RXD 4096 |
---|
294 | 328 | |
---|
295 | 329 | /* Supported Rx Buffer Sizes */ |
---|
.. | .. |
---|
359 | 393 | __IGC_TESTING, |
---|
360 | 394 | __IGC_RESETTING, |
---|
361 | 395 | __IGC_DOWN, |
---|
362 | | - __IGC_PTP_TX_IN_PROGRESS, |
---|
363 | 396 | }; |
---|
364 | 397 | |
---|
365 | 398 | enum igc_tx_flags { |
---|