-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathixgbe_ethtool.c
4349 lines (3797 loc) · 122 KB
/
ixgbe_ethtool.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*******************************************************************************
Intel(R) 10GbE PCI Express Linux Network Driver
Copyright(c) 1999 - 2017 Intel Corporation.
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information:
Linux NICS <linux.nics@intel.com>
e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*******************************************************************************/
/* ethtool support for ixgbe */
#include <linux/types.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/netdevice.h>
#include <linux/ethtool.h>
#include <linux/vmalloc.h>
#include <linux/highmem.h>
#ifdef SIOCETHTOOL
#include <asm/uaccess.h>
#include "ixgbe.h"
#ifdef ETHTOOL_GMODULEINFO
#include "ixgbe_phy.h"
#endif
#ifdef HAVE_ETHTOOL_GET_TS_INFO
#include <linux/net_tstamp.h>
#endif
#ifndef ETH_GSTRING_LEN
#define ETH_GSTRING_LEN 32
#endif
#define IXGBE_ALL_RAR_ENTRIES 16
#ifdef ETHTOOL_OPS_COMPAT
#include "kcompat_ethtool.c"
#endif
#ifdef ETHTOOL_GSTATS
struct ixgbe_stats {
char stat_string[ETH_GSTRING_LEN];
int sizeof_stat;
int stat_offset;
};
#define IXGBE_NETDEV_STAT(_net_stat) { \
.stat_string = #_net_stat, \
.sizeof_stat = FIELD_SIZEOF(struct net_device_stats, _net_stat), \
.stat_offset = offsetof(struct net_device_stats, _net_stat) \
}
static const struct ixgbe_stats ixgbe_gstrings_net_stats[] = {
IXGBE_NETDEV_STAT(rx_packets),
IXGBE_NETDEV_STAT(tx_packets),
IXGBE_NETDEV_STAT(rx_bytes),
IXGBE_NETDEV_STAT(tx_bytes),
IXGBE_NETDEV_STAT(rx_errors),
IXGBE_NETDEV_STAT(tx_errors),
IXGBE_NETDEV_STAT(rx_dropped),
IXGBE_NETDEV_STAT(tx_dropped),
IXGBE_NETDEV_STAT(multicast),
IXGBE_NETDEV_STAT(collisions),
IXGBE_NETDEV_STAT(rx_over_errors),
IXGBE_NETDEV_STAT(rx_crc_errors),
IXGBE_NETDEV_STAT(rx_frame_errors),
IXGBE_NETDEV_STAT(rx_fifo_errors),
IXGBE_NETDEV_STAT(rx_missed_errors),
IXGBE_NETDEV_STAT(tx_aborted_errors),
IXGBE_NETDEV_STAT(tx_carrier_errors),
IXGBE_NETDEV_STAT(tx_fifo_errors),
IXGBE_NETDEV_STAT(tx_heartbeat_errors),
};
#define IXGBE_STAT(_name, _stat) { \
.stat_string = _name, \
.sizeof_stat = FIELD_SIZEOF(struct ixgbe_adapter, _stat), \
.stat_offset = offsetof(struct ixgbe_adapter, _stat) \
}
static struct ixgbe_stats ixgbe_gstrings_stats[] = {
IXGBE_STAT("rx_pkts_nic", stats.gprc),
IXGBE_STAT("tx_pkts_nic", stats.gptc),
IXGBE_STAT("rx_bytes_nic", stats.gorc),
IXGBE_STAT("tx_bytes_nic", stats.gotc),
IXGBE_STAT("lsc_int", lsc_int),
IXGBE_STAT("tx_busy", tx_busy),
IXGBE_STAT("non_eop_descs", non_eop_descs),
IXGBE_STAT("broadcast", stats.bprc),
IXGBE_STAT("rx_no_buffer_count", stats.rnbc[0]) ,
IXGBE_STAT("tx_timeout_count", tx_timeout_count),
IXGBE_STAT("tx_restart_queue", restart_queue),
IXGBE_STAT("rx_long_length_errors", stats.roc),
IXGBE_STAT("rx_short_length_errors", stats.ruc),
IXGBE_STAT("tx_flow_control_xon", stats.lxontxc),
IXGBE_STAT("rx_flow_control_xon", stats.lxonrxc),
IXGBE_STAT("tx_flow_control_xoff", stats.lxofftxc),
IXGBE_STAT("rx_flow_control_xoff", stats.lxoffrxc),
IXGBE_STAT("rx_csum_offload_errors", hw_csum_rx_error),
IXGBE_STAT("alloc_rx_page_failed", alloc_rx_page_failed),
IXGBE_STAT("alloc_rx_buff_failed", alloc_rx_buff_failed),
IXGBE_STAT("rx_no_dma_resources", hw_rx_no_dma_resources),
IXGBE_STAT("hw_rsc_aggregated", rsc_total_count),
IXGBE_STAT("hw_rsc_flushed", rsc_total_flush),
#ifdef HAVE_TX_MQ
IXGBE_STAT("fdir_match", stats.fdirmatch),
IXGBE_STAT("fdir_miss", stats.fdirmiss),
IXGBE_STAT("fdir_overflow", fdir_overflow),
#endif /* HAVE_TX_MQ */
#if IS_ENABLED(CONFIG_FCOE)
IXGBE_STAT("fcoe_bad_fccrc", stats.fccrc),
IXGBE_STAT("fcoe_last_errors", stats.fclast),
IXGBE_STAT("rx_fcoe_dropped", stats.fcoerpdc),
IXGBE_STAT("rx_fcoe_packets", stats.fcoeprc),
IXGBE_STAT("rx_fcoe_dwords", stats.fcoedwrc),
IXGBE_STAT("fcoe_noddp", stats.fcoe_noddp),
IXGBE_STAT("fcoe_noddp_ext_buff", stats.fcoe_noddp_ext_buff),
IXGBE_STAT("tx_fcoe_packets", stats.fcoeptc),
IXGBE_STAT("tx_fcoe_dwords", stats.fcoedwtc),
#endif /* CONFIG_FCOE */
IXGBE_STAT("os2bmc_rx_by_bmc", stats.o2bgptc),
IXGBE_STAT("os2bmc_tx_by_bmc", stats.b2ospc),
IXGBE_STAT("os2bmc_tx_by_host", stats.o2bspc),
IXGBE_STAT("os2bmc_rx_by_host", stats.b2ogprc),
#ifdef HAVE_PTP_1588_CLOCK
IXGBE_STAT("tx_hwtstamp_timeouts", tx_hwtstamp_timeouts),
IXGBE_STAT("tx_hwtstamp_skipped", tx_hwtstamp_skipped),
IXGBE_STAT("rx_hwtstamp_cleared", rx_hwtstamp_cleared),
#endif /* HAVE_PTP_1588_CLOCK */
};
/* ixgbe allocates num_tx_queues and num_rx_queues symmetrically so
* we set the num_rx_queues to evaluate to num_tx_queues. This is
* used because we do not have a good way to get the max number of
* rx queues with CONFIG_RPS disabled.
*/
#ifdef HAVE_TX_MQ
#ifdef HAVE_NETDEV_SELECT_QUEUE
#define IXGBE_NUM_RX_QUEUES netdev->num_tx_queues
#define IXGBE_NUM_TX_QUEUES netdev->num_tx_queues
#else
#define IXGBE_NUM_RX_QUEUES adapter->indices
#define IXGBE_NUM_TX_QUEUES adapter->indices
#endif /* HAVE_NETDEV_SELECT_QUEUE */
#else /* HAVE_TX_MQ */
#define IXGBE_NUM_TX_QUEUES 1
#define IXGBE_NUM_RX_QUEUES ( \
((struct ixgbe_adapter *)netdev_priv(netdev))->num_rx_queues)
#endif /* HAVE_TX_MQ */
#define IXGBE_QUEUE_STATS_LEN ( \
(IXGBE_NUM_TX_QUEUES + IXGBE_NUM_RX_QUEUES) * \
(sizeof(struct ixgbe_queue_stats) / sizeof(u64)))
#define IXGBE_GLOBAL_STATS_LEN ARRAY_SIZE(ixgbe_gstrings_stats)
#define IXGBE_NETDEV_STATS_LEN ARRAY_SIZE(ixgbe_gstrings_net_stats)
#define IXGBE_PB_STATS_LEN ( \
(sizeof(((struct ixgbe_adapter *)0)->stats.pxonrxc) + \
sizeof(((struct ixgbe_adapter *)0)->stats.pxontxc) + \
sizeof(((struct ixgbe_adapter *)0)->stats.pxoffrxc) + \
sizeof(((struct ixgbe_adapter *)0)->stats.pxofftxc)) \
/ sizeof(u64))
#define IXGBE_VF_STATS_LEN \
((((struct ixgbe_adapter *)netdev_priv(netdev))->num_vfs) * \
(sizeof(struct vf_stats) / sizeof(u64)))
#define IXGBE_STATS_LEN (IXGBE_GLOBAL_STATS_LEN + \
IXGBE_NETDEV_STATS_LEN + \
IXGBE_PB_STATS_LEN + \
IXGBE_QUEUE_STATS_LEN + \
IXGBE_VF_STATS_LEN)
#endif /* ETHTOOL_GSTATS */
#ifdef ETHTOOL_TEST
static const char ixgbe_gstrings_test[][ETH_GSTRING_LEN] = {
"Register test (offline)", "Eeprom test (offline)",
"Interrupt test (offline)", "Loopback test (offline)",
"Link test (on/offline)"
};
#define IXGBE_TEST_LEN (sizeof(ixgbe_gstrings_test) / ETH_GSTRING_LEN)
#endif /* ETHTOOL_TEST */
#ifdef HAVE_ETHTOOL_GET_SSET_COUNT
static const char ixgbe_priv_flags_strings[][ETH_GSTRING_LEN] = {
#define IXGBE_PRIV_FLAGS_FD_ATR BIT(0)
"flow-director-atr",
#ifdef HAVE_SWIOTLB_SKIP_CPU_SYNC
#define IXGBE_PRIV_FLAGS_LEGACY_RX BIT(1)
"legacy-rx",
#endif
};
#define IXGBE_PRIV_FLAGS_STR_LEN ARRAY_SIZE(ixgbe_priv_flags_strings)
#endif /* HAVE_ETHTOOL_GET_SSET_COUNT */
/* currently supported speeds for 10G */
#define ADVERTISED_MASK_10G (SUPPORTED_10000baseT_Full | SUPPORTED_10000baseKX4_Full | SUPPORTED_10000baseKR_Full)
#define ixgbe_isbackplane(type) ((type == ixgbe_media_type_backplane)? true : false)
static __u32 ixgbe_backplane_type(struct ixgbe_hw *hw)
{
__u32 mode = 0x00;
switch(hw->device_id)
{
case IXGBE_DEV_ID_82598:
case IXGBE_DEV_ID_82599_KX4:
case IXGBE_DEV_ID_82599_KX4_MEZZ:
case IXGBE_DEV_ID_X550EM_X_KX4:
mode = SUPPORTED_10000baseKX4_Full;
break;
case IXGBE_DEV_ID_82598_BX:
case IXGBE_DEV_ID_82599_KR:
case IXGBE_DEV_ID_X550EM_X_KR:
case IXGBE_DEV_ID_X550EM_X_XFI:
mode = SUPPORTED_10000baseKR_Full;
break;
default:
mode = (SUPPORTED_10000baseKX4_Full | SUPPORTED_10000baseKR_Full);
break;
}
return mode;
}
#ifdef HAVE_ETHTOOL_CONVERT_U32_AND_LINK_MODE
static int ixgbe_get_link_ksettings(struct net_device *netdev,
struct ethtool_link_ksettings *cmd)
{
struct ixgbe_adapter *adapter = netdev_priv(netdev);
struct ixgbe_hw *hw = &adapter->hw;
ixgbe_link_speed supported_link;
bool autoneg = false;
u32 supported, advertising;
ethtool_convert_link_mode_to_legacy_u32(&supported,
cmd->link_modes.supported);
hw->mac.ops.get_link_capabilities(hw, &supported_link, &autoneg);
/* set the supported link speeds */
if (supported_link & IXGBE_LINK_SPEED_10GB_FULL)
supported |= (ixgbe_isbackplane(hw->phy.media_type)) ?
ixgbe_backplane_type(hw) :
SUPPORTED_10000baseT_Full;
if (supported_link & IXGBE_LINK_SPEED_1GB_FULL)
supported |= (ixgbe_isbackplane(hw->phy.media_type)) ?
SUPPORTED_1000baseKX_Full :
SUPPORTED_1000baseT_Full;
if (supported_link & IXGBE_LINK_SPEED_100_FULL)
supported |= SUPPORTED_100baseT_Full;
if (supported_link & IXGBE_LINK_SPEED_10_FULL)
supported |= SUPPORTED_10baseT_Full;
/* default advertised speed if phy.autoneg_advertised isn't set */
advertising = supported;
/* set the advertised speeds */
if (hw->phy.autoneg_advertised) {
advertising = 0;
if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_10_FULL)
advertising |= ADVERTISED_10baseT_Full;
if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_100_FULL)
advertising |= ADVERTISED_100baseT_Full;
if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_10GB_FULL)
advertising |= supported & ADVERTISED_MASK_10G;
if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_1GB_FULL) {
if (supported & SUPPORTED_1000baseKX_Full)
advertising |= ADVERTISED_1000baseKX_Full;
else
advertising |= ADVERTISED_1000baseT_Full;
}
} else {
if (hw->phy.multispeed_fiber && !autoneg) {
if (supported_link & IXGBE_LINK_SPEED_10GB_FULL)
advertising = ADVERTISED_10000baseT_Full;
}
}
if (autoneg) {
supported |= SUPPORTED_Autoneg;
advertising |= ADVERTISED_Autoneg;
cmd->base.autoneg = AUTONEG_ENABLE;
} else {
cmd->base.autoneg = AUTONEG_DISABLE;
}
/* Determine the remaining settings based on the PHY type. */
switch (adapter->hw.phy.type) {
case ixgbe_phy_tn:
case ixgbe_phy_aq:
case ixgbe_phy_x550em_ext_t:
case ixgbe_phy_fw:
case ixgbe_phy_cu_unknown:
supported |= SUPPORTED_TP;
advertising |= ADVERTISED_TP;
cmd->base.port = PORT_TP;
break;
case ixgbe_phy_qt:
supported |= SUPPORTED_FIBRE;
advertising |= ADVERTISED_FIBRE;
cmd->base.port = PORT_FIBRE;
break;
case ixgbe_phy_nl:
case ixgbe_phy_sfp_passive_tyco:
case ixgbe_phy_sfp_passive_unknown:
case ixgbe_phy_sfp_ftl:
case ixgbe_phy_sfp_avago:
case ixgbe_phy_sfp_intel:
case ixgbe_phy_sfp_unknown:
case ixgbe_phy_qsfp_passive_unknown:
case ixgbe_phy_qsfp_active_unknown:
case ixgbe_phy_qsfp_intel:
case ixgbe_phy_qsfp_unknown:
switch (adapter->hw.phy.sfp_type) {
/* SFP+ devices, further checking needed */
case ixgbe_sfp_type_da_cu:
case ixgbe_sfp_type_da_cu_core0:
case ixgbe_sfp_type_da_cu_core1:
supported |= SUPPORTED_FIBRE;
advertising |= ADVERTISED_FIBRE;
cmd->base.port = PORT_DA;
break;
case ixgbe_sfp_type_sr:
case ixgbe_sfp_type_lr:
case ixgbe_sfp_type_srlr_core0:
case ixgbe_sfp_type_srlr_core1:
case ixgbe_sfp_type_1g_sx_core0:
case ixgbe_sfp_type_1g_sx_core1:
case ixgbe_sfp_type_1g_lx_core0:
case ixgbe_sfp_type_1g_lx_core1:
supported |= SUPPORTED_FIBRE;
advertising |= ADVERTISED_FIBRE;
cmd->base.port = PORT_FIBRE;
break;
case ixgbe_sfp_type_not_present:
supported |= SUPPORTED_FIBRE;
advertising |= ADVERTISED_FIBRE;
cmd->base.port = PORT_NONE;
break;
case ixgbe_sfp_type_1g_cu_core0:
case ixgbe_sfp_type_1g_cu_core1:
supported |= SUPPORTED_TP;
advertising |= ADVERTISED_TP;
cmd->base.port = PORT_TP;
break;
case ixgbe_sfp_type_unknown:
default:
supported |= SUPPORTED_FIBRE;
advertising |= ADVERTISED_FIBRE;
cmd->base.port = PORT_OTHER;
break;
}
break;
case ixgbe_phy_xaui:
supported |= SUPPORTED_FIBRE;
advertising |= ADVERTISED_FIBRE;
cmd->base.port = PORT_NONE;
break;
case ixgbe_phy_unknown:
case ixgbe_phy_generic:
case ixgbe_phy_sfp_unsupported:
default:
supported |= SUPPORTED_FIBRE;
advertising |= ADVERTISED_FIBRE;
cmd->base.port = PORT_OTHER;
break;
}
/* Indicate pause support */
supported |= SUPPORTED_Pause;
switch (hw->fc.requested_mode) {
case ixgbe_fc_full:
advertising |= ADVERTISED_Pause;
break;
case ixgbe_fc_rx_pause:
advertising |= ADVERTISED_Pause | ADVERTISED_Asym_Pause;
break;
case ixgbe_fc_tx_pause:
advertising |= ADVERTISED_Asym_Pause;
break;
default:
advertising &= ~(ADVERTISED_Pause | ADVERTISED_Asym_Pause);
}
if (netif_carrier_ok(netdev)) {
switch (adapter->link_speed) {
case IXGBE_LINK_SPEED_10GB_FULL:
cmd->base.speed = SPEED_10000;
break;
case IXGBE_LINK_SPEED_5GB_FULL:
cmd->base.speed = SPEED_5000;
break;
#ifdef SUPPORTED_2500baseX_Full
case IXGBE_LINK_SPEED_2_5GB_FULL:
cmd->base.speed = SPEED_2500;
break;
#endif /* SUPPORTED_2500baseX_Full */
case IXGBE_LINK_SPEED_1GB_FULL:
cmd->base.speed = SPEED_1000;
break;
case IXGBE_LINK_SPEED_100_FULL:
cmd->base.speed = SPEED_100;
break;
case IXGBE_LINK_SPEED_10_FULL:
cmd->base.speed = SPEED_10;
break;
default:
break;
}
cmd->base.duplex = DUPLEX_FULL;
} else {
cmd->base.speed = SPEED_UNKNOWN;
cmd->base.duplex = DUPLEX_UNKNOWN;
}
ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.supported,
supported);
ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.advertising,
supported);
return 0;
}
#else /* !HAVE_ETHTOOL_CONVERT_U32_AND_LINK_MODE */
static int ixgbe_get_settings(struct net_device *netdev,
struct ethtool_cmd *ecmd)
{
struct ixgbe_adapter *adapter = netdev_priv(netdev);
struct ixgbe_hw *hw = &adapter->hw;
ixgbe_link_speed supported_link;
bool autoneg = false;
hw->mac.ops.get_link_capabilities(hw, &supported_link, &autoneg);
/* set the supported link speeds */
if (supported_link & IXGBE_LINK_SPEED_10GB_FULL)
ecmd->supported |= (ixgbe_isbackplane(hw->phy.media_type)) ?
ixgbe_backplane_type(hw) :
SUPPORTED_10000baseT_Full;
if (supported_link & IXGBE_LINK_SPEED_1GB_FULL)
ecmd->supported |= (ixgbe_isbackplane(hw->phy.media_type)) ?
SUPPORTED_1000baseKX_Full :
SUPPORTED_1000baseT_Full;
if (supported_link & IXGBE_LINK_SPEED_100_FULL)
ecmd->supported |= SUPPORTED_100baseT_Full;
if (supported_link & IXGBE_LINK_SPEED_10_FULL)
ecmd->supported |= SUPPORTED_10baseT_Full;
/* default advertised speed if phy.autoneg_advertised isn't set */
ecmd->advertising = ecmd->supported;
/* set the advertised speeds */
if (hw->phy.autoneg_advertised) {
ecmd->advertising = 0;
if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_10_FULL)
ecmd->advertising |= ADVERTISED_10baseT_Full;
if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_100_FULL)
ecmd->advertising |= ADVERTISED_100baseT_Full;
if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_10GB_FULL)
ecmd->advertising |= (ecmd->supported & ADVERTISED_MASK_10G);
if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_1GB_FULL) {
if (ecmd->supported & SUPPORTED_1000baseKX_Full)
ecmd->advertising |= ADVERTISED_1000baseKX_Full;
else
ecmd->advertising |= ADVERTISED_1000baseT_Full;
}
} else {
if (hw->phy.multispeed_fiber && !autoneg) {
if (supported_link & IXGBE_LINK_SPEED_10GB_FULL)
ecmd->advertising = ADVERTISED_10000baseT_Full;
}
}
if (autoneg) {
ecmd->supported |= SUPPORTED_Autoneg;
ecmd->advertising |= ADVERTISED_Autoneg;
ecmd->autoneg = AUTONEG_ENABLE;
} else {
ecmd->autoneg = AUTONEG_DISABLE;
}
ecmd->transceiver = XCVR_EXTERNAL;
/* Determine the remaining settings based on the PHY type. */
switch (adapter->hw.phy.type) {
case ixgbe_phy_tn:
case ixgbe_phy_aq:
case ixgbe_phy_x550em_ext_t:
case ixgbe_phy_fw:
case ixgbe_phy_cu_unknown:
ecmd->supported |= SUPPORTED_TP;
ecmd->advertising |= ADVERTISED_TP;
ecmd->port = PORT_TP;
break;
case ixgbe_phy_qt:
ecmd->supported |= SUPPORTED_FIBRE;
ecmd->advertising |= ADVERTISED_FIBRE;
ecmd->port = PORT_FIBRE;
break;
case ixgbe_phy_nl:
case ixgbe_phy_sfp_passive_tyco:
case ixgbe_phy_sfp_passive_unknown:
case ixgbe_phy_sfp_ftl:
case ixgbe_phy_sfp_avago:
case ixgbe_phy_sfp_intel:
case ixgbe_phy_sfp_unknown:
case ixgbe_phy_qsfp_passive_unknown:
case ixgbe_phy_qsfp_active_unknown:
case ixgbe_phy_qsfp_intel:
case ixgbe_phy_qsfp_unknown:
switch (adapter->hw.phy.sfp_type) {
/* SFP+ devices, further checking needed */
case ixgbe_sfp_type_da_cu:
case ixgbe_sfp_type_da_cu_core0:
case ixgbe_sfp_type_da_cu_core1:
ecmd->supported |= SUPPORTED_FIBRE;
ecmd->advertising |= ADVERTISED_FIBRE;
ecmd->port = PORT_DA;
break;
case ixgbe_sfp_type_sr:
case ixgbe_sfp_type_lr:
case ixgbe_sfp_type_srlr_core0:
case ixgbe_sfp_type_srlr_core1:
case ixgbe_sfp_type_1g_sx_core0:
case ixgbe_sfp_type_1g_sx_core1:
case ixgbe_sfp_type_1g_lx_core0:
case ixgbe_sfp_type_1g_lx_core1:
ecmd->supported |= SUPPORTED_FIBRE;
ecmd->advertising |= ADVERTISED_FIBRE;
ecmd->port = PORT_FIBRE;
break;
case ixgbe_sfp_type_not_present:
ecmd->supported |= SUPPORTED_FIBRE;
ecmd->advertising |= ADVERTISED_FIBRE;
ecmd->port = PORT_NONE;
break;
case ixgbe_sfp_type_1g_cu_core0:
case ixgbe_sfp_type_1g_cu_core1:
ecmd->supported |= SUPPORTED_TP;
ecmd->advertising |= ADVERTISED_TP;
ecmd->port = PORT_TP;
break;
case ixgbe_sfp_type_unknown:
default:
ecmd->supported |= SUPPORTED_FIBRE;
ecmd->advertising |= ADVERTISED_FIBRE;
ecmd->port = PORT_OTHER;
break;
}
break;
case ixgbe_phy_xaui:
ecmd->supported |= SUPPORTED_FIBRE;
ecmd->advertising |= ADVERTISED_FIBRE;
ecmd->port = PORT_NONE;
break;
case ixgbe_phy_unknown:
case ixgbe_phy_generic:
case ixgbe_phy_sfp_unsupported:
default:
ecmd->supported |= SUPPORTED_FIBRE;
ecmd->advertising |= ADVERTISED_FIBRE;
ecmd->port = PORT_OTHER;
break;
}
/* Indicate pause support */
ecmd->supported |= SUPPORTED_Pause;
switch (hw->fc.requested_mode) {
case ixgbe_fc_full:
ecmd->advertising |= ADVERTISED_Pause;
break;
case ixgbe_fc_rx_pause:
ecmd->advertising |= ADVERTISED_Pause |
ADVERTISED_Asym_Pause;
break;
case ixgbe_fc_tx_pause:
ecmd->advertising |= ADVERTISED_Asym_Pause;
break;
default:
ecmd->advertising &= ~(ADVERTISED_Pause |
ADVERTISED_Asym_Pause);
}
if (netif_carrier_ok(netdev)) {
switch (adapter->link_speed) {
case IXGBE_LINK_SPEED_10GB_FULL:
ethtool_cmd_speed_set(ecmd, SPEED_10000);
break;
case IXGBE_LINK_SPEED_5GB_FULL:
ethtool_cmd_speed_set(ecmd, SPEED_5000);
break;
#ifdef SUPPORTED_2500baseX_Full
case IXGBE_LINK_SPEED_2_5GB_FULL:
ethtool_cmd_speed_set(ecmd, SPEED_2500);
break;
#endif /* SUPPORTED_2500baseX_Full */
case IXGBE_LINK_SPEED_1GB_FULL:
ethtool_cmd_speed_set(ecmd, SPEED_1000);
break;
case IXGBE_LINK_SPEED_100_FULL:
ethtool_cmd_speed_set(ecmd, SPEED_100);
break;
case IXGBE_LINK_SPEED_10_FULL:
ethtool_cmd_speed_set(ecmd, SPEED_10);
break;
default:
break;
}
ecmd->duplex = DUPLEX_FULL;
} else {
ethtool_cmd_speed_set(ecmd, SPEED_UNKNOWN);
ecmd->duplex = DUPLEX_UNKNOWN;
}
return 0;
}
#endif /* !HAVE_ETHTOOL_CONVERT_U32_AND_LINK_MODE */
#ifdef HAVE_ETHTOOL_CONVERT_U32_AND_LINK_MODE
static int ixgbe_set_link_ksettings(struct net_device *netdev,
const struct ethtool_link_ksettings *cmd)
{
struct ixgbe_adapter *adapter = netdev_priv(netdev);
struct ixgbe_hw *hw = &adapter->hw;
u32 advertised, old;
s32 err = 0;
u32 supported, advertising;
ethtool_convert_link_mode_to_legacy_u32(&supported,
cmd->link_modes.supported);
ethtool_convert_link_mode_to_legacy_u32(&advertising,
cmd->link_modes.advertising);
if ((hw->phy.media_type == ixgbe_media_type_copper) ||
(hw->phy.multispeed_fiber)) {
/*
* this function does not support duplex forcing, but can
* limit the advertising of the adapter to the specified speed
*/
if (advertising & ~supported)
return -EINVAL;
/* only allow one speed at a time if no autoneg */
if (!cmd->base.autoneg && hw->phy.multispeed_fiber) {
if (advertising ==
(ADVERTISED_10000baseT_Full |
ADVERTISED_1000baseT_Full))
return -EINVAL;
}
old = hw->phy.autoneg_advertised;
advertised = 0;
if (advertising & ADVERTISED_10000baseT_Full)
advertised |= IXGBE_LINK_SPEED_10GB_FULL;
if (advertising & ADVERTISED_1000baseT_Full)
advertised |= IXGBE_LINK_SPEED_1GB_FULL;
if (advertising & ADVERTISED_100baseT_Full)
advertised |= IXGBE_LINK_SPEED_100_FULL;
if (advertising & ADVERTISED_10baseT_Full)
advertised |= IXGBE_LINK_SPEED_10_FULL;
if (old == advertised)
return err;
/* this sets the link speed and restarts auto-neg */
while (test_and_set_bit(__IXGBE_IN_SFP_INIT, &adapter->state))
usleep_range(1000, 2000);
hw->mac.autotry_restart = true;
err = hw->mac.ops.setup_link(hw, advertised, true);
if (err) {
e_info(probe, "setup link failed with code %d\n", err);
hw->mac.ops.setup_link(hw, old, true);
}
clear_bit(__IXGBE_IN_SFP_INIT, &adapter->state);
} else {
/* in this case we currently only support 10Gb/FULL */
u32 speed = cmd->base.speed;
if ((cmd->base.autoneg == AUTONEG_ENABLE) ||
(advertising != ADVERTISED_10000baseT_Full) ||
(speed + cmd->base.duplex != SPEED_10000 + DUPLEX_FULL))
return -EINVAL;
}
return err;
}
#else /* !HAVE_ETHTOOL_CONVERT_U32_AND_LINK_MODE */
static int ixgbe_set_settings(struct net_device *netdev,
struct ethtool_cmd *ecmd)
{
struct ixgbe_adapter *adapter = netdev_priv(netdev);
struct ixgbe_hw *hw = &adapter->hw;
u32 advertised, old;
s32 err = 0;
if ((hw->phy.media_type == ixgbe_media_type_copper) ||
(hw->phy.multispeed_fiber)) {
/*
* this function does not support duplex forcing, but can
* limit the advertising of the adapter to the specified speed
*/
if (ecmd->advertising & ~ecmd->supported)
return -EINVAL;
/* only allow one speed at a time if no autoneg */
if (!ecmd->autoneg && hw->phy.multispeed_fiber) {
if (ecmd->advertising ==
(ADVERTISED_10000baseT_Full |
ADVERTISED_1000baseT_Full))
return -EINVAL;
}
old = hw->phy.autoneg_advertised;
advertised = 0;
if (ecmd->advertising & ADVERTISED_10000baseT_Full)
advertised |= IXGBE_LINK_SPEED_10GB_FULL;
if (ecmd->advertising & ADVERTISED_1000baseT_Full)
advertised |= IXGBE_LINK_SPEED_1GB_FULL;
if (ecmd->advertising & ADVERTISED_100baseT_Full)
advertised |= IXGBE_LINK_SPEED_100_FULL;
if (ecmd->advertising & ADVERTISED_10baseT_Full)
advertised |= IXGBE_LINK_SPEED_10_FULL;
if (old == advertised)
return err;
/* this sets the link speed and restarts auto-neg */
while (test_and_set_bit(__IXGBE_IN_SFP_INIT, &adapter->state))
usleep_range(1000, 2000);
hw->mac.autotry_restart = true;
err = hw->mac.ops.setup_link(hw, advertised, true);
if (err) {
e_info(probe, "setup link failed with code %d\n", err);
hw->mac.ops.setup_link(hw, old, true);
}
clear_bit(__IXGBE_IN_SFP_INIT, &adapter->state);
}
else {
/* in this case we currently only support 10Gb/FULL */
u32 speed = ethtool_cmd_speed(ecmd);
if ((ecmd->autoneg == AUTONEG_ENABLE) ||
(ecmd->advertising != ADVERTISED_10000baseT_Full) ||
(speed + ecmd->duplex != SPEED_10000 + DUPLEX_FULL))
return -EINVAL;
}
return err;
}
#endif /* !HAVE_ETHTOOL_CONVERT_U32_AND_LINK_MODE */
static void ixgbe_get_pauseparam(struct net_device *netdev,
struct ethtool_pauseparam *pause)
{
struct ixgbe_adapter *adapter = netdev_priv(netdev);
struct ixgbe_hw *hw = &adapter->hw;
if (ixgbe_device_supports_autoneg_fc(hw) &&
!hw->fc.disable_fc_autoneg)
pause->autoneg = 1;
else
pause->autoneg = 0;
if (hw->fc.current_mode == ixgbe_fc_rx_pause) {
pause->rx_pause = 1;
} else if (hw->fc.current_mode == ixgbe_fc_tx_pause) {
pause->tx_pause = 1;
} else if (hw->fc.current_mode == ixgbe_fc_full) {
pause->rx_pause = 1;
pause->tx_pause = 1;
}
}
static int ixgbe_set_pauseparam(struct net_device *netdev,
struct ethtool_pauseparam *pause)
{
struct ixgbe_adapter *adapter = netdev_priv(netdev);
struct ixgbe_hw *hw = &adapter->hw;
struct ixgbe_fc_info fc = hw->fc;
/* 82598 does no support link flow control with DCB enabled */
if ((hw->mac.type == ixgbe_mac_82598EB) &&
(adapter->flags & IXGBE_FLAG_DCB_ENABLED))
return -EINVAL;
/* some devices do not support autoneg of flow control */
if ((pause->autoneg == AUTONEG_ENABLE) &&
!ixgbe_device_supports_autoneg_fc(hw))
return -EINVAL;
fc.disable_fc_autoneg = (pause->autoneg != AUTONEG_ENABLE);
if ((pause->rx_pause && pause->tx_pause) || pause->autoneg)
fc.requested_mode = ixgbe_fc_full;
else if (pause->rx_pause)
fc.requested_mode = ixgbe_fc_rx_pause;
else if (pause->tx_pause)
fc.requested_mode = ixgbe_fc_tx_pause;
else
fc.requested_mode = ixgbe_fc_none;
/* if the thing changed then we'll update and use new autoneg */
if (memcmp(&fc, &hw->fc, sizeof(struct ixgbe_fc_info))) {
hw->fc = fc;
if (netif_running(netdev))
ixgbe_reinit_locked(adapter);
else
ixgbe_reset(adapter);
}
return 0;
}
static u32 ixgbe_get_msglevel(struct net_device *netdev)
{
struct ixgbe_adapter *adapter = netdev_priv(netdev);
return adapter->msg_enable;
}
static void ixgbe_set_msglevel(struct net_device *netdev, u32 data)
{
struct ixgbe_adapter *adapter = netdev_priv(netdev);
adapter->msg_enable = data;
}
static int ixgbe_get_regs_len(struct net_device __always_unused *netdev)
{
#define IXGBE_REGS_LEN 1129
return IXGBE_REGS_LEN * sizeof(u32);
}
#define IXGBE_GET_STAT(_A_, _R_) (_A_->stats._R_)
static void ixgbe_get_regs(struct net_device *netdev, struct ethtool_regs *regs,
void *p)
{
struct ixgbe_adapter *adapter = netdev_priv(netdev);
struct ixgbe_hw *hw = &adapter->hw;
u32 *regs_buff = p;
u8 i;
memset(p, 0, IXGBE_REGS_LEN * sizeof(u32));
regs->version = hw->mac.type << 24 | hw->revision_id << 16 |
hw->device_id;
/* General Registers */
regs_buff[0] = IXGBE_R32_Q(hw, IXGBE_CTRL);
regs_buff[1] = IXGBE_R32_Q(hw, IXGBE_STATUS);
regs_buff[2] = IXGBE_R32_Q(hw, IXGBE_CTRL_EXT);
regs_buff[3] = IXGBE_R32_Q(hw, IXGBE_ESDP);
regs_buff[4] = IXGBE_R32_Q(hw, IXGBE_EODSDP);
regs_buff[5] = IXGBE_R32_Q(hw, IXGBE_LEDCTL);
regs_buff[6] = IXGBE_R32_Q(hw, IXGBE_FRTIMER);
regs_buff[7] = IXGBE_R32_Q(hw, IXGBE_TCPTIMER);
/* NVM Register */
regs_buff[8] = IXGBE_R32_Q(hw, IXGBE_EEC);
regs_buff[9] = IXGBE_R32_Q(hw, IXGBE_EERD);
regs_buff[10] = IXGBE_R32_Q(hw, IXGBE_FLA);
regs_buff[11] = IXGBE_R32_Q(hw, IXGBE_EEMNGCTL);
regs_buff[12] = IXGBE_R32_Q(hw, IXGBE_EEMNGDATA);
regs_buff[13] = IXGBE_R32_Q(hw, IXGBE_FLMNGCTL);
regs_buff[14] = IXGBE_R32_Q(hw, IXGBE_FLMNGDATA);
regs_buff[15] = IXGBE_R32_Q(hw, IXGBE_FLMNGCNT);
regs_buff[16] = IXGBE_R32_Q(hw, IXGBE_FLOP);
regs_buff[17] = IXGBE_R32_Q(hw, IXGBE_GRC);
/* Interrupt */
/* don't read EICR because it can clear interrupt causes, instead
* read EICS which is a shadow but doesn't clear EICR */
regs_buff[18] = IXGBE_R32_Q(hw, IXGBE_EICS);
regs_buff[19] = IXGBE_R32_Q(hw, IXGBE_EICS);
regs_buff[20] = IXGBE_R32_Q(hw, IXGBE_EIMS);
regs_buff[21] = IXGBE_R32_Q(hw, IXGBE_EIMC);
regs_buff[22] = IXGBE_R32_Q(hw, IXGBE_EIAC);
regs_buff[23] = IXGBE_R32_Q(hw, IXGBE_EIAM);
regs_buff[24] = IXGBE_R32_Q(hw, IXGBE_EITR(0));
regs_buff[25] = IXGBE_R32_Q(hw, IXGBE_IVAR(0));
regs_buff[26] = IXGBE_R32_Q(hw, IXGBE_MSIXT);
regs_buff[27] = IXGBE_R32_Q(hw, IXGBE_MSIXPBA);
regs_buff[28] = IXGBE_R32_Q(hw, IXGBE_PBACL(0));
regs_buff[29] = IXGBE_R32_Q(hw, IXGBE_GPIE);
/* Flow Control */
regs_buff[30] = IXGBE_R32_Q(hw, IXGBE_PFCTOP);
regs_buff[31] = IXGBE_R32_Q(hw, IXGBE_FCTTV(0));
regs_buff[32] = IXGBE_R32_Q(hw, IXGBE_FCTTV(1));
regs_buff[33] = IXGBE_R32_Q(hw, IXGBE_FCTTV(2));
regs_buff[34] = IXGBE_R32_Q(hw, IXGBE_FCTTV(3));
for (i = 0; i < 8; i++) {
switch (hw->mac.type) {
case ixgbe_mac_82598EB:
regs_buff[35 + i] = IXGBE_R32_Q(hw, IXGBE_FCRTL(i));
regs_buff[43 + i] = IXGBE_R32_Q(hw, IXGBE_FCRTH(i));
break;
case ixgbe_mac_82599EB:
case ixgbe_mac_X540:
case ixgbe_mac_X550:
case ixgbe_mac_X550EM_x:
regs_buff[35 + i] = IXGBE_R32_Q(hw,
IXGBE_FCRTL_82599(i));
regs_buff[43 + i] = IXGBE_R32_Q(hw,
IXGBE_FCRTH_82599(i));
break;
default:
break;
}
}
regs_buff[51] = IXGBE_R32_Q(hw, IXGBE_FCRTV);
regs_buff[52] = IXGBE_R32_Q(hw, IXGBE_TFCS);
/* Receive DMA */
for (i = 0; i < 64; i++)
regs_buff[53 + i] = IXGBE_R32_Q(hw, IXGBE_RDBAL(i));
for (i = 0; i < 64; i++)
regs_buff[117 + i] = IXGBE_R32_Q(hw, IXGBE_RDBAH(i));
for (i = 0; i < 64; i++)
regs_buff[181 + i] = IXGBE_R32_Q(hw, IXGBE_RDLEN(i));
for (i = 0; i < 64; i++)
regs_buff[245 + i] = IXGBE_R32_Q(hw, IXGBE_RDH(i));
for (i = 0; i < 64; i++)
regs_buff[309 + i] = IXGBE_R32_Q(hw, IXGBE_RDT(i));
for (i = 0; i < 64; i++)
regs_buff[373 + i] = IXGBE_R32_Q(hw, IXGBE_RXDCTL(i));
for (i = 0; i < 16; i++)
regs_buff[437 + i] = IXGBE_R32_Q(hw, IXGBE_SRRCTL(i));
for (i = 0; i < 16; i++)
regs_buff[453 + i] = IXGBE_R32_Q(hw, IXGBE_DCA_RXCTRL(i));
regs_buff[469] = IXGBE_R32_Q(hw, IXGBE_RDRXCTL);
for (i = 0; i < 8; i++)
regs_buff[470 + i] = IXGBE_R32_Q(hw, IXGBE_RXPBSIZE(i));
regs_buff[478] = IXGBE_R32_Q(hw, IXGBE_RXCTRL);
regs_buff[479] = IXGBE_R32_Q(hw, IXGBE_DROPEN);
/* Receive */
regs_buff[480] = IXGBE_R32_Q(hw, IXGBE_RXCSUM);
regs_buff[481] = IXGBE_R32_Q(hw, IXGBE_RFCTL);
for (i = 0; i < 16; i++)
regs_buff[482 + i] = IXGBE_R32_Q(hw, IXGBE_RAL(i));
for (i = 0; i < 16; i++)
regs_buff[498 + i] = IXGBE_R32_Q(hw, IXGBE_RAH(i));
regs_buff[514] = IXGBE_R32_Q(hw, IXGBE_PSRTYPE(0));
regs_buff[515] = IXGBE_R32_Q(hw, IXGBE_FCTRL);
regs_buff[516] = IXGBE_R32_Q(hw, IXGBE_VLNCTRL);
regs_buff[517] = IXGBE_R32_Q(hw, IXGBE_MCSTCTRL);
regs_buff[518] = IXGBE_R32_Q(hw, IXGBE_MRQC);
regs_buff[519] = IXGBE_R32_Q(hw, IXGBE_VMD_CTL);
for (i = 0; i < 8; i++)
regs_buff[520 + i] = IXGBE_R32_Q(hw, IXGBE_IMIR(i));
for (i = 0; i < 8; i++)
regs_buff[528 + i] = IXGBE_R32_Q(hw, IXGBE_IMIREXT(i));
regs_buff[536] = IXGBE_R32_Q(hw, IXGBE_IMIRVP);
/* Transmit */
for (i = 0; i < 32; i++)
regs_buff[537 + i] = IXGBE_R32_Q(hw, IXGBE_TDBAL(i));
for (i = 0; i < 32; i++)
regs_buff[569 + i] = IXGBE_R32_Q(hw, IXGBE_TDBAH(i));
for (i = 0; i < 32; i++)
regs_buff[601 + i] = IXGBE_R32_Q(hw, IXGBE_TDLEN(i));
for (i = 0; i < 32; i++)
regs_buff[633 + i] = IXGBE_R32_Q(hw, IXGBE_TDH(i));
for (i = 0; i < 32; i++)
regs_buff[665 + i] = IXGBE_R32_Q(hw, IXGBE_TDT(i));
for (i = 0; i < 32; i++)
regs_buff[697 + i] = IXGBE_R32_Q(hw, IXGBE_TXDCTL(i));
for (i = 0; i < 32; i++)
regs_buff[729 + i] = IXGBE_R32_Q(hw, IXGBE_TDWBAL(i));
for (i = 0; i < 32; i++)
regs_buff[761 + i] = IXGBE_R32_Q(hw, IXGBE_TDWBAH(i));
regs_buff[793] = IXGBE_R32_Q(hw, IXGBE_DTXCTL);
for (i = 0; i < 16; i++)
regs_buff[794 + i] = IXGBE_R32_Q(hw, IXGBE_DCA_TXCTRL(i));
regs_buff[810] = IXGBE_R32_Q(hw, IXGBE_TIPG);
for (i = 0; i < 8; i++)
regs_buff[811 + i] = IXGBE_R32_Q(hw, IXGBE_TXPBSIZE(i));
regs_buff[819] = IXGBE_R32_Q(hw, IXGBE_MNGTXMAP);
/* Wake Up */
regs_buff[820] = IXGBE_R32_Q(hw, IXGBE_WUC);