ethtool.c 31 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114
  1. /****************************************************************************
  2. * Driver for Solarflare Solarstorm network controllers and boards
  3. * Copyright 2005-2006 Fen Systems Ltd.
  4. * Copyright 2006-2010 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 <linux/in.h>
  14. #include "net_driver.h"
  15. #include "workarounds.h"
  16. #include "selftest.h"
  17. #include "efx.h"
  18. #include "filter.h"
  19. #include "nic.h"
  20. struct efx_sw_stat_desc {
  21. const char *name;
  22. enum {
  23. EFX_ETHTOOL_STAT_SOURCE_nic,
  24. EFX_ETHTOOL_STAT_SOURCE_channel,
  25. EFX_ETHTOOL_STAT_SOURCE_tx_queue
  26. } source;
  27. unsigned offset;
  28. u64(*get_stat) (void *field); /* Reader function */
  29. };
  30. /* Initialiser for a struct efx_sw_stat_desc with type-checking */
  31. #define EFX_ETHTOOL_STAT(stat_name, source_name, field, field_type, \
  32. get_stat_function) { \
  33. .name = #stat_name, \
  34. .source = EFX_ETHTOOL_STAT_SOURCE_##source_name, \
  35. .offset = ((((field_type *) 0) == \
  36. &((struct efx_##source_name *)0)->field) ? \
  37. offsetof(struct efx_##source_name, field) : \
  38. offsetof(struct efx_##source_name, field)), \
  39. .get_stat = get_stat_function, \
  40. }
  41. static u64 efx_get_uint_stat(void *field)
  42. {
  43. return *(unsigned int *)field;
  44. }
  45. static u64 efx_get_atomic_stat(void *field)
  46. {
  47. return atomic_read((atomic_t *) field);
  48. }
  49. #define EFX_ETHTOOL_ATOMIC_NIC_ERROR_STAT(field) \
  50. EFX_ETHTOOL_STAT(field, nic, field, \
  51. atomic_t, efx_get_atomic_stat)
  52. #define EFX_ETHTOOL_UINT_CHANNEL_STAT(field) \
  53. EFX_ETHTOOL_STAT(field, channel, n_##field, \
  54. unsigned int, efx_get_uint_stat)
  55. #define EFX_ETHTOOL_UINT_TXQ_STAT(field) \
  56. EFX_ETHTOOL_STAT(tx_##field, tx_queue, field, \
  57. unsigned int, efx_get_uint_stat)
  58. static const struct efx_sw_stat_desc efx_sw_stat_desc[] = {
  59. EFX_ETHTOOL_UINT_TXQ_STAT(tso_bursts),
  60. EFX_ETHTOOL_UINT_TXQ_STAT(tso_long_headers),
  61. EFX_ETHTOOL_UINT_TXQ_STAT(tso_packets),
  62. EFX_ETHTOOL_UINT_TXQ_STAT(pushes),
  63. EFX_ETHTOOL_ATOMIC_NIC_ERROR_STAT(rx_reset),
  64. EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_tobe_disc),
  65. EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_ip_hdr_chksum_err),
  66. EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_tcp_udp_chksum_err),
  67. EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_mcast_mismatch),
  68. EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_frm_trunc),
  69. EFX_ETHTOOL_UINT_CHANNEL_STAT(rx_nodesc_trunc),
  70. };
  71. #define EFX_ETHTOOL_SW_STAT_COUNT ARRAY_SIZE(efx_sw_stat_desc)
  72. #define EFX_ETHTOOL_EEPROM_MAGIC 0xEFAB
  73. /**************************************************************************
  74. *
  75. * Ethtool operations
  76. *
  77. **************************************************************************
  78. */
  79. /* Identify device by flashing LEDs */
  80. static int efx_ethtool_phys_id(struct net_device *net_dev,
  81. enum ethtool_phys_id_state state)
  82. {
  83. struct efx_nic *efx = netdev_priv(net_dev);
  84. enum efx_led_mode mode = EFX_LED_DEFAULT;
  85. switch (state) {
  86. case ETHTOOL_ID_ON:
  87. mode = EFX_LED_ON;
  88. break;
  89. case ETHTOOL_ID_OFF:
  90. mode = EFX_LED_OFF;
  91. break;
  92. case ETHTOOL_ID_INACTIVE:
  93. mode = EFX_LED_DEFAULT;
  94. break;
  95. case ETHTOOL_ID_ACTIVE:
  96. return 1; /* cycle on/off once per second */
  97. }
  98. efx->type->set_id_led(efx, mode);
  99. return 0;
  100. }
  101. /* This must be called with rtnl_lock held. */
  102. static int efx_ethtool_get_settings(struct net_device *net_dev,
  103. struct ethtool_cmd *ecmd)
  104. {
  105. struct efx_nic *efx = netdev_priv(net_dev);
  106. struct efx_link_state *link_state = &efx->link_state;
  107. mutex_lock(&efx->mac_lock);
  108. efx->phy_op->get_settings(efx, ecmd);
  109. mutex_unlock(&efx->mac_lock);
  110. /* Both MACs support pause frames (bidirectional and respond-only) */
  111. ecmd->supported |= SUPPORTED_Pause | SUPPORTED_Asym_Pause;
  112. if (LOOPBACK_INTERNAL(efx)) {
  113. ethtool_cmd_speed_set(ecmd, link_state->speed);
  114. ecmd->duplex = link_state->fd ? DUPLEX_FULL : DUPLEX_HALF;
  115. }
  116. return 0;
  117. }
  118. /* This must be called with rtnl_lock held. */
  119. static int efx_ethtool_set_settings(struct net_device *net_dev,
  120. struct ethtool_cmd *ecmd)
  121. {
  122. struct efx_nic *efx = netdev_priv(net_dev);
  123. int rc;
  124. /* GMAC does not support 1000Mbps HD */
  125. if ((ethtool_cmd_speed(ecmd) == SPEED_1000) &&
  126. (ecmd->duplex != DUPLEX_FULL)) {
  127. netif_dbg(efx, drv, efx->net_dev,
  128. "rejecting unsupported 1000Mbps HD setting\n");
  129. return -EINVAL;
  130. }
  131. mutex_lock(&efx->mac_lock);
  132. rc = efx->phy_op->set_settings(efx, ecmd);
  133. mutex_unlock(&efx->mac_lock);
  134. return rc;
  135. }
  136. static void efx_ethtool_get_drvinfo(struct net_device *net_dev,
  137. struct ethtool_drvinfo *info)
  138. {
  139. struct efx_nic *efx = netdev_priv(net_dev);
  140. strlcpy(info->driver, KBUILD_MODNAME, sizeof(info->driver));
  141. strlcpy(info->version, EFX_DRIVER_VERSION, sizeof(info->version));
  142. if (efx_nic_rev(efx) >= EFX_REV_SIENA_A0)
  143. efx_mcdi_print_fwver(efx, info->fw_version,
  144. sizeof(info->fw_version));
  145. strlcpy(info->bus_info, pci_name(efx->pci_dev), sizeof(info->bus_info));
  146. }
  147. static int efx_ethtool_get_regs_len(struct net_device *net_dev)
  148. {
  149. return efx_nic_get_regs_len(netdev_priv(net_dev));
  150. }
  151. static void efx_ethtool_get_regs(struct net_device *net_dev,
  152. struct ethtool_regs *regs, void *buf)
  153. {
  154. struct efx_nic *efx = netdev_priv(net_dev);
  155. regs->version = efx->type->revision;
  156. efx_nic_get_regs(efx, buf);
  157. }
  158. static u32 efx_ethtool_get_msglevel(struct net_device *net_dev)
  159. {
  160. struct efx_nic *efx = netdev_priv(net_dev);
  161. return efx->msg_enable;
  162. }
  163. static void efx_ethtool_set_msglevel(struct net_device *net_dev, u32 msg_enable)
  164. {
  165. struct efx_nic *efx = netdev_priv(net_dev);
  166. efx->msg_enable = msg_enable;
  167. }
  168. /**
  169. * efx_fill_test - fill in an individual self-test entry
  170. * @test_index: Index of the test
  171. * @strings: Ethtool strings, or %NULL
  172. * @data: Ethtool test results, or %NULL
  173. * @test: Pointer to test result (used only if data != %NULL)
  174. * @unit_format: Unit name format (e.g. "chan\%d")
  175. * @unit_id: Unit id (e.g. 0 for "chan0")
  176. * @test_format: Test name format (e.g. "loopback.\%s.tx.sent")
  177. * @test_id: Test id (e.g. "PHYXS" for "loopback.PHYXS.tx_sent")
  178. *
  179. * Fill in an individual self-test entry.
  180. */
  181. static void efx_fill_test(unsigned int test_index, u8 *strings, u64 *data,
  182. int *test, const char *unit_format, int unit_id,
  183. const char *test_format, const char *test_id)
  184. {
  185. char unit_str[ETH_GSTRING_LEN], test_str[ETH_GSTRING_LEN];
  186. /* Fill data value, if applicable */
  187. if (data)
  188. data[test_index] = *test;
  189. /* Fill string, if applicable */
  190. if (strings) {
  191. if (strchr(unit_format, '%'))
  192. snprintf(unit_str, sizeof(unit_str),
  193. unit_format, unit_id);
  194. else
  195. strcpy(unit_str, unit_format);
  196. snprintf(test_str, sizeof(test_str), test_format, test_id);
  197. snprintf(strings + test_index * ETH_GSTRING_LEN,
  198. ETH_GSTRING_LEN,
  199. "%-6s %-24s", unit_str, test_str);
  200. }
  201. }
  202. #define EFX_CHANNEL_NAME(_channel) "chan%d", _channel->channel
  203. #define EFX_TX_QUEUE_NAME(_tx_queue) "txq%d", _tx_queue->queue
  204. #define EFX_RX_QUEUE_NAME(_rx_queue) "rxq%d", _rx_queue->queue
  205. #define EFX_LOOPBACK_NAME(_mode, _counter) \
  206. "loopback.%s." _counter, STRING_TABLE_LOOKUP(_mode, efx_loopback_mode)
  207. /**
  208. * efx_fill_loopback_test - fill in a block of loopback self-test entries
  209. * @efx: Efx NIC
  210. * @lb_tests: Efx loopback self-test results structure
  211. * @mode: Loopback test mode
  212. * @test_index: Starting index of the test
  213. * @strings: Ethtool strings, or %NULL
  214. * @data: Ethtool test results, or %NULL
  215. */
  216. static int efx_fill_loopback_test(struct efx_nic *efx,
  217. struct efx_loopback_self_tests *lb_tests,
  218. enum efx_loopback_mode mode,
  219. unsigned int test_index,
  220. u8 *strings, u64 *data)
  221. {
  222. struct efx_channel *channel =
  223. efx_get_channel(efx, efx->tx_channel_offset);
  224. struct efx_tx_queue *tx_queue;
  225. efx_for_each_channel_tx_queue(tx_queue, channel) {
  226. efx_fill_test(test_index++, strings, data,
  227. &lb_tests->tx_sent[tx_queue->queue],
  228. EFX_TX_QUEUE_NAME(tx_queue),
  229. EFX_LOOPBACK_NAME(mode, "tx_sent"));
  230. efx_fill_test(test_index++, strings, data,
  231. &lb_tests->tx_done[tx_queue->queue],
  232. EFX_TX_QUEUE_NAME(tx_queue),
  233. EFX_LOOPBACK_NAME(mode, "tx_done"));
  234. }
  235. efx_fill_test(test_index++, strings, data,
  236. &lb_tests->rx_good,
  237. "rx", 0,
  238. EFX_LOOPBACK_NAME(mode, "rx_good"));
  239. efx_fill_test(test_index++, strings, data,
  240. &lb_tests->rx_bad,
  241. "rx", 0,
  242. EFX_LOOPBACK_NAME(mode, "rx_bad"));
  243. return test_index;
  244. }
  245. /**
  246. * efx_ethtool_fill_self_tests - get self-test details
  247. * @efx: Efx NIC
  248. * @tests: Efx self-test results structure, or %NULL
  249. * @strings: Ethtool strings, or %NULL
  250. * @data: Ethtool test results, or %NULL
  251. */
  252. static int efx_ethtool_fill_self_tests(struct efx_nic *efx,
  253. struct efx_self_tests *tests,
  254. u8 *strings, u64 *data)
  255. {
  256. struct efx_channel *channel;
  257. unsigned int n = 0, i;
  258. enum efx_loopback_mode mode;
  259. efx_fill_test(n++, strings, data, &tests->phy_alive,
  260. "phy", 0, "alive", NULL);
  261. efx_fill_test(n++, strings, data, &tests->nvram,
  262. "core", 0, "nvram", NULL);
  263. efx_fill_test(n++, strings, data, &tests->interrupt,
  264. "core", 0, "interrupt", NULL);
  265. /* Event queues */
  266. efx_for_each_channel(channel, efx) {
  267. efx_fill_test(n++, strings, data,
  268. &tests->eventq_dma[channel->channel],
  269. EFX_CHANNEL_NAME(channel),
  270. "eventq.dma", NULL);
  271. efx_fill_test(n++, strings, data,
  272. &tests->eventq_int[channel->channel],
  273. EFX_CHANNEL_NAME(channel),
  274. "eventq.int", NULL);
  275. }
  276. efx_fill_test(n++, strings, data, &tests->registers,
  277. "core", 0, "registers", NULL);
  278. if (efx->phy_op->run_tests != NULL) {
  279. EFX_BUG_ON_PARANOID(efx->phy_op->test_name == NULL);
  280. for (i = 0; true; ++i) {
  281. const char *name;
  282. EFX_BUG_ON_PARANOID(i >= EFX_MAX_PHY_TESTS);
  283. name = efx->phy_op->test_name(efx, i);
  284. if (name == NULL)
  285. break;
  286. efx_fill_test(n++, strings, data, &tests->phy_ext[i],
  287. "phy", 0, name, NULL);
  288. }
  289. }
  290. /* Loopback tests */
  291. for (mode = LOOPBACK_NONE; mode <= LOOPBACK_TEST_MAX; mode++) {
  292. if (!(efx->loopback_modes & (1 << mode)))
  293. continue;
  294. n = efx_fill_loopback_test(efx,
  295. &tests->loopback[mode], mode, n,
  296. strings, data);
  297. }
  298. return n;
  299. }
  300. static int efx_ethtool_get_sset_count(struct net_device *net_dev,
  301. int string_set)
  302. {
  303. struct efx_nic *efx = netdev_priv(net_dev);
  304. switch (string_set) {
  305. case ETH_SS_STATS:
  306. return efx->type->describe_stats(efx, NULL) +
  307. EFX_ETHTOOL_SW_STAT_COUNT;
  308. case ETH_SS_TEST:
  309. return efx_ethtool_fill_self_tests(efx, NULL, NULL, NULL);
  310. default:
  311. return -EINVAL;
  312. }
  313. }
  314. static void efx_ethtool_get_strings(struct net_device *net_dev,
  315. u32 string_set, u8 *strings)
  316. {
  317. struct efx_nic *efx = netdev_priv(net_dev);
  318. int i;
  319. switch (string_set) {
  320. case ETH_SS_STATS:
  321. strings += (efx->type->describe_stats(efx, strings) *
  322. ETH_GSTRING_LEN);
  323. for (i = 0; i < EFX_ETHTOOL_SW_STAT_COUNT; i++)
  324. strlcpy(strings + i * ETH_GSTRING_LEN,
  325. efx_sw_stat_desc[i].name, ETH_GSTRING_LEN);
  326. break;
  327. case ETH_SS_TEST:
  328. efx_ethtool_fill_self_tests(efx, NULL, strings, NULL);
  329. break;
  330. default:
  331. /* No other string sets */
  332. break;
  333. }
  334. }
  335. static void efx_ethtool_get_stats(struct net_device *net_dev,
  336. struct ethtool_stats *stats,
  337. u64 *data)
  338. {
  339. struct efx_nic *efx = netdev_priv(net_dev);
  340. const struct efx_sw_stat_desc *stat;
  341. struct efx_channel *channel;
  342. struct efx_tx_queue *tx_queue;
  343. int i;
  344. spin_lock_bh(&efx->stats_lock);
  345. /* Get NIC statistics */
  346. data += efx->type->update_stats(efx, data, NULL);
  347. /* Get software statistics */
  348. for (i = 0; i < EFX_ETHTOOL_SW_STAT_COUNT; i++) {
  349. stat = &efx_sw_stat_desc[i];
  350. switch (stat->source) {
  351. case EFX_ETHTOOL_STAT_SOURCE_nic:
  352. data[i] = stat->get_stat((void *)efx + stat->offset);
  353. break;
  354. case EFX_ETHTOOL_STAT_SOURCE_channel:
  355. data[i] = 0;
  356. efx_for_each_channel(channel, efx)
  357. data[i] += stat->get_stat((void *)channel +
  358. stat->offset);
  359. break;
  360. case EFX_ETHTOOL_STAT_SOURCE_tx_queue:
  361. data[i] = 0;
  362. efx_for_each_channel(channel, efx) {
  363. efx_for_each_channel_tx_queue(tx_queue, channel)
  364. data[i] +=
  365. stat->get_stat((void *)tx_queue
  366. + stat->offset);
  367. }
  368. break;
  369. }
  370. }
  371. spin_unlock_bh(&efx->stats_lock);
  372. }
  373. static void efx_ethtool_self_test(struct net_device *net_dev,
  374. struct ethtool_test *test, u64 *data)
  375. {
  376. struct efx_nic *efx = netdev_priv(net_dev);
  377. struct efx_self_tests *efx_tests;
  378. int already_up;
  379. int rc = -ENOMEM;
  380. efx_tests = kzalloc(sizeof(*efx_tests), GFP_KERNEL);
  381. if (!efx_tests)
  382. goto fail;
  383. if (efx->state != STATE_READY) {
  384. rc = -EIO;
  385. goto fail1;
  386. }
  387. netif_info(efx, drv, efx->net_dev, "starting %sline testing\n",
  388. (test->flags & ETH_TEST_FL_OFFLINE) ? "off" : "on");
  389. /* We need rx buffers and interrupts. */
  390. already_up = (efx->net_dev->flags & IFF_UP);
  391. if (!already_up) {
  392. rc = dev_open(efx->net_dev);
  393. if (rc) {
  394. netif_err(efx, drv, efx->net_dev,
  395. "failed opening device.\n");
  396. goto fail1;
  397. }
  398. }
  399. rc = efx_selftest(efx, efx_tests, test->flags);
  400. if (!already_up)
  401. dev_close(efx->net_dev);
  402. netif_info(efx, drv, efx->net_dev, "%s %sline self-tests\n",
  403. rc == 0 ? "passed" : "failed",
  404. (test->flags & ETH_TEST_FL_OFFLINE) ? "off" : "on");
  405. fail1:
  406. /* Fill ethtool results structures */
  407. efx_ethtool_fill_self_tests(efx, efx_tests, NULL, data);
  408. kfree(efx_tests);
  409. fail:
  410. if (rc)
  411. test->flags |= ETH_TEST_FL_FAILED;
  412. }
  413. /* Restart autonegotiation */
  414. static int efx_ethtool_nway_reset(struct net_device *net_dev)
  415. {
  416. struct efx_nic *efx = netdev_priv(net_dev);
  417. return mdio45_nway_restart(&efx->mdio);
  418. }
  419. /*
  420. * Each channel has a single IRQ and moderation timer, started by any
  421. * completion (or other event). Unless the module parameter
  422. * separate_tx_channels is set, IRQs and moderation are therefore
  423. * shared between RX and TX completions. In this case, when RX IRQ
  424. * moderation is explicitly changed then TX IRQ moderation is
  425. * automatically changed too, but otherwise we fail if the two values
  426. * are requested to be different.
  427. *
  428. * The hardware does not support a limit on the number of completions
  429. * before an IRQ, so we do not use the max_frames fields. We should
  430. * report and require that max_frames == (usecs != 0), but this would
  431. * invalidate existing user documentation.
  432. *
  433. * The hardware does not have distinct settings for interrupt
  434. * moderation while the previous IRQ is being handled, so we should
  435. * not use the 'irq' fields. However, an earlier developer
  436. * misunderstood the meaning of the 'irq' fields and the driver did
  437. * not support the standard fields. To avoid invalidating existing
  438. * user documentation, we report and accept changes through either the
  439. * standard or 'irq' fields. If both are changed at the same time, we
  440. * prefer the standard field.
  441. *
  442. * We implement adaptive IRQ moderation, but use a different algorithm
  443. * from that assumed in the definition of struct ethtool_coalesce.
  444. * Therefore we do not use any of the adaptive moderation parameters
  445. * in it.
  446. */
  447. static int efx_ethtool_get_coalesce(struct net_device *net_dev,
  448. struct ethtool_coalesce *coalesce)
  449. {
  450. struct efx_nic *efx = netdev_priv(net_dev);
  451. unsigned int tx_usecs, rx_usecs;
  452. bool rx_adaptive;
  453. efx_get_irq_moderation(efx, &tx_usecs, &rx_usecs, &rx_adaptive);
  454. coalesce->tx_coalesce_usecs = tx_usecs;
  455. coalesce->tx_coalesce_usecs_irq = tx_usecs;
  456. coalesce->rx_coalesce_usecs = rx_usecs;
  457. coalesce->rx_coalesce_usecs_irq = rx_usecs;
  458. coalesce->use_adaptive_rx_coalesce = rx_adaptive;
  459. return 0;
  460. }
  461. static int efx_ethtool_set_coalesce(struct net_device *net_dev,
  462. struct ethtool_coalesce *coalesce)
  463. {
  464. struct efx_nic *efx = netdev_priv(net_dev);
  465. struct efx_channel *channel;
  466. unsigned int tx_usecs, rx_usecs;
  467. bool adaptive, rx_may_override_tx;
  468. int rc;
  469. if (coalesce->use_adaptive_tx_coalesce)
  470. return -EINVAL;
  471. efx_get_irq_moderation(efx, &tx_usecs, &rx_usecs, &adaptive);
  472. if (coalesce->rx_coalesce_usecs != rx_usecs)
  473. rx_usecs = coalesce->rx_coalesce_usecs;
  474. else
  475. rx_usecs = coalesce->rx_coalesce_usecs_irq;
  476. adaptive = coalesce->use_adaptive_rx_coalesce;
  477. /* If channels are shared, TX IRQ moderation can be quietly
  478. * overridden unless it is changed from its old value.
  479. */
  480. rx_may_override_tx = (coalesce->tx_coalesce_usecs == tx_usecs &&
  481. coalesce->tx_coalesce_usecs_irq == tx_usecs);
  482. if (coalesce->tx_coalesce_usecs != tx_usecs)
  483. tx_usecs = coalesce->tx_coalesce_usecs;
  484. else
  485. tx_usecs = coalesce->tx_coalesce_usecs_irq;
  486. rc = efx_init_irq_moderation(efx, tx_usecs, rx_usecs, adaptive,
  487. rx_may_override_tx);
  488. if (rc != 0)
  489. return rc;
  490. efx_for_each_channel(channel, efx)
  491. efx->type->push_irq_moderation(channel);
  492. return 0;
  493. }
  494. static void efx_ethtool_get_ringparam(struct net_device *net_dev,
  495. struct ethtool_ringparam *ring)
  496. {
  497. struct efx_nic *efx = netdev_priv(net_dev);
  498. ring->rx_max_pending = EFX_MAX_DMAQ_SIZE;
  499. ring->tx_max_pending = EFX_MAX_DMAQ_SIZE;
  500. ring->rx_pending = efx->rxq_entries;
  501. ring->tx_pending = efx->txq_entries;
  502. }
  503. static int efx_ethtool_set_ringparam(struct net_device *net_dev,
  504. struct ethtool_ringparam *ring)
  505. {
  506. struct efx_nic *efx = netdev_priv(net_dev);
  507. u32 txq_entries;
  508. if (ring->rx_mini_pending || ring->rx_jumbo_pending ||
  509. ring->rx_pending > EFX_MAX_DMAQ_SIZE ||
  510. ring->tx_pending > EFX_MAX_DMAQ_SIZE)
  511. return -EINVAL;
  512. if (ring->rx_pending < EFX_RXQ_MIN_ENT) {
  513. netif_err(efx, drv, efx->net_dev,
  514. "RX queues cannot be smaller than %u\n",
  515. EFX_RXQ_MIN_ENT);
  516. return -EINVAL;
  517. }
  518. txq_entries = max(ring->tx_pending, EFX_TXQ_MIN_ENT(efx));
  519. if (txq_entries != ring->tx_pending)
  520. netif_warn(efx, drv, efx->net_dev,
  521. "increasing TX queue size to minimum of %u\n",
  522. txq_entries);
  523. return efx_realloc_channels(efx, ring->rx_pending, txq_entries);
  524. }
  525. static int efx_ethtool_set_pauseparam(struct net_device *net_dev,
  526. struct ethtool_pauseparam *pause)
  527. {
  528. struct efx_nic *efx = netdev_priv(net_dev);
  529. u8 wanted_fc, old_fc;
  530. u32 old_adv;
  531. int rc = 0;
  532. mutex_lock(&efx->mac_lock);
  533. wanted_fc = ((pause->rx_pause ? EFX_FC_RX : 0) |
  534. (pause->tx_pause ? EFX_FC_TX : 0) |
  535. (pause->autoneg ? EFX_FC_AUTO : 0));
  536. if ((wanted_fc & EFX_FC_TX) && !(wanted_fc & EFX_FC_RX)) {
  537. netif_dbg(efx, drv, efx->net_dev,
  538. "Flow control unsupported: tx ON rx OFF\n");
  539. rc = -EINVAL;
  540. goto out;
  541. }
  542. if ((wanted_fc & EFX_FC_AUTO) && !efx->link_advertising) {
  543. netif_dbg(efx, drv, efx->net_dev,
  544. "Autonegotiation is disabled\n");
  545. rc = -EINVAL;
  546. goto out;
  547. }
  548. /* Hook for Falcon bug 11482 workaround */
  549. if (efx->type->prepare_enable_fc_tx &&
  550. (wanted_fc & EFX_FC_TX) && !(efx->wanted_fc & EFX_FC_TX))
  551. efx->type->prepare_enable_fc_tx(efx);
  552. old_adv = efx->link_advertising;
  553. old_fc = efx->wanted_fc;
  554. efx_link_set_wanted_fc(efx, wanted_fc);
  555. if (efx->link_advertising != old_adv ||
  556. (efx->wanted_fc ^ old_fc) & EFX_FC_AUTO) {
  557. rc = efx->phy_op->reconfigure(efx);
  558. if (rc) {
  559. netif_err(efx, drv, efx->net_dev,
  560. "Unable to advertise requested flow "
  561. "control setting\n");
  562. goto out;
  563. }
  564. }
  565. /* Reconfigure the MAC. The PHY *may* generate a link state change event
  566. * if the user just changed the advertised capabilities, but there's no
  567. * harm doing this twice */
  568. efx->type->reconfigure_mac(efx);
  569. out:
  570. mutex_unlock(&efx->mac_lock);
  571. return rc;
  572. }
  573. static void efx_ethtool_get_pauseparam(struct net_device *net_dev,
  574. struct ethtool_pauseparam *pause)
  575. {
  576. struct efx_nic *efx = netdev_priv(net_dev);
  577. pause->rx_pause = !!(efx->wanted_fc & EFX_FC_RX);
  578. pause->tx_pause = !!(efx->wanted_fc & EFX_FC_TX);
  579. pause->autoneg = !!(efx->wanted_fc & EFX_FC_AUTO);
  580. }
  581. static void efx_ethtool_get_wol(struct net_device *net_dev,
  582. struct ethtool_wolinfo *wol)
  583. {
  584. struct efx_nic *efx = netdev_priv(net_dev);
  585. return efx->type->get_wol(efx, wol);
  586. }
  587. static int efx_ethtool_set_wol(struct net_device *net_dev,
  588. struct ethtool_wolinfo *wol)
  589. {
  590. struct efx_nic *efx = netdev_priv(net_dev);
  591. return efx->type->set_wol(efx, wol->wolopts);
  592. }
  593. static int efx_ethtool_reset(struct net_device *net_dev, u32 *flags)
  594. {
  595. struct efx_nic *efx = netdev_priv(net_dev);
  596. int rc;
  597. rc = efx->type->map_reset_flags(flags);
  598. if (rc < 0)
  599. return rc;
  600. return efx_reset(efx, rc);
  601. }
  602. /* MAC address mask including only I/G bit */
  603. static const u8 mac_addr_ig_mask[ETH_ALEN] = { 0x01, 0, 0, 0, 0, 0 };
  604. #define IP4_ADDR_FULL_MASK ((__force __be32)~0)
  605. #define PORT_FULL_MASK ((__force __be16)~0)
  606. #define ETHER_TYPE_FULL_MASK ((__force __be16)~0)
  607. static int efx_ethtool_get_class_rule(struct efx_nic *efx,
  608. struct ethtool_rx_flow_spec *rule)
  609. {
  610. struct ethtool_tcpip4_spec *ip_entry = &rule->h_u.tcp_ip4_spec;
  611. struct ethtool_tcpip4_spec *ip_mask = &rule->m_u.tcp_ip4_spec;
  612. struct ethhdr *mac_entry = &rule->h_u.ether_spec;
  613. struct ethhdr *mac_mask = &rule->m_u.ether_spec;
  614. struct efx_filter_spec spec;
  615. int rc;
  616. rc = efx_filter_get_filter_safe(efx, EFX_FILTER_PRI_MANUAL,
  617. rule->location, &spec);
  618. if (rc)
  619. return rc;
  620. if (spec.dmaq_id == EFX_FILTER_RX_DMAQ_ID_DROP)
  621. rule->ring_cookie = RX_CLS_FLOW_DISC;
  622. else
  623. rule->ring_cookie = spec.dmaq_id;
  624. if ((spec.match_flags & EFX_FILTER_MATCH_ETHER_TYPE) &&
  625. spec.ether_type == htons(ETH_P_IP) &&
  626. (spec.match_flags & EFX_FILTER_MATCH_IP_PROTO) &&
  627. (spec.ip_proto == IPPROTO_TCP || spec.ip_proto == IPPROTO_UDP) &&
  628. !(spec.match_flags &
  629. ~(EFX_FILTER_MATCH_ETHER_TYPE | EFX_FILTER_MATCH_OUTER_VID |
  630. EFX_FILTER_MATCH_LOC_HOST | EFX_FILTER_MATCH_REM_HOST |
  631. EFX_FILTER_MATCH_IP_PROTO |
  632. EFX_FILTER_MATCH_LOC_PORT | EFX_FILTER_MATCH_REM_PORT))) {
  633. rule->flow_type = ((spec.ip_proto == IPPROTO_TCP) ?
  634. TCP_V4_FLOW : UDP_V4_FLOW);
  635. if (spec.match_flags & EFX_FILTER_MATCH_LOC_HOST) {
  636. ip_entry->ip4dst = spec.loc_host[0];
  637. ip_mask->ip4dst = IP4_ADDR_FULL_MASK;
  638. }
  639. if (spec.match_flags & EFX_FILTER_MATCH_REM_HOST) {
  640. ip_entry->ip4src = spec.rem_host[0];
  641. ip_mask->ip4src = IP4_ADDR_FULL_MASK;
  642. }
  643. if (spec.match_flags & EFX_FILTER_MATCH_LOC_PORT) {
  644. ip_entry->pdst = spec.loc_port;
  645. ip_mask->pdst = PORT_FULL_MASK;
  646. }
  647. if (spec.match_flags & EFX_FILTER_MATCH_REM_PORT) {
  648. ip_entry->psrc = spec.rem_port;
  649. ip_mask->psrc = PORT_FULL_MASK;
  650. }
  651. } else if (!(spec.match_flags &
  652. ~(EFX_FILTER_MATCH_LOC_MAC | EFX_FILTER_MATCH_LOC_MAC_IG |
  653. EFX_FILTER_MATCH_REM_MAC | EFX_FILTER_MATCH_ETHER_TYPE |
  654. EFX_FILTER_MATCH_OUTER_VID))) {
  655. rule->flow_type = ETHER_FLOW;
  656. if (spec.match_flags &
  657. (EFX_FILTER_MATCH_LOC_MAC | EFX_FILTER_MATCH_LOC_MAC_IG)) {
  658. memcpy(mac_entry->h_dest, spec.loc_mac, ETH_ALEN);
  659. if (spec.match_flags & EFX_FILTER_MATCH_LOC_MAC)
  660. memset(mac_mask->h_dest, ~0, ETH_ALEN);
  661. else
  662. memcpy(mac_mask->h_dest, mac_addr_ig_mask,
  663. ETH_ALEN);
  664. }
  665. if (spec.match_flags & EFX_FILTER_MATCH_REM_MAC) {
  666. memcpy(mac_entry->h_source, spec.rem_mac, ETH_ALEN);
  667. memset(mac_mask->h_source, ~0, ETH_ALEN);
  668. }
  669. if (spec.match_flags & EFX_FILTER_MATCH_ETHER_TYPE) {
  670. mac_entry->h_proto = spec.ether_type;
  671. mac_mask->h_proto = ETHER_TYPE_FULL_MASK;
  672. }
  673. } else {
  674. /* The above should handle all filters that we insert */
  675. WARN_ON(1);
  676. return -EINVAL;
  677. }
  678. if (spec.match_flags & EFX_FILTER_MATCH_OUTER_VID) {
  679. rule->flow_type |= FLOW_EXT;
  680. rule->h_ext.vlan_tci = spec.outer_vid;
  681. rule->m_ext.vlan_tci = htons(0xfff);
  682. }
  683. return rc;
  684. }
  685. static int
  686. efx_ethtool_get_rxnfc(struct net_device *net_dev,
  687. struct ethtool_rxnfc *info, u32 *rule_locs)
  688. {
  689. struct efx_nic *efx = netdev_priv(net_dev);
  690. switch (info->cmd) {
  691. case ETHTOOL_GRXRINGS:
  692. info->data = efx->n_rx_channels;
  693. return 0;
  694. case ETHTOOL_GRXFH: {
  695. unsigned min_revision = 0;
  696. info->data = 0;
  697. switch (info->flow_type) {
  698. case TCP_V4_FLOW:
  699. info->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
  700. /* fall through */
  701. case UDP_V4_FLOW:
  702. case SCTP_V4_FLOW:
  703. case AH_ESP_V4_FLOW:
  704. case IPV4_FLOW:
  705. info->data |= RXH_IP_SRC | RXH_IP_DST;
  706. min_revision = EFX_REV_FALCON_B0;
  707. break;
  708. case TCP_V6_FLOW:
  709. info->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
  710. /* fall through */
  711. case UDP_V6_FLOW:
  712. case SCTP_V6_FLOW:
  713. case AH_ESP_V6_FLOW:
  714. case IPV6_FLOW:
  715. info->data |= RXH_IP_SRC | RXH_IP_DST;
  716. min_revision = EFX_REV_SIENA_A0;
  717. break;
  718. default:
  719. break;
  720. }
  721. if (efx_nic_rev(efx) < min_revision)
  722. info->data = 0;
  723. return 0;
  724. }
  725. case ETHTOOL_GRXCLSRLCNT:
  726. info->data = efx_filter_get_rx_id_limit(efx);
  727. if (info->data == 0)
  728. return -EOPNOTSUPP;
  729. info->data |= RX_CLS_LOC_SPECIAL;
  730. info->rule_cnt =
  731. efx_filter_count_rx_used(efx, EFX_FILTER_PRI_MANUAL);
  732. return 0;
  733. case ETHTOOL_GRXCLSRULE:
  734. if (efx_filter_get_rx_id_limit(efx) == 0)
  735. return -EOPNOTSUPP;
  736. return efx_ethtool_get_class_rule(efx, &info->fs);
  737. case ETHTOOL_GRXCLSRLALL: {
  738. s32 rc;
  739. info->data = efx_filter_get_rx_id_limit(efx);
  740. if (info->data == 0)
  741. return -EOPNOTSUPP;
  742. rc = efx_filter_get_rx_ids(efx, EFX_FILTER_PRI_MANUAL,
  743. rule_locs, info->rule_cnt);
  744. if (rc < 0)
  745. return rc;
  746. info->rule_cnt = rc;
  747. return 0;
  748. }
  749. default:
  750. return -EOPNOTSUPP;
  751. }
  752. }
  753. static int efx_ethtool_set_class_rule(struct efx_nic *efx,
  754. struct ethtool_rx_flow_spec *rule)
  755. {
  756. struct ethtool_tcpip4_spec *ip_entry = &rule->h_u.tcp_ip4_spec;
  757. struct ethtool_tcpip4_spec *ip_mask = &rule->m_u.tcp_ip4_spec;
  758. struct ethhdr *mac_entry = &rule->h_u.ether_spec;
  759. struct ethhdr *mac_mask = &rule->m_u.ether_spec;
  760. struct efx_filter_spec spec;
  761. int rc;
  762. /* Check that user wants us to choose the location */
  763. if (rule->location != RX_CLS_LOC_ANY)
  764. return -EINVAL;
  765. /* Range-check ring_cookie */
  766. if (rule->ring_cookie >= efx->n_rx_channels &&
  767. rule->ring_cookie != RX_CLS_FLOW_DISC)
  768. return -EINVAL;
  769. /* Check for unsupported extensions */
  770. if ((rule->flow_type & FLOW_EXT) &&
  771. (rule->m_ext.vlan_etype || rule->m_ext.data[0] ||
  772. rule->m_ext.data[1]))
  773. return -EINVAL;
  774. efx_filter_init_rx(&spec, EFX_FILTER_PRI_MANUAL,
  775. efx->rx_scatter ? EFX_FILTER_FLAG_RX_SCATTER : 0,
  776. (rule->ring_cookie == RX_CLS_FLOW_DISC) ?
  777. EFX_FILTER_RX_DMAQ_ID_DROP : rule->ring_cookie);
  778. switch (rule->flow_type & ~FLOW_EXT) {
  779. case TCP_V4_FLOW:
  780. case UDP_V4_FLOW:
  781. spec.match_flags = (EFX_FILTER_MATCH_ETHER_TYPE |
  782. EFX_FILTER_MATCH_IP_PROTO);
  783. spec.ether_type = htons(ETH_P_IP);
  784. spec.ip_proto = ((rule->flow_type & ~FLOW_EXT) == TCP_V4_FLOW ?
  785. IPPROTO_TCP : IPPROTO_UDP);
  786. if (ip_mask->ip4dst) {
  787. if (ip_mask->ip4dst != IP4_ADDR_FULL_MASK)
  788. return -EINVAL;
  789. spec.match_flags |= EFX_FILTER_MATCH_LOC_HOST;
  790. spec.loc_host[0] = ip_entry->ip4dst;
  791. }
  792. if (ip_mask->ip4src) {
  793. if (ip_mask->ip4src != IP4_ADDR_FULL_MASK)
  794. return -EINVAL;
  795. spec.match_flags |= EFX_FILTER_MATCH_REM_HOST;
  796. spec.rem_host[0] = ip_entry->ip4src;
  797. }
  798. if (ip_mask->pdst) {
  799. if (ip_mask->pdst != PORT_FULL_MASK)
  800. return -EINVAL;
  801. spec.match_flags |= EFX_FILTER_MATCH_LOC_PORT;
  802. spec.loc_port = ip_entry->pdst;
  803. }
  804. if (ip_mask->psrc) {
  805. if (ip_mask->psrc != PORT_FULL_MASK)
  806. return -EINVAL;
  807. spec.match_flags |= EFX_FILTER_MATCH_REM_PORT;
  808. spec.rem_port = ip_entry->psrc;
  809. }
  810. if (ip_mask->tos)
  811. return -EINVAL;
  812. break;
  813. case ETHER_FLOW:
  814. if (!is_zero_ether_addr(mac_mask->h_dest)) {
  815. if (ether_addr_equal(mac_mask->h_dest,
  816. mac_addr_ig_mask))
  817. spec.match_flags |= EFX_FILTER_MATCH_LOC_MAC_IG;
  818. else if (is_broadcast_ether_addr(mac_mask->h_dest))
  819. spec.match_flags |= EFX_FILTER_MATCH_LOC_MAC;
  820. else
  821. return -EINVAL;
  822. memcpy(spec.loc_mac, mac_entry->h_dest, ETH_ALEN);
  823. }
  824. if (!is_zero_ether_addr(mac_mask->h_source)) {
  825. if (!is_broadcast_ether_addr(mac_mask->h_source))
  826. return -EINVAL;
  827. spec.match_flags |= EFX_FILTER_MATCH_REM_MAC;
  828. memcpy(spec.rem_mac, mac_entry->h_source, ETH_ALEN);
  829. }
  830. if (mac_mask->h_proto) {
  831. if (mac_mask->h_proto != ETHER_TYPE_FULL_MASK)
  832. return -EINVAL;
  833. spec.match_flags |= EFX_FILTER_MATCH_ETHER_TYPE;
  834. spec.ether_type = mac_entry->h_proto;
  835. }
  836. break;
  837. default:
  838. return -EINVAL;
  839. }
  840. if ((rule->flow_type & FLOW_EXT) && rule->m_ext.vlan_tci) {
  841. if (rule->m_ext.vlan_tci != htons(0xfff))
  842. return -EINVAL;
  843. spec.match_flags |= EFX_FILTER_MATCH_OUTER_VID;
  844. spec.outer_vid = rule->h_ext.vlan_tci;
  845. }
  846. rc = efx_filter_insert_filter(efx, &spec, true);
  847. if (rc < 0)
  848. return rc;
  849. rule->location = rc;
  850. return 0;
  851. }
  852. static int efx_ethtool_set_rxnfc(struct net_device *net_dev,
  853. struct ethtool_rxnfc *info)
  854. {
  855. struct efx_nic *efx = netdev_priv(net_dev);
  856. if (efx_filter_get_rx_id_limit(efx) == 0)
  857. return -EOPNOTSUPP;
  858. switch (info->cmd) {
  859. case ETHTOOL_SRXCLSRLINS:
  860. return efx_ethtool_set_class_rule(efx, &info->fs);
  861. case ETHTOOL_SRXCLSRLDEL:
  862. return efx_filter_remove_id_safe(efx, EFX_FILTER_PRI_MANUAL,
  863. info->fs.location);
  864. default:
  865. return -EOPNOTSUPP;
  866. }
  867. }
  868. static u32 efx_ethtool_get_rxfh_indir_size(struct net_device *net_dev)
  869. {
  870. struct efx_nic *efx = netdev_priv(net_dev);
  871. return ((efx_nic_rev(efx) < EFX_REV_FALCON_B0 ||
  872. efx->n_rx_channels == 1) ?
  873. 0 : ARRAY_SIZE(efx->rx_indir_table));
  874. }
  875. static int efx_ethtool_get_rxfh_indir(struct net_device *net_dev, u32 *indir)
  876. {
  877. struct efx_nic *efx = netdev_priv(net_dev);
  878. memcpy(indir, efx->rx_indir_table, sizeof(efx->rx_indir_table));
  879. return 0;
  880. }
  881. static int efx_ethtool_set_rxfh_indir(struct net_device *net_dev,
  882. const u32 *indir)
  883. {
  884. struct efx_nic *efx = netdev_priv(net_dev);
  885. memcpy(efx->rx_indir_table, indir, sizeof(efx->rx_indir_table));
  886. efx_nic_push_rx_indir_table(efx);
  887. return 0;
  888. }
  889. int efx_ethtool_get_ts_info(struct net_device *net_dev,
  890. struct ethtool_ts_info *ts_info)
  891. {
  892. struct efx_nic *efx = netdev_priv(net_dev);
  893. /* Software capabilities */
  894. ts_info->so_timestamping = (SOF_TIMESTAMPING_RX_SOFTWARE |
  895. SOF_TIMESTAMPING_SOFTWARE);
  896. ts_info->phc_index = -1;
  897. efx_ptp_get_ts_info(efx, ts_info);
  898. return 0;
  899. }
  900. static int efx_ethtool_get_module_eeprom(struct net_device *net_dev,
  901. struct ethtool_eeprom *ee,
  902. u8 *data)
  903. {
  904. struct efx_nic *efx = netdev_priv(net_dev);
  905. int ret;
  906. if (!efx->phy_op || !efx->phy_op->get_module_eeprom)
  907. return -EOPNOTSUPP;
  908. mutex_lock(&efx->mac_lock);
  909. ret = efx->phy_op->get_module_eeprom(efx, ee, data);
  910. mutex_unlock(&efx->mac_lock);
  911. return ret;
  912. }
  913. static int efx_ethtool_get_module_info(struct net_device *net_dev,
  914. struct ethtool_modinfo *modinfo)
  915. {
  916. struct efx_nic *efx = netdev_priv(net_dev);
  917. int ret;
  918. if (!efx->phy_op || !efx->phy_op->get_module_info)
  919. return -EOPNOTSUPP;
  920. mutex_lock(&efx->mac_lock);
  921. ret = efx->phy_op->get_module_info(efx, modinfo);
  922. mutex_unlock(&efx->mac_lock);
  923. return ret;
  924. }
  925. const struct ethtool_ops efx_ethtool_ops = {
  926. .get_settings = efx_ethtool_get_settings,
  927. .set_settings = efx_ethtool_set_settings,
  928. .get_drvinfo = efx_ethtool_get_drvinfo,
  929. .get_regs_len = efx_ethtool_get_regs_len,
  930. .get_regs = efx_ethtool_get_regs,
  931. .get_msglevel = efx_ethtool_get_msglevel,
  932. .set_msglevel = efx_ethtool_set_msglevel,
  933. .nway_reset = efx_ethtool_nway_reset,
  934. .get_link = ethtool_op_get_link,
  935. .get_coalesce = efx_ethtool_get_coalesce,
  936. .set_coalesce = efx_ethtool_set_coalesce,
  937. .get_ringparam = efx_ethtool_get_ringparam,
  938. .set_ringparam = efx_ethtool_set_ringparam,
  939. .get_pauseparam = efx_ethtool_get_pauseparam,
  940. .set_pauseparam = efx_ethtool_set_pauseparam,
  941. .get_sset_count = efx_ethtool_get_sset_count,
  942. .self_test = efx_ethtool_self_test,
  943. .get_strings = efx_ethtool_get_strings,
  944. .set_phys_id = efx_ethtool_phys_id,
  945. .get_ethtool_stats = efx_ethtool_get_stats,
  946. .get_wol = efx_ethtool_get_wol,
  947. .set_wol = efx_ethtool_set_wol,
  948. .reset = efx_ethtool_reset,
  949. .get_rxnfc = efx_ethtool_get_rxnfc,
  950. .set_rxnfc = efx_ethtool_set_rxnfc,
  951. .get_rxfh_indir_size = efx_ethtool_get_rxfh_indir_size,
  952. .get_rxfh_indir = efx_ethtool_get_rxfh_indir,
  953. .set_rxfh_indir = efx_ethtool_set_rxfh_indir,
  954. .get_ts_info = efx_ethtool_get_ts_info,
  955. .get_module_info = efx_ethtool_get_module_info,
  956. .get_module_eeprom = efx_ethtool_get_module_eeprom,
  957. };