ethtool.c 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095
  1. /****************************************************************************
  2. * Driver for Solarflare Solarstorm network controllers and boards
  3. * Copyright 2005-2006 Fen Systems Ltd.
  4. * Copyright 2006-2009 Solarflare Communications Inc.
  5. *
  6. * This program is free software; you can redistribute it and/or modify it
  7. * under the terms of the GNU General Public License version 2 as published
  8. * by the Free Software Foundation, incorporated herein by reference.
  9. */
  10. #include <linux/netdevice.h>
  11. #include <linux/ethtool.h>
  12. #include <linux/rtnetlink.h>
  13. #include "net_driver.h"
  14. #include "workarounds.h"
  15. #include "selftest.h"
  16. #include "efx.h"
  17. #include "filter.h"
  18. #include "nic.h"
  19. struct ethtool_string {
  20. char name[ETH_GSTRING_LEN];
  21. };
  22. struct efx_ethtool_stat {
  23. const char *name;
  24. enum {
  25. EFX_ETHTOOL_STAT_SOURCE_mac_stats,
  26. EFX_ETHTOOL_STAT_SOURCE_nic,
  27. EFX_ETHTOOL_STAT_SOURCE_channel
  28. } source;
  29. unsigned offset;
  30. u64(*get_stat) (void *field); /* Reader function */
  31. };
  32. /* Initialiser for a struct #efx_ethtool_stat with type-checking */
  33. #define EFX_ETHTOOL_STAT(stat_name, source_name, field, field_type, \
  34. get_stat_function) { \
  35. .name = #stat_name, \
  36. .source = EFX_ETHTOOL_STAT_SOURCE_##source_name, \
  37. .offset = ((((field_type *) 0) == \
  38. &((struct efx_##source_name *)0)->field) ? \
  39. offsetof(struct efx_##source_name, field) : \
  40. offsetof(struct efx_##source_name, field)), \
  41. .get_stat = get_stat_function, \
  42. }
  43. static u64 efx_get_uint_stat(void *field)
  44. {
  45. return *(unsigned int *)field;
  46. }
  47. static u64 efx_get_ulong_stat(void *field)
  48. {
  49. return *(unsigned long *)field;
  50. }
  51. static u64 efx_get_u64_stat(void *field)
  52. {
  53. return *(u64 *) field;
  54. }
  55. static u64 efx_get_atomic_stat(void *field)
  56. {
  57. return atomic_read((atomic_t *) field);
  58. }
  59. #define EFX_ETHTOOL_ULONG_MAC_STAT(field) \
  60. EFX_ETHTOOL_STAT(field, mac_stats, field, \
  61. unsigned long, efx_get_ulong_stat)
  62. #define EFX_ETHTOOL_U64_MAC_STAT(field) \
  63. EFX_ETHTOOL_STAT(field, mac_stats, field, \
  64. u64, efx_get_u64_stat)
  65. #define EFX_ETHTOOL_UINT_NIC_STAT(name) \
  66. EFX_ETHTOOL_STAT(name, nic, n_##name, \
  67. unsigned int, efx_get_uint_stat)
  68. #define EFX_ETHTOOL_ATOMIC_NIC_ERROR_STAT(field) \
  69. EFX_ETHTOOL_STAT(field, nic, field, \
  70. atomic_t, efx_get_atomic_stat)
  71. #define EFX_ETHTOOL_UINT_CHANNEL_STAT(field) \
  72. EFX_ETHTOOL_STAT(field, channel, n_##field, \
  73. unsigned int, efx_get_uint_stat)
  74. static struct efx_ethtool_stat efx_ethtool_stats[] = {
  75. EFX_ETHTOOL_U64_MAC_STAT(tx_bytes),
  76. EFX_ETHTOOL_U64_MAC_STAT(tx_good_bytes),
  77. EFX_ETHTOOL_U64_MAC_STAT(tx_bad_bytes),
  78. EFX_ETHTOOL_ULONG_MAC_STAT(tx_packets),
  79. EFX_ETHTOOL_ULONG_MAC_STAT(tx_bad),
  80. EFX_ETHTOOL_ULONG_MAC_STAT(tx_pause),
  81. EFX_ETHTOOL_ULONG_MAC_STAT(tx_control),
  82. EFX_ETHTOOL_ULONG_MAC_STAT(tx_unicast),
  83. EFX_ETHTOOL_ULONG_MAC_STAT(tx_multicast),
  84. EFX_ETHTOOL_ULONG_MAC_STAT(tx_broadcast),
  85. EFX_ETHTOOL_ULONG_MAC_STAT(tx_lt64),
  86. EFX_ETHTOOL_ULONG_MAC_STAT(tx_64),
  87. EFX_ETHTOOL_ULONG_MAC_STAT(tx_65_to_127),
  88. EFX_ETHTOOL_ULONG_MAC_STAT(tx_128_to_255),
  89. EFX_ETHTOOL_ULONG_MAC_STAT(tx_256_to_511),
  90. EFX_ETHTOOL_ULONG_MAC_STAT(tx_512_to_1023),
  91. EFX_ETHTOOL_ULONG_MAC_STAT(tx_1024_to_15xx),
  92. EFX_ETHTOOL_ULONG_MAC_STAT(tx_15xx_to_jumbo),
  93. EFX_ETHTOOL_ULONG_MAC_STAT(tx_gtjumbo),
  94. EFX_ETHTOOL_ULONG_MAC_STAT(tx_collision),
  95. EFX_ETHTOOL_ULONG_MAC_STAT(tx_single_collision),
  96. EFX_ETHTOOL_ULONG_MAC_STAT(tx_multiple_collision),
  97. EFX_ETHTOOL_ULONG_MAC_STAT(tx_excessive_collision),
  98. EFX_ETHTOOL_ULONG_MAC_STAT(tx_deferred),
  99. EFX_ETHTOOL_ULONG_MAC_STAT(tx_late_collision),
  100. EFX_ETHTOOL_ULONG_MAC_STAT(tx_excessive_deferred),
  101. EFX_ETHTOOL_ULONG_MAC_STAT(tx_non_tcpudp),
  102. EFX_ETHTOOL_ULONG_MAC_STAT(tx_mac_src_error),
  103. EFX_ETHTOOL_ULONG_MAC_STAT(tx_ip_src_error),
  104. EFX_ETHTOOL_U64_MAC_STAT(rx_bytes),
  105. EFX_ETHTOOL_U64_MAC_STAT(rx_good_bytes),
  106. EFX_ETHTOOL_U64_MAC_STAT(rx_bad_bytes),
  107. EFX_ETHTOOL_ULONG_MAC_STAT(rx_packets),
  108. EFX_ETHTOOL_ULONG_MAC_STAT(rx_good),
  109. EFX_ETHTOOL_ULONG_MAC_STAT(rx_bad),
  110. EFX_ETHTOOL_ULONG_MAC_STAT(rx_pause),
  111. EFX_ETHTOOL_ULONG_MAC_STAT(rx_control),
  112. EFX_ETHTOOL_ULONG_MAC_STAT(rx_unicast),
  113. EFX_ETHTOOL_ULONG_MAC_STAT(rx_multicast),
  114. EFX_ETHTOOL_ULONG_MAC_STAT(rx_broadcast),
  115. EFX_ETHTOOL_ULONG_MAC_STAT(rx_lt64),
  116. EFX_ETHTOOL_ULONG_MAC_STAT(rx_64),
  117. EFX_ETHTOOL_ULONG_MAC_STAT(rx_65_to_127),
  118. EFX_ETHTOOL_ULONG_MAC_STAT(rx_128_to_255),
  119. EFX_ETHTOOL_ULONG_MAC_STAT(rx_256_to_511),
  120. EFX_ETHTOOL_ULONG_MAC_STAT(rx_512_to_1023),
  121. EFX_ETHTOOL_ULONG_MAC_STAT(rx_1024_to_15xx),
  122. EFX_ETHTOOL_ULONG_MAC_STAT(rx_15xx_to_jumbo),
  123. EFX_ETHTOOL_ULONG_MAC_STAT(rx_gtjumbo),
  124. EFX_ETHTOOL_ULONG_MAC_STAT(rx_bad_lt64),
  125. EFX_ETHTOOL_ULONG_MAC_STAT(rx_bad_64_to_15xx),
  126. EFX_ETHTOOL_ULONG_MAC_STAT(rx_bad_15xx_to_jumbo),
  127. EFX_ETHTOOL_ULONG_MAC_STAT(rx_bad_gtjumbo),
  128. EFX_ETHTOOL_ULONG_MAC_STAT(rx_overflow),
  129. EFX_ETHTOOL_ULONG_MAC_STAT(rx_missed),
  130. EFX_ETHTOOL_ULONG_MAC_STAT(rx_false_carrier),
  131. EFX_ETHTOOL_ULONG_MAC_STAT(rx_symbol_error),
  132. EFX_ETHTOOL_ULONG_MAC_STAT(rx_align_error),
  133. EFX_ETHTOOL_ULONG_MAC_STAT(rx_length_error),
  134. EFX_ETHTOOL_ULONG_MAC_STAT(rx_internal_error),
  135. EFX_ETHTOOL_UINT_NIC_STAT(rx_nodesc_drop_cnt),
  136. EFX_ETHTOOL_ATOMIC_NIC_ERROR_STAT(rx_reset),
  137. EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_tobe_disc),
  138. EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_ip_hdr_chksum_err),
  139. EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_tcp_udp_chksum_err),
  140. EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_mcast_mismatch),
  141. EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_frm_trunc),
  142. };
  143. /* Number of ethtool statistics */
  144. #define EFX_ETHTOOL_NUM_STATS ARRAY_SIZE(efx_ethtool_stats)
  145. #define EFX_ETHTOOL_EEPROM_MAGIC 0xEFAB
  146. /**************************************************************************
  147. *
  148. * Ethtool operations
  149. *
  150. **************************************************************************
  151. */
  152. /* Identify device by flashing LEDs */
  153. static int efx_ethtool_phys_id(struct net_device *net_dev, u32 count)
  154. {
  155. struct efx_nic *efx = netdev_priv(net_dev);
  156. do {
  157. efx->type->set_id_led(efx, EFX_LED_ON);
  158. schedule_timeout_interruptible(HZ / 2);
  159. efx->type->set_id_led(efx, EFX_LED_OFF);
  160. schedule_timeout_interruptible(HZ / 2);
  161. } while (!signal_pending(current) && --count != 0);
  162. efx->type->set_id_led(efx, EFX_LED_DEFAULT);
  163. return 0;
  164. }
  165. /* This must be called with rtnl_lock held. */
  166. static int efx_ethtool_get_settings(struct net_device *net_dev,
  167. struct ethtool_cmd *ecmd)
  168. {
  169. struct efx_nic *efx = netdev_priv(net_dev);
  170. struct efx_link_state *link_state = &efx->link_state;
  171. mutex_lock(&efx->mac_lock);
  172. efx->phy_op->get_settings(efx, ecmd);
  173. mutex_unlock(&efx->mac_lock);
  174. /* GMAC does not support 1000Mbps HD */
  175. ecmd->supported &= ~SUPPORTED_1000baseT_Half;
  176. /* Both MACs support pause frames (bidirectional and respond-only) */
  177. ecmd->supported |= SUPPORTED_Pause | SUPPORTED_Asym_Pause;
  178. if (LOOPBACK_INTERNAL(efx)) {
  179. ecmd->speed = link_state->speed;
  180. ecmd->duplex = link_state->fd ? DUPLEX_FULL : DUPLEX_HALF;
  181. }
  182. return 0;
  183. }
  184. /* This must be called with rtnl_lock held. */
  185. static int efx_ethtool_set_settings(struct net_device *net_dev,
  186. struct ethtool_cmd *ecmd)
  187. {
  188. struct efx_nic *efx = netdev_priv(net_dev);
  189. int rc;
  190. /* GMAC does not support 1000Mbps HD */
  191. if (ecmd->speed == SPEED_1000 && ecmd->duplex != DUPLEX_FULL) {
  192. netif_dbg(efx, drv, efx->net_dev,
  193. "rejecting unsupported 1000Mbps HD setting\n");
  194. return -EINVAL;
  195. }
  196. mutex_lock(&efx->mac_lock);
  197. rc = efx->phy_op->set_settings(efx, ecmd);
  198. mutex_unlock(&efx->mac_lock);
  199. return rc;
  200. }
  201. static void efx_ethtool_get_drvinfo(struct net_device *net_dev,
  202. struct ethtool_drvinfo *info)
  203. {
  204. struct efx_nic *efx = netdev_priv(net_dev);
  205. strlcpy(info->driver, KBUILD_MODNAME, sizeof(info->driver));
  206. strlcpy(info->version, EFX_DRIVER_VERSION, sizeof(info->version));
  207. if (efx_nic_rev(efx) >= EFX_REV_SIENA_A0)
  208. siena_print_fwver(efx, info->fw_version,
  209. sizeof(info->fw_version));
  210. strlcpy(info->bus_info, pci_name(efx->pci_dev), sizeof(info->bus_info));
  211. }
  212. static int efx_ethtool_get_regs_len(struct net_device *net_dev)
  213. {
  214. return efx_nic_get_regs_len(netdev_priv(net_dev));
  215. }
  216. static void efx_ethtool_get_regs(struct net_device *net_dev,
  217. struct ethtool_regs *regs, void *buf)
  218. {
  219. struct efx_nic *efx = netdev_priv(net_dev);
  220. regs->version = efx->type->revision;
  221. efx_nic_get_regs(efx, buf);
  222. }
  223. static u32 efx_ethtool_get_msglevel(struct net_device *net_dev)
  224. {
  225. struct efx_nic *efx = netdev_priv(net_dev);
  226. return efx->msg_enable;
  227. }
  228. static void efx_ethtool_set_msglevel(struct net_device *net_dev, u32 msg_enable)
  229. {
  230. struct efx_nic *efx = netdev_priv(net_dev);
  231. efx->msg_enable = msg_enable;
  232. }
  233. /**
  234. * efx_fill_test - fill in an individual self-test entry
  235. * @test_index: Index of the test
  236. * @strings: Ethtool strings, or %NULL
  237. * @data: Ethtool test results, or %NULL
  238. * @test: Pointer to test result (used only if data != %NULL)
  239. * @unit_format: Unit name format (e.g. "chan\%d")
  240. * @unit_id: Unit id (e.g. 0 for "chan0")
  241. * @test_format: Test name format (e.g. "loopback.\%s.tx.sent")
  242. * @test_id: Test id (e.g. "PHYXS" for "loopback.PHYXS.tx_sent")
  243. *
  244. * Fill in an individual self-test entry.
  245. */
  246. static void efx_fill_test(unsigned int test_index,
  247. struct ethtool_string *strings, u64 *data,
  248. int *test, const char *unit_format, int unit_id,
  249. const char *test_format, const char *test_id)
  250. {
  251. struct ethtool_string unit_str, test_str;
  252. /* Fill data value, if applicable */
  253. if (data)
  254. data[test_index] = *test;
  255. /* Fill string, if applicable */
  256. if (strings) {
  257. if (strchr(unit_format, '%'))
  258. snprintf(unit_str.name, sizeof(unit_str.name),
  259. unit_format, unit_id);
  260. else
  261. strcpy(unit_str.name, unit_format);
  262. snprintf(test_str.name, sizeof(test_str.name),
  263. test_format, test_id);
  264. snprintf(strings[test_index].name,
  265. sizeof(strings[test_index].name),
  266. "%-6s %-24s", unit_str.name, test_str.name);
  267. }
  268. }
  269. #define EFX_CHANNEL_NAME(_channel) "chan%d", _channel->channel
  270. #define EFX_TX_QUEUE_NAME(_tx_queue) "txq%d", _tx_queue->queue
  271. #define EFX_RX_QUEUE_NAME(_rx_queue) "rxq%d", _rx_queue->queue
  272. #define EFX_LOOPBACK_NAME(_mode, _counter) \
  273. "loopback.%s." _counter, STRING_TABLE_LOOKUP(_mode, efx_loopback_mode)
  274. /**
  275. * efx_fill_loopback_test - fill in a block of loopback self-test entries
  276. * @efx: Efx NIC
  277. * @lb_tests: Efx loopback self-test results structure
  278. * @mode: Loopback test mode
  279. * @test_index: Starting index of the test
  280. * @strings: Ethtool strings, or %NULL
  281. * @data: Ethtool test results, or %NULL
  282. */
  283. static int efx_fill_loopback_test(struct efx_nic *efx,
  284. struct efx_loopback_self_tests *lb_tests,
  285. enum efx_loopback_mode mode,
  286. unsigned int test_index,
  287. struct ethtool_string *strings, u64 *data)
  288. {
  289. struct efx_channel *channel = efx_get_channel(efx, 0);
  290. struct efx_tx_queue *tx_queue;
  291. efx_for_each_channel_tx_queue(tx_queue, channel) {
  292. efx_fill_test(test_index++, strings, data,
  293. &lb_tests->tx_sent[tx_queue->queue],
  294. EFX_TX_QUEUE_NAME(tx_queue),
  295. EFX_LOOPBACK_NAME(mode, "tx_sent"));
  296. efx_fill_test(test_index++, strings, data,
  297. &lb_tests->tx_done[tx_queue->queue],
  298. EFX_TX_QUEUE_NAME(tx_queue),
  299. EFX_LOOPBACK_NAME(mode, "tx_done"));
  300. }
  301. efx_fill_test(test_index++, strings, data,
  302. &lb_tests->rx_good,
  303. "rx", 0,
  304. EFX_LOOPBACK_NAME(mode, "rx_good"));
  305. efx_fill_test(test_index++, strings, data,
  306. &lb_tests->rx_bad,
  307. "rx", 0,
  308. EFX_LOOPBACK_NAME(mode, "rx_bad"));
  309. return test_index;
  310. }
  311. /**
  312. * efx_ethtool_fill_self_tests - get self-test details
  313. * @efx: Efx NIC
  314. * @tests: Efx self-test results structure, or %NULL
  315. * @strings: Ethtool strings, or %NULL
  316. * @data: Ethtool test results, or %NULL
  317. */
  318. static int efx_ethtool_fill_self_tests(struct efx_nic *efx,
  319. struct efx_self_tests *tests,
  320. struct ethtool_string *strings,
  321. u64 *data)
  322. {
  323. struct efx_channel *channel;
  324. unsigned int n = 0, i;
  325. enum efx_loopback_mode mode;
  326. efx_fill_test(n++, strings, data, &tests->phy_alive,
  327. "phy", 0, "alive", NULL);
  328. efx_fill_test(n++, strings, data, &tests->nvram,
  329. "core", 0, "nvram", NULL);
  330. efx_fill_test(n++, strings, data, &tests->interrupt,
  331. "core", 0, "interrupt", NULL);
  332. /* Event queues */
  333. efx_for_each_channel(channel, efx) {
  334. efx_fill_test(n++, strings, data,
  335. &tests->eventq_dma[channel->channel],
  336. EFX_CHANNEL_NAME(channel),
  337. "eventq.dma", NULL);
  338. efx_fill_test(n++, strings, data,
  339. &tests->eventq_int[channel->channel],
  340. EFX_CHANNEL_NAME(channel),
  341. "eventq.int", NULL);
  342. efx_fill_test(n++, strings, data,
  343. &tests->eventq_poll[channel->channel],
  344. EFX_CHANNEL_NAME(channel),
  345. "eventq.poll", NULL);
  346. }
  347. efx_fill_test(n++, strings, data, &tests->registers,
  348. "core", 0, "registers", NULL);
  349. if (efx->phy_op->run_tests != NULL) {
  350. EFX_BUG_ON_PARANOID(efx->phy_op->test_name == NULL);
  351. for (i = 0; true; ++i) {
  352. const char *name;
  353. EFX_BUG_ON_PARANOID(i >= EFX_MAX_PHY_TESTS);
  354. name = efx->phy_op->test_name(efx, i);
  355. if (name == NULL)
  356. break;
  357. efx_fill_test(n++, strings, data, &tests->phy_ext[i],
  358. "phy", 0, name, NULL);
  359. }
  360. }
  361. /* Loopback tests */
  362. for (mode = LOOPBACK_NONE; mode <= LOOPBACK_TEST_MAX; mode++) {
  363. if (!(efx->loopback_modes & (1 << mode)))
  364. continue;
  365. n = efx_fill_loopback_test(efx,
  366. &tests->loopback[mode], mode, n,
  367. strings, data);
  368. }
  369. return n;
  370. }
  371. static int efx_ethtool_get_sset_count(struct net_device *net_dev,
  372. int string_set)
  373. {
  374. switch (string_set) {
  375. case ETH_SS_STATS:
  376. return EFX_ETHTOOL_NUM_STATS;
  377. case ETH_SS_TEST:
  378. return efx_ethtool_fill_self_tests(netdev_priv(net_dev),
  379. NULL, NULL, NULL);
  380. default:
  381. return -EINVAL;
  382. }
  383. }
  384. static void efx_ethtool_get_strings(struct net_device *net_dev,
  385. u32 string_set, u8 *strings)
  386. {
  387. struct efx_nic *efx = netdev_priv(net_dev);
  388. struct ethtool_string *ethtool_strings =
  389. (struct ethtool_string *)strings;
  390. int i;
  391. switch (string_set) {
  392. case ETH_SS_STATS:
  393. for (i = 0; i < EFX_ETHTOOL_NUM_STATS; i++)
  394. strncpy(ethtool_strings[i].name,
  395. efx_ethtool_stats[i].name,
  396. sizeof(ethtool_strings[i].name));
  397. break;
  398. case ETH_SS_TEST:
  399. efx_ethtool_fill_self_tests(efx, NULL,
  400. ethtool_strings, NULL);
  401. break;
  402. default:
  403. /* No other string sets */
  404. break;
  405. }
  406. }
  407. static void efx_ethtool_get_stats(struct net_device *net_dev,
  408. struct ethtool_stats *stats,
  409. u64 *data)
  410. {
  411. struct efx_nic *efx = netdev_priv(net_dev);
  412. struct efx_mac_stats *mac_stats = &efx->mac_stats;
  413. struct efx_ethtool_stat *stat;
  414. struct efx_channel *channel;
  415. struct rtnl_link_stats64 temp;
  416. int i;
  417. EFX_BUG_ON_PARANOID(stats->n_stats != EFX_ETHTOOL_NUM_STATS);
  418. /* Update MAC and NIC statistics */
  419. dev_get_stats(net_dev, &temp);
  420. /* Fill detailed statistics buffer */
  421. for (i = 0; i < EFX_ETHTOOL_NUM_STATS; i++) {
  422. stat = &efx_ethtool_stats[i];
  423. switch (stat->source) {
  424. case EFX_ETHTOOL_STAT_SOURCE_mac_stats:
  425. data[i] = stat->get_stat((void *)mac_stats +
  426. stat->offset);
  427. break;
  428. case EFX_ETHTOOL_STAT_SOURCE_nic:
  429. data[i] = stat->get_stat((void *)efx + stat->offset);
  430. break;
  431. case EFX_ETHTOOL_STAT_SOURCE_channel:
  432. data[i] = 0;
  433. efx_for_each_channel(channel, efx)
  434. data[i] += stat->get_stat((void *)channel +
  435. stat->offset);
  436. break;
  437. }
  438. }
  439. }
  440. static int efx_ethtool_set_tso(struct net_device *net_dev, u32 enable)
  441. {
  442. struct efx_nic *efx __attribute__ ((unused)) = netdev_priv(net_dev);
  443. unsigned long features;
  444. features = NETIF_F_TSO;
  445. if (efx->type->offload_features & NETIF_F_V6_CSUM)
  446. features |= NETIF_F_TSO6;
  447. if (enable)
  448. net_dev->features |= features;
  449. else
  450. net_dev->features &= ~features;
  451. return 0;
  452. }
  453. static int efx_ethtool_set_tx_csum(struct net_device *net_dev, u32 enable)
  454. {
  455. struct efx_nic *efx = netdev_priv(net_dev);
  456. unsigned long features = efx->type->offload_features & NETIF_F_ALL_CSUM;
  457. if (enable)
  458. net_dev->features |= features;
  459. else
  460. net_dev->features &= ~features;
  461. return 0;
  462. }
  463. static int efx_ethtool_set_rx_csum(struct net_device *net_dev, u32 enable)
  464. {
  465. struct efx_nic *efx = netdev_priv(net_dev);
  466. /* No way to stop the hardware doing the checks; we just
  467. * ignore the result.
  468. */
  469. efx->rx_checksum_enabled = !!enable;
  470. return 0;
  471. }
  472. static u32 efx_ethtool_get_rx_csum(struct net_device *net_dev)
  473. {
  474. struct efx_nic *efx = netdev_priv(net_dev);
  475. return efx->rx_checksum_enabled;
  476. }
  477. static int efx_ethtool_set_flags(struct net_device *net_dev, u32 data)
  478. {
  479. struct efx_nic *efx = netdev_priv(net_dev);
  480. u32 supported = (efx->type->offload_features &
  481. (ETH_FLAG_RXHASH | ETH_FLAG_NTUPLE));
  482. int rc;
  483. rc = ethtool_op_set_flags(net_dev, data, supported);
  484. if (rc)
  485. return rc;
  486. if (!(data & ETH_FLAG_NTUPLE)) {
  487. efx_filter_table_clear(efx, EFX_FILTER_TABLE_RX_IP,
  488. EFX_FILTER_PRI_MANUAL);
  489. efx_filter_table_clear(efx, EFX_FILTER_TABLE_RX_MAC,
  490. EFX_FILTER_PRI_MANUAL);
  491. }
  492. return 0;
  493. }
  494. static void efx_ethtool_self_test(struct net_device *net_dev,
  495. struct ethtool_test *test, u64 *data)
  496. {
  497. struct efx_nic *efx = netdev_priv(net_dev);
  498. struct efx_self_tests efx_tests;
  499. int already_up;
  500. int rc;
  501. ASSERT_RTNL();
  502. if (efx->state != STATE_RUNNING) {
  503. rc = -EIO;
  504. goto fail1;
  505. }
  506. netif_info(efx, drv, efx->net_dev, "starting %sline testing\n",
  507. (test->flags & ETH_TEST_FL_OFFLINE) ? "off" : "on");
  508. /* We need rx buffers and interrupts. */
  509. already_up = (efx->net_dev->flags & IFF_UP);
  510. if (!already_up) {
  511. rc = dev_open(efx->net_dev);
  512. if (rc) {
  513. netif_err(efx, drv, efx->net_dev,
  514. "failed opening device.\n");
  515. goto fail2;
  516. }
  517. }
  518. memset(&efx_tests, 0, sizeof(efx_tests));
  519. rc = efx_selftest(efx, &efx_tests, test->flags);
  520. if (!already_up)
  521. dev_close(efx->net_dev);
  522. netif_info(efx, drv, efx->net_dev, "%s %sline self-tests\n",
  523. rc == 0 ? "passed" : "failed",
  524. (test->flags & ETH_TEST_FL_OFFLINE) ? "off" : "on");
  525. fail2:
  526. fail1:
  527. /* Fill ethtool results structures */
  528. efx_ethtool_fill_self_tests(efx, &efx_tests, NULL, data);
  529. if (rc)
  530. test->flags |= ETH_TEST_FL_FAILED;
  531. }
  532. /* Restart autonegotiation */
  533. static int efx_ethtool_nway_reset(struct net_device *net_dev)
  534. {
  535. struct efx_nic *efx = netdev_priv(net_dev);
  536. return mdio45_nway_restart(&efx->mdio);
  537. }
  538. static u32 efx_ethtool_get_link(struct net_device *net_dev)
  539. {
  540. struct efx_nic *efx = netdev_priv(net_dev);
  541. return efx->link_state.up;
  542. }
  543. static int efx_ethtool_get_coalesce(struct net_device *net_dev,
  544. struct ethtool_coalesce *coalesce)
  545. {
  546. struct efx_nic *efx = netdev_priv(net_dev);
  547. struct efx_channel *channel;
  548. memset(coalesce, 0, sizeof(*coalesce));
  549. /* Find lowest IRQ moderation across all used TX queues */
  550. coalesce->tx_coalesce_usecs_irq = ~((u32) 0);
  551. efx_for_each_channel(channel, efx) {
  552. if (!efx_channel_get_tx_queue(channel, 0))
  553. continue;
  554. if (channel->irq_moderation < coalesce->tx_coalesce_usecs_irq) {
  555. if (channel->channel < efx->n_rx_channels)
  556. coalesce->tx_coalesce_usecs_irq =
  557. channel->irq_moderation;
  558. else
  559. coalesce->tx_coalesce_usecs_irq = 0;
  560. }
  561. }
  562. coalesce->use_adaptive_rx_coalesce = efx->irq_rx_adaptive;
  563. coalesce->rx_coalesce_usecs_irq = efx->irq_rx_moderation;
  564. coalesce->tx_coalesce_usecs_irq *= EFX_IRQ_MOD_RESOLUTION;
  565. coalesce->rx_coalesce_usecs_irq *= EFX_IRQ_MOD_RESOLUTION;
  566. return 0;
  567. }
  568. /* Set coalescing parameters
  569. * The difficulties occur for shared channels
  570. */
  571. static int efx_ethtool_set_coalesce(struct net_device *net_dev,
  572. struct ethtool_coalesce *coalesce)
  573. {
  574. struct efx_nic *efx = netdev_priv(net_dev);
  575. struct efx_channel *channel;
  576. unsigned tx_usecs, rx_usecs, adaptive;
  577. if (coalesce->use_adaptive_tx_coalesce)
  578. return -EOPNOTSUPP;
  579. if (coalesce->rx_coalesce_usecs || coalesce->tx_coalesce_usecs) {
  580. netif_err(efx, drv, efx->net_dev, "invalid coalescing setting. "
  581. "Only rx/tx_coalesce_usecs_irq are supported\n");
  582. return -EOPNOTSUPP;
  583. }
  584. rx_usecs = coalesce->rx_coalesce_usecs_irq;
  585. tx_usecs = coalesce->tx_coalesce_usecs_irq;
  586. adaptive = coalesce->use_adaptive_rx_coalesce;
  587. /* If the channel is shared only allow RX parameters to be set */
  588. efx_for_each_channel(channel, efx) {
  589. if (efx_channel_get_rx_queue(channel) &&
  590. efx_channel_get_tx_queue(channel, 0) &&
  591. tx_usecs) {
  592. netif_err(efx, drv, efx->net_dev, "Channel is shared. "
  593. "Only RX coalescing may be set\n");
  594. return -EOPNOTSUPP;
  595. }
  596. }
  597. efx_init_irq_moderation(efx, tx_usecs, rx_usecs, adaptive);
  598. efx_for_each_channel(channel, efx)
  599. efx->type->push_irq_moderation(channel);
  600. return 0;
  601. }
  602. static void efx_ethtool_get_ringparam(struct net_device *net_dev,
  603. struct ethtool_ringparam *ring)
  604. {
  605. struct efx_nic *efx = netdev_priv(net_dev);
  606. ring->rx_max_pending = EFX_MAX_DMAQ_SIZE;
  607. ring->tx_max_pending = EFX_MAX_DMAQ_SIZE;
  608. ring->rx_mini_max_pending = 0;
  609. ring->rx_jumbo_max_pending = 0;
  610. ring->rx_pending = efx->rxq_entries;
  611. ring->tx_pending = efx->txq_entries;
  612. ring->rx_mini_pending = 0;
  613. ring->rx_jumbo_pending = 0;
  614. }
  615. static int efx_ethtool_set_ringparam(struct net_device *net_dev,
  616. struct ethtool_ringparam *ring)
  617. {
  618. struct efx_nic *efx = netdev_priv(net_dev);
  619. if (ring->rx_mini_pending || ring->rx_jumbo_pending ||
  620. ring->rx_pending > EFX_MAX_DMAQ_SIZE ||
  621. ring->tx_pending > EFX_MAX_DMAQ_SIZE)
  622. return -EINVAL;
  623. if (ring->rx_pending < EFX_MIN_RING_SIZE ||
  624. ring->tx_pending < EFX_MIN_RING_SIZE) {
  625. netif_err(efx, drv, efx->net_dev,
  626. "TX and RX queues cannot be smaller than %ld\n",
  627. EFX_MIN_RING_SIZE);
  628. return -EINVAL;
  629. }
  630. return efx_realloc_channels(efx, ring->rx_pending, ring->tx_pending);
  631. }
  632. static int efx_ethtool_set_pauseparam(struct net_device *net_dev,
  633. struct ethtool_pauseparam *pause)
  634. {
  635. struct efx_nic *efx = netdev_priv(net_dev);
  636. enum efx_fc_type wanted_fc, old_fc;
  637. u32 old_adv;
  638. bool reset;
  639. int rc = 0;
  640. mutex_lock(&efx->mac_lock);
  641. wanted_fc = ((pause->rx_pause ? EFX_FC_RX : 0) |
  642. (pause->tx_pause ? EFX_FC_TX : 0) |
  643. (pause->autoneg ? EFX_FC_AUTO : 0));
  644. if ((wanted_fc & EFX_FC_TX) && !(wanted_fc & EFX_FC_RX)) {
  645. netif_dbg(efx, drv, efx->net_dev,
  646. "Flow control unsupported: tx ON rx OFF\n");
  647. rc = -EINVAL;
  648. goto out;
  649. }
  650. if ((wanted_fc & EFX_FC_AUTO) && !efx->link_advertising) {
  651. netif_dbg(efx, drv, efx->net_dev,
  652. "Autonegotiation is disabled\n");
  653. rc = -EINVAL;
  654. goto out;
  655. }
  656. /* TX flow control may automatically turn itself off if the
  657. * link partner (intermittently) stops responding to pause
  658. * frames. There isn't any indication that this has happened,
  659. * so the best we do is leave it up to the user to spot this
  660. * and fix it be cycling transmit flow control on this end. */
  661. reset = (wanted_fc & EFX_FC_TX) && !(efx->wanted_fc & EFX_FC_TX);
  662. if (EFX_WORKAROUND_11482(efx) && reset) {
  663. if (efx_nic_rev(efx) == EFX_REV_FALCON_B0) {
  664. /* Recover by resetting the EM block */
  665. falcon_stop_nic_stats(efx);
  666. falcon_drain_tx_fifo(efx);
  667. efx->mac_op->reconfigure(efx);
  668. falcon_start_nic_stats(efx);
  669. } else {
  670. /* Schedule a reset to recover */
  671. efx_schedule_reset(efx, RESET_TYPE_INVISIBLE);
  672. }
  673. }
  674. old_adv = efx->link_advertising;
  675. old_fc = efx->wanted_fc;
  676. efx_link_set_wanted_fc(efx, wanted_fc);
  677. if (efx->link_advertising != old_adv ||
  678. (efx->wanted_fc ^ old_fc) & EFX_FC_AUTO) {
  679. rc = efx->phy_op->reconfigure(efx);
  680. if (rc) {
  681. netif_err(efx, drv, efx->net_dev,
  682. "Unable to advertise requested flow "
  683. "control setting\n");
  684. goto out;
  685. }
  686. }
  687. /* Reconfigure the MAC. The PHY *may* generate a link state change event
  688. * if the user just changed the advertised capabilities, but there's no
  689. * harm doing this twice */
  690. efx->mac_op->reconfigure(efx);
  691. out:
  692. mutex_unlock(&efx->mac_lock);
  693. return rc;
  694. }
  695. static void efx_ethtool_get_pauseparam(struct net_device *net_dev,
  696. struct ethtool_pauseparam *pause)
  697. {
  698. struct efx_nic *efx = netdev_priv(net_dev);
  699. pause->rx_pause = !!(efx->wanted_fc & EFX_FC_RX);
  700. pause->tx_pause = !!(efx->wanted_fc & EFX_FC_TX);
  701. pause->autoneg = !!(efx->wanted_fc & EFX_FC_AUTO);
  702. }
  703. static void efx_ethtool_get_wol(struct net_device *net_dev,
  704. struct ethtool_wolinfo *wol)
  705. {
  706. struct efx_nic *efx = netdev_priv(net_dev);
  707. return efx->type->get_wol(efx, wol);
  708. }
  709. static int efx_ethtool_set_wol(struct net_device *net_dev,
  710. struct ethtool_wolinfo *wol)
  711. {
  712. struct efx_nic *efx = netdev_priv(net_dev);
  713. return efx->type->set_wol(efx, wol->wolopts);
  714. }
  715. static int efx_ethtool_reset(struct net_device *net_dev, u32 *flags)
  716. {
  717. struct efx_nic *efx = netdev_priv(net_dev);
  718. enum reset_type method;
  719. enum {
  720. ETH_RESET_EFX_INVISIBLE = (ETH_RESET_DMA | ETH_RESET_FILTER |
  721. ETH_RESET_OFFLOAD | ETH_RESET_MAC)
  722. };
  723. /* Check for minimal reset flags */
  724. if ((*flags & ETH_RESET_EFX_INVISIBLE) != ETH_RESET_EFX_INVISIBLE)
  725. return -EINVAL;
  726. *flags ^= ETH_RESET_EFX_INVISIBLE;
  727. method = RESET_TYPE_INVISIBLE;
  728. if (*flags & ETH_RESET_PHY) {
  729. *flags ^= ETH_RESET_PHY;
  730. method = RESET_TYPE_ALL;
  731. }
  732. if ((*flags & efx->type->reset_world_flags) ==
  733. efx->type->reset_world_flags) {
  734. *flags ^= efx->type->reset_world_flags;
  735. method = RESET_TYPE_WORLD;
  736. }
  737. return efx_reset(efx, method);
  738. }
  739. static int
  740. efx_ethtool_get_rxnfc(struct net_device *net_dev,
  741. struct ethtool_rxnfc *info, void *rules __always_unused)
  742. {
  743. struct efx_nic *efx = netdev_priv(net_dev);
  744. switch (info->cmd) {
  745. case ETHTOOL_GRXRINGS:
  746. info->data = efx->n_rx_channels;
  747. return 0;
  748. case ETHTOOL_GRXFH: {
  749. unsigned min_revision = 0;
  750. info->data = 0;
  751. switch (info->flow_type) {
  752. case TCP_V4_FLOW:
  753. info->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
  754. /* fall through */
  755. case UDP_V4_FLOW:
  756. case SCTP_V4_FLOW:
  757. case AH_ESP_V4_FLOW:
  758. case IPV4_FLOW:
  759. info->data |= RXH_IP_SRC | RXH_IP_DST;
  760. min_revision = EFX_REV_FALCON_B0;
  761. break;
  762. case TCP_V6_FLOW:
  763. info->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
  764. /* fall through */
  765. case UDP_V6_FLOW:
  766. case SCTP_V6_FLOW:
  767. case AH_ESP_V6_FLOW:
  768. case IPV6_FLOW:
  769. info->data |= RXH_IP_SRC | RXH_IP_DST;
  770. min_revision = EFX_REV_SIENA_A0;
  771. break;
  772. default:
  773. break;
  774. }
  775. if (efx_nic_rev(efx) < min_revision)
  776. info->data = 0;
  777. return 0;
  778. }
  779. default:
  780. return -EOPNOTSUPP;
  781. }
  782. }
  783. static int efx_ethtool_set_rx_ntuple(struct net_device *net_dev,
  784. struct ethtool_rx_ntuple *ntuple)
  785. {
  786. struct efx_nic *efx = netdev_priv(net_dev);
  787. struct ethtool_tcpip4_spec *ip_entry = &ntuple->fs.h_u.tcp_ip4_spec;
  788. struct ethtool_tcpip4_spec *ip_mask = &ntuple->fs.m_u.tcp_ip4_spec;
  789. struct ethhdr *mac_entry = &ntuple->fs.h_u.ether_spec;
  790. struct ethhdr *mac_mask = &ntuple->fs.m_u.ether_spec;
  791. struct efx_filter_spec filter;
  792. /* Range-check action */
  793. if (ntuple->fs.action < ETHTOOL_RXNTUPLE_ACTION_CLEAR ||
  794. ntuple->fs.action >= (s32)efx->n_rx_channels)
  795. return -EINVAL;
  796. if (~ntuple->fs.data_mask)
  797. return -EINVAL;
  798. switch (ntuple->fs.flow_type) {
  799. case TCP_V4_FLOW:
  800. case UDP_V4_FLOW:
  801. /* Must match all of destination, */
  802. if (ip_mask->ip4dst | ip_mask->pdst)
  803. return -EINVAL;
  804. /* all or none of source, */
  805. if ((ip_mask->ip4src | ip_mask->psrc) &&
  806. ((__force u32)~ip_mask->ip4src |
  807. (__force u16)~ip_mask->psrc))
  808. return -EINVAL;
  809. /* and nothing else */
  810. if ((u8)~ip_mask->tos | (u16)~ntuple->fs.vlan_tag_mask)
  811. return -EINVAL;
  812. break;
  813. case ETHER_FLOW:
  814. /* Must match all of destination, */
  815. if (!is_zero_ether_addr(mac_mask->h_dest))
  816. return -EINVAL;
  817. /* all or none of VID, */
  818. if (ntuple->fs.vlan_tag_mask != 0xf000 &&
  819. ntuple->fs.vlan_tag_mask != 0xffff)
  820. return -EINVAL;
  821. /* and nothing else */
  822. if (!is_broadcast_ether_addr(mac_mask->h_source) ||
  823. mac_mask->h_proto != htons(0xffff))
  824. return -EINVAL;
  825. break;
  826. default:
  827. return -EINVAL;
  828. }
  829. filter.priority = EFX_FILTER_PRI_MANUAL;
  830. filter.flags = 0;
  831. switch (ntuple->fs.flow_type) {
  832. case TCP_V4_FLOW:
  833. if (!ip_mask->ip4src)
  834. efx_filter_set_rx_tcp_full(&filter,
  835. htonl(ip_entry->ip4src),
  836. htons(ip_entry->psrc),
  837. htonl(ip_entry->ip4dst),
  838. htons(ip_entry->pdst));
  839. else
  840. efx_filter_set_rx_tcp_wild(&filter,
  841. htonl(ip_entry->ip4dst),
  842. htons(ip_entry->pdst));
  843. break;
  844. case UDP_V4_FLOW:
  845. if (!ip_mask->ip4src)
  846. efx_filter_set_rx_udp_full(&filter,
  847. htonl(ip_entry->ip4src),
  848. htons(ip_entry->psrc),
  849. htonl(ip_entry->ip4dst),
  850. htons(ip_entry->pdst));
  851. else
  852. efx_filter_set_rx_udp_wild(&filter,
  853. htonl(ip_entry->ip4dst),
  854. htons(ip_entry->pdst));
  855. break;
  856. case ETHER_FLOW:
  857. if (ntuple->fs.vlan_tag_mask == 0xf000)
  858. efx_filter_set_rx_mac_full(&filter,
  859. ntuple->fs.vlan_tag & 0xfff,
  860. mac_entry->h_dest);
  861. else
  862. efx_filter_set_rx_mac_wild(&filter, mac_entry->h_dest);
  863. break;
  864. }
  865. if (ntuple->fs.action == ETHTOOL_RXNTUPLE_ACTION_CLEAR) {
  866. return efx_filter_remove_filter(efx, &filter);
  867. } else {
  868. if (ntuple->fs.action == ETHTOOL_RXNTUPLE_ACTION_DROP)
  869. filter.dmaq_id = 0xfff;
  870. else
  871. filter.dmaq_id = ntuple->fs.action;
  872. return efx_filter_insert_filter(efx, &filter, true);
  873. }
  874. }
  875. static int efx_ethtool_get_rxfh_indir(struct net_device *net_dev,
  876. struct ethtool_rxfh_indir *indir)
  877. {
  878. struct efx_nic *efx = netdev_priv(net_dev);
  879. size_t copy_size =
  880. min_t(size_t, indir->size, ARRAY_SIZE(efx->rx_indir_table));
  881. if (efx_nic_rev(efx) < EFX_REV_FALCON_B0)
  882. return -EOPNOTSUPP;
  883. indir->size = ARRAY_SIZE(efx->rx_indir_table);
  884. memcpy(indir->ring_index, efx->rx_indir_table,
  885. copy_size * sizeof(indir->ring_index[0]));
  886. return 0;
  887. }
  888. static int efx_ethtool_set_rxfh_indir(struct net_device *net_dev,
  889. const struct ethtool_rxfh_indir *indir)
  890. {
  891. struct efx_nic *efx = netdev_priv(net_dev);
  892. size_t i;
  893. if (efx_nic_rev(efx) < EFX_REV_FALCON_B0)
  894. return -EOPNOTSUPP;
  895. /* Validate size and indices */
  896. if (indir->size != ARRAY_SIZE(efx->rx_indir_table))
  897. return -EINVAL;
  898. for (i = 0; i < ARRAY_SIZE(efx->rx_indir_table); i++)
  899. if (indir->ring_index[i] >= efx->n_rx_channels)
  900. return -EINVAL;
  901. memcpy(efx->rx_indir_table, indir->ring_index,
  902. sizeof(efx->rx_indir_table));
  903. efx_nic_push_rx_indir_table(efx);
  904. return 0;
  905. }
  906. const struct ethtool_ops efx_ethtool_ops = {
  907. .get_settings = efx_ethtool_get_settings,
  908. .set_settings = efx_ethtool_set_settings,
  909. .get_drvinfo = efx_ethtool_get_drvinfo,
  910. .get_regs_len = efx_ethtool_get_regs_len,
  911. .get_regs = efx_ethtool_get_regs,
  912. .get_msglevel = efx_ethtool_get_msglevel,
  913. .set_msglevel = efx_ethtool_set_msglevel,
  914. .nway_reset = efx_ethtool_nway_reset,
  915. .get_link = efx_ethtool_get_link,
  916. .get_coalesce = efx_ethtool_get_coalesce,
  917. .set_coalesce = efx_ethtool_set_coalesce,
  918. .get_ringparam = efx_ethtool_get_ringparam,
  919. .set_ringparam = efx_ethtool_set_ringparam,
  920. .get_pauseparam = efx_ethtool_get_pauseparam,
  921. .set_pauseparam = efx_ethtool_set_pauseparam,
  922. .get_rx_csum = efx_ethtool_get_rx_csum,
  923. .set_rx_csum = efx_ethtool_set_rx_csum,
  924. .get_tx_csum = ethtool_op_get_tx_csum,
  925. /* Need to enable/disable IPv6 too */
  926. .set_tx_csum = efx_ethtool_set_tx_csum,
  927. .get_sg = ethtool_op_get_sg,
  928. .set_sg = ethtool_op_set_sg,
  929. .get_tso = ethtool_op_get_tso,
  930. /* Need to enable/disable TSO-IPv6 too */
  931. .set_tso = efx_ethtool_set_tso,
  932. .get_flags = ethtool_op_get_flags,
  933. .set_flags = efx_ethtool_set_flags,
  934. .get_sset_count = efx_ethtool_get_sset_count,
  935. .self_test = efx_ethtool_self_test,
  936. .get_strings = efx_ethtool_get_strings,
  937. .phys_id = efx_ethtool_phys_id,
  938. .get_ethtool_stats = efx_ethtool_get_stats,
  939. .get_wol = efx_ethtool_get_wol,
  940. .set_wol = efx_ethtool_set_wol,
  941. .reset = efx_ethtool_reset,
  942. .get_rxnfc = efx_ethtool_get_rxnfc,
  943. .set_rx_ntuple = efx_ethtool_set_rx_ntuple,
  944. .get_rxfh_indir = efx_ethtool_get_rxfh_indir,
  945. .set_rxfh_indir = efx_ethtool_set_rxfh_indir,
  946. };