ethtool.c 31 KB

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