ethtool.c 31 KB

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