blob: 8a71a21d53ec678977598bb918373a93074a6146 [file] [log] [blame]
Shreyas Bhatewarad1a890fa2009-10-13 00:15:51 -07001/*
2 * Linux driver for VMware's vmxnet3 ethernet NIC.
3 *
4 * Copyright (C) 2008-2009, VMware, Inc. All Rights Reserved.
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 as published by the
8 * Free Software Foundation; version 2 of the License and no later version.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
13 * NON INFRINGEMENT. See the GNU General Public License for more
14 * details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * The full GNU General Public License is included in this distribution in
21 * the file called "COPYING".
22 *
23 * Maintained by: Shreyas Bhatewara <pv-drivers@vmware.com>
24 *
25 */
26
27
28#include "vmxnet3_int.h"
29
30struct vmxnet3_stat_desc {
31 char desc[ETH_GSTRING_LEN];
32 int offset;
33};
34
35
36static u32
37vmxnet3_get_rx_csum(struct net_device *netdev)
38{
39 struct vmxnet3_adapter *adapter = netdev_priv(netdev);
40 return adapter->rxcsum;
41}
42
43
44static int
45vmxnet3_set_rx_csum(struct net_device *netdev, u32 val)
46{
47 struct vmxnet3_adapter *adapter = netdev_priv(netdev);
48
49 if (adapter->rxcsum != val) {
50 adapter->rxcsum = val;
51 if (netif_running(netdev)) {
52 if (val)
Shreyas Bhatewara115924b2009-11-16 13:41:33 +000053 set_flag_le64(
54 &adapter->shared->devRead.misc.uptFeatures,
55 UPT1_F_RXCSUM);
Shreyas Bhatewarad1a890fa2009-10-13 00:15:51 -070056 else
Shreyas Bhatewara115924b2009-11-16 13:41:33 +000057 reset_flag_le64(
58 &adapter->shared->devRead.misc.uptFeatures,
59 UPT1_F_RXCSUM);
Shreyas Bhatewarad1a890fa2009-10-13 00:15:51 -070060
61 VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD,
62 VMXNET3_CMD_UPDATE_FEATURE);
63 }
64 }
65 return 0;
66}
67
68
69/* per tq stats maintained by the device */
70static const struct vmxnet3_stat_desc
71vmxnet3_tq_dev_stats[] = {
72 /* description, offset */
73 { "TSO pkts tx", offsetof(struct UPT1_TxStats, TSOPktsTxOK) },
74 { "TSO bytes tx", offsetof(struct UPT1_TxStats, TSOBytesTxOK) },
75 { "ucast pkts tx", offsetof(struct UPT1_TxStats, ucastPktsTxOK) },
76 { "ucast bytes tx", offsetof(struct UPT1_TxStats, ucastBytesTxOK) },
77 { "mcast pkts tx", offsetof(struct UPT1_TxStats, mcastPktsTxOK) },
78 { "mcast bytes tx", offsetof(struct UPT1_TxStats, mcastBytesTxOK) },
79 { "bcast pkts tx", offsetof(struct UPT1_TxStats, bcastPktsTxOK) },
80 { "bcast bytes tx", offsetof(struct UPT1_TxStats, bcastBytesTxOK) },
81 { "pkts tx err", offsetof(struct UPT1_TxStats, pktsTxError) },
82 { "pkts tx discard", offsetof(struct UPT1_TxStats, pktsTxDiscard) },
83};
84
85/* per tq stats maintained by the driver */
86static const struct vmxnet3_stat_desc
87vmxnet3_tq_driver_stats[] = {
88 /* description, offset */
89 {"drv dropped tx total", offsetof(struct vmxnet3_tq_driver_stats,
90 drop_total) },
91 { " too many frags", offsetof(struct vmxnet3_tq_driver_stats,
92 drop_too_many_frags) },
93 { " giant hdr", offsetof(struct vmxnet3_tq_driver_stats,
94 drop_oversized_hdr) },
95 { " hdr err", offsetof(struct vmxnet3_tq_driver_stats,
96 drop_hdr_inspect_err) },
97 { " tso", offsetof(struct vmxnet3_tq_driver_stats,
98 drop_tso) },
99 { "ring full", offsetof(struct vmxnet3_tq_driver_stats,
100 tx_ring_full) },
101 { "pkts linearized", offsetof(struct vmxnet3_tq_driver_stats,
102 linearized) },
103 { "hdr cloned", offsetof(struct vmxnet3_tq_driver_stats,
104 copy_skb_header) },
105 { "giant hdr", offsetof(struct vmxnet3_tq_driver_stats,
106 oversized_hdr) },
107};
108
109/* per rq stats maintained by the device */
110static const struct vmxnet3_stat_desc
111vmxnet3_rq_dev_stats[] = {
112 { "LRO pkts rx", offsetof(struct UPT1_RxStats, LROPktsRxOK) },
113 { "LRO byte rx", offsetof(struct UPT1_RxStats, LROBytesRxOK) },
114 { "ucast pkts rx", offsetof(struct UPT1_RxStats, ucastPktsRxOK) },
115 { "ucast bytes rx", offsetof(struct UPT1_RxStats, ucastBytesRxOK) },
116 { "mcast pkts rx", offsetof(struct UPT1_RxStats, mcastPktsRxOK) },
117 { "mcast bytes rx", offsetof(struct UPT1_RxStats, mcastBytesRxOK) },
118 { "bcast pkts rx", offsetof(struct UPT1_RxStats, bcastPktsRxOK) },
119 { "bcast bytes rx", offsetof(struct UPT1_RxStats, bcastBytesRxOK) },
120 { "pkts rx out of buf", offsetof(struct UPT1_RxStats, pktsRxOutOfBuf) },
121 { "pkts rx err", offsetof(struct UPT1_RxStats, pktsRxError) },
122};
123
124/* per rq stats maintained by the driver */
125static const struct vmxnet3_stat_desc
126vmxnet3_rq_driver_stats[] = {
127 /* description, offset */
128 { "drv dropped rx total", offsetof(struct vmxnet3_rq_driver_stats,
129 drop_total) },
130 { " err", offsetof(struct vmxnet3_rq_driver_stats,
131 drop_err) },
132 { " fcs", offsetof(struct vmxnet3_rq_driver_stats,
133 drop_fcs) },
134 { "rx buf alloc fail", offsetof(struct vmxnet3_rq_driver_stats,
135 rx_buf_alloc_failure) },
136};
137
138/* gloabl stats maintained by the driver */
139static const struct vmxnet3_stat_desc
140vmxnet3_global_stats[] = {
141 /* description, offset */
142 { "tx timeout count", offsetof(struct vmxnet3_adapter,
143 tx_timeout_count) }
144};
145
146
147struct net_device_stats *
148vmxnet3_get_stats(struct net_device *netdev)
149{
150 struct vmxnet3_adapter *adapter;
151 struct vmxnet3_tq_driver_stats *drvTxStats;
152 struct vmxnet3_rq_driver_stats *drvRxStats;
153 struct UPT1_TxStats *devTxStats;
154 struct UPT1_RxStats *devRxStats;
155 struct net_device_stats *net_stats = &netdev->stats;
156
157 adapter = netdev_priv(netdev);
158
159 /* Collect the dev stats into the shared area */
160 VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, VMXNET3_CMD_GET_STATS);
161
162 /* Assuming that we have a single queue device */
163 devTxStats = &adapter->tqd_start->stats;
164 devRxStats = &adapter->rqd_start->stats;
165
166 /* Get access to the driver stats per queue */
167 drvTxStats = &adapter->tx_queue.stats;
168 drvRxStats = &adapter->rx_queue.stats;
169
170 memset(net_stats, 0, sizeof(*net_stats));
171
172 net_stats->rx_packets = devRxStats->ucastPktsRxOK +
173 devRxStats->mcastPktsRxOK +
174 devRxStats->bcastPktsRxOK;
175
176 net_stats->tx_packets = devTxStats->ucastPktsTxOK +
177 devTxStats->mcastPktsTxOK +
178 devTxStats->bcastPktsTxOK;
179
180 net_stats->rx_bytes = devRxStats->ucastBytesRxOK +
181 devRxStats->mcastBytesRxOK +
182 devRxStats->bcastBytesRxOK;
183
184 net_stats->tx_bytes = devTxStats->ucastBytesTxOK +
185 devTxStats->mcastBytesTxOK +
186 devTxStats->bcastBytesTxOK;
187
188 net_stats->rx_errors = devRxStats->pktsRxError;
189 net_stats->tx_errors = devTxStats->pktsTxError;
190 net_stats->rx_dropped = drvRxStats->drop_total;
191 net_stats->tx_dropped = drvTxStats->drop_total;
192 net_stats->multicast = devRxStats->mcastPktsRxOK;
193
194 return net_stats;
195}
196
197static int
198vmxnet3_get_sset_count(struct net_device *netdev, int sset)
199{
200 switch (sset) {
201 case ETH_SS_STATS:
202 return ARRAY_SIZE(vmxnet3_tq_dev_stats) +
203 ARRAY_SIZE(vmxnet3_tq_driver_stats) +
204 ARRAY_SIZE(vmxnet3_rq_dev_stats) +
205 ARRAY_SIZE(vmxnet3_rq_driver_stats) +
206 ARRAY_SIZE(vmxnet3_global_stats);
207 default:
208 return -EOPNOTSUPP;
209 }
210}
211
212
213static int
214vmxnet3_get_regs_len(struct net_device *netdev)
215{
216 return 20 * sizeof(u32);
217}
218
219
220static void
221vmxnet3_get_drvinfo(struct net_device *netdev, struct ethtool_drvinfo *drvinfo)
222{
223 struct vmxnet3_adapter *adapter = netdev_priv(netdev);
224
225 strlcpy(drvinfo->driver, vmxnet3_driver_name, sizeof(drvinfo->driver));
226 drvinfo->driver[sizeof(drvinfo->driver) - 1] = '\0';
227
228 strlcpy(drvinfo->version, VMXNET3_DRIVER_VERSION_REPORT,
229 sizeof(drvinfo->version));
230 drvinfo->driver[sizeof(drvinfo->version) - 1] = '\0';
231
232 strlcpy(drvinfo->fw_version, "N/A", sizeof(drvinfo->fw_version));
233 drvinfo->fw_version[sizeof(drvinfo->fw_version) - 1] = '\0';
234
235 strlcpy(drvinfo->bus_info, pci_name(adapter->pdev),
236 ETHTOOL_BUSINFO_LEN);
237 drvinfo->n_stats = vmxnet3_get_sset_count(netdev, ETH_SS_STATS);
238 drvinfo->testinfo_len = 0;
239 drvinfo->eedump_len = 0;
240 drvinfo->regdump_len = vmxnet3_get_regs_len(netdev);
241}
242
243
244static void
245vmxnet3_get_strings(struct net_device *netdev, u32 stringset, u8 *buf)
246{
247 if (stringset == ETH_SS_STATS) {
248 int i;
249
250 for (i = 0; i < ARRAY_SIZE(vmxnet3_tq_dev_stats); i++) {
251 memcpy(buf, vmxnet3_tq_dev_stats[i].desc,
252 ETH_GSTRING_LEN);
253 buf += ETH_GSTRING_LEN;
254 }
255 for (i = 0; i < ARRAY_SIZE(vmxnet3_tq_driver_stats); i++) {
256 memcpy(buf, vmxnet3_tq_driver_stats[i].desc,
257 ETH_GSTRING_LEN);
258 buf += ETH_GSTRING_LEN;
259 }
260 for (i = 0; i < ARRAY_SIZE(vmxnet3_rq_dev_stats); i++) {
261 memcpy(buf, vmxnet3_rq_dev_stats[i].desc,
262 ETH_GSTRING_LEN);
263 buf += ETH_GSTRING_LEN;
264 }
265 for (i = 0; i < ARRAY_SIZE(vmxnet3_rq_driver_stats); i++) {
266 memcpy(buf, vmxnet3_rq_driver_stats[i].desc,
267 ETH_GSTRING_LEN);
268 buf += ETH_GSTRING_LEN;
269 }
270 for (i = 0; i < ARRAY_SIZE(vmxnet3_global_stats); i++) {
271 memcpy(buf, vmxnet3_global_stats[i].desc,
272 ETH_GSTRING_LEN);
273 buf += ETH_GSTRING_LEN;
274 }
275 }
276}
277
278static u32
Stanislaw Gruszkad92be4b2010-06-27 23:29:42 +0000279vmxnet3_get_flags(struct net_device *netdev)
280{
Shreyas Bhatewarad1a890fa2009-10-13 00:15:51 -0700281 return netdev->features;
282}
283
284static int
Stanislaw Gruszkad92be4b2010-06-27 23:29:42 +0000285vmxnet3_set_flags(struct net_device *netdev, u32 data)
286{
Shreyas Bhatewarad1a890fa2009-10-13 00:15:51 -0700287 struct vmxnet3_adapter *adapter = netdev_priv(netdev);
288 u8 lro_requested = (data & ETH_FLAG_LRO) == 0 ? 0 : 1;
289 u8 lro_present = (netdev->features & NETIF_F_LRO) == 0 ? 0 : 1;
290
Stanislaw Gruszkad92be4b2010-06-27 23:29:42 +0000291 if (data & ~ETH_FLAG_LRO)
292 return -EOPNOTSUPP;
293
Shreyas Bhatewarad1a890fa2009-10-13 00:15:51 -0700294 if (lro_requested ^ lro_present) {
295 /* toggle the LRO feature*/
296 netdev->features ^= NETIF_F_LRO;
297
298 /* update harware LRO capability accordingly */
299 if (lro_requested)
300 adapter->shared->devRead.misc.uptFeatures &= UPT1_F_LRO;
301 else
302 adapter->shared->devRead.misc.uptFeatures &=
303 ~UPT1_F_LRO;
304 VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD,
305 VMXNET3_CMD_UPDATE_FEATURE);
306 }
307 return 0;
308}
309
310static void
311vmxnet3_get_ethtool_stats(struct net_device *netdev,
312 struct ethtool_stats *stats, u64 *buf)
313{
314 struct vmxnet3_adapter *adapter = netdev_priv(netdev);
315 u8 *base;
316 int i;
317
318 VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, VMXNET3_CMD_GET_STATS);
319
320 /* this does assume each counter is 64-bit wide */
321
322 base = (u8 *)&adapter->tqd_start->stats;
323 for (i = 0; i < ARRAY_SIZE(vmxnet3_tq_dev_stats); i++)
324 *buf++ = *(u64 *)(base + vmxnet3_tq_dev_stats[i].offset);
325
326 base = (u8 *)&adapter->tx_queue.stats;
327 for (i = 0; i < ARRAY_SIZE(vmxnet3_tq_driver_stats); i++)
328 *buf++ = *(u64 *)(base + vmxnet3_tq_driver_stats[i].offset);
329
330 base = (u8 *)&adapter->rqd_start->stats;
331 for (i = 0; i < ARRAY_SIZE(vmxnet3_rq_dev_stats); i++)
332 *buf++ = *(u64 *)(base + vmxnet3_rq_dev_stats[i].offset);
333
334 base = (u8 *)&adapter->rx_queue.stats;
335 for (i = 0; i < ARRAY_SIZE(vmxnet3_rq_driver_stats); i++)
336 *buf++ = *(u64 *)(base + vmxnet3_rq_driver_stats[i].offset);
337
338 base = (u8 *)adapter;
339 for (i = 0; i < ARRAY_SIZE(vmxnet3_global_stats); i++)
340 *buf++ = *(u64 *)(base + vmxnet3_global_stats[i].offset);
341}
342
343
344static void
345vmxnet3_get_regs(struct net_device *netdev, struct ethtool_regs *regs, void *p)
346{
347 struct vmxnet3_adapter *adapter = netdev_priv(netdev);
348 u32 *buf = p;
349
350 memset(p, 0, vmxnet3_get_regs_len(netdev));
351
352 regs->version = 1;
353
354 /* Update vmxnet3_get_regs_len if we want to dump more registers */
355
356 /* make each ring use multiple of 16 bytes */
357 buf[0] = adapter->tx_queue.tx_ring.next2fill;
358 buf[1] = adapter->tx_queue.tx_ring.next2comp;
359 buf[2] = adapter->tx_queue.tx_ring.gen;
360 buf[3] = 0;
361
362 buf[4] = adapter->tx_queue.comp_ring.next2proc;
363 buf[5] = adapter->tx_queue.comp_ring.gen;
364 buf[6] = adapter->tx_queue.stopped;
365 buf[7] = 0;
366
367 buf[8] = adapter->rx_queue.rx_ring[0].next2fill;
368 buf[9] = adapter->rx_queue.rx_ring[0].next2comp;
369 buf[10] = adapter->rx_queue.rx_ring[0].gen;
370 buf[11] = 0;
371
372 buf[12] = adapter->rx_queue.rx_ring[1].next2fill;
373 buf[13] = adapter->rx_queue.rx_ring[1].next2comp;
374 buf[14] = adapter->rx_queue.rx_ring[1].gen;
375 buf[15] = 0;
376
377 buf[16] = adapter->rx_queue.comp_ring.next2proc;
378 buf[17] = adapter->rx_queue.comp_ring.gen;
379 buf[18] = 0;
380 buf[19] = 0;
381}
382
383
384static void
385vmxnet3_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
386{
387 struct vmxnet3_adapter *adapter = netdev_priv(netdev);
388
389 wol->supported = WAKE_UCAST | WAKE_ARP | WAKE_MAGIC;
390 wol->wolopts = adapter->wol;
391}
392
393
394static int
395vmxnet3_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
396{
397 struct vmxnet3_adapter *adapter = netdev_priv(netdev);
398
399 if (wol->wolopts & (WAKE_PHY | WAKE_MCAST | WAKE_BCAST |
400 WAKE_MAGICSECURE)) {
401 return -EOPNOTSUPP;
402 }
403
404 adapter->wol = wol->wolopts;
405
406 device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol);
407
408 return 0;
409}
410
411
412static int
413vmxnet3_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
414{
415 struct vmxnet3_adapter *adapter = netdev_priv(netdev);
416
417 ecmd->supported = SUPPORTED_10000baseT_Full | SUPPORTED_1000baseT_Full |
418 SUPPORTED_TP;
419 ecmd->advertising = ADVERTISED_TP;
420 ecmd->port = PORT_TP;
421 ecmd->transceiver = XCVR_INTERNAL;
422
423 if (adapter->link_speed) {
424 ecmd->speed = adapter->link_speed;
425 ecmd->duplex = DUPLEX_FULL;
426 } else {
427 ecmd->speed = -1;
428 ecmd->duplex = -1;
429 }
430 return 0;
431}
432
433
434static void
435vmxnet3_get_ringparam(struct net_device *netdev,
436 struct ethtool_ringparam *param)
437{
438 struct vmxnet3_adapter *adapter = netdev_priv(netdev);
439
440 param->rx_max_pending = VMXNET3_RX_RING_MAX_SIZE;
441 param->tx_max_pending = VMXNET3_TX_RING_MAX_SIZE;
442 param->rx_mini_max_pending = 0;
443 param->rx_jumbo_max_pending = 0;
444
445 param->rx_pending = adapter->rx_queue.rx_ring[0].size;
446 param->tx_pending = adapter->tx_queue.tx_ring.size;
447 param->rx_mini_pending = 0;
448 param->rx_jumbo_pending = 0;
449}
450
451
452static int
453vmxnet3_set_ringparam(struct net_device *netdev,
454 struct ethtool_ringparam *param)
455{
456 struct vmxnet3_adapter *adapter = netdev_priv(netdev);
457 u32 new_tx_ring_size, new_rx_ring_size;
458 u32 sz;
459 int err = 0;
460
461 if (param->tx_pending == 0 || param->tx_pending >
462 VMXNET3_TX_RING_MAX_SIZE)
463 return -EINVAL;
464
465 if (param->rx_pending == 0 || param->rx_pending >
466 VMXNET3_RX_RING_MAX_SIZE)
467 return -EINVAL;
468
469
470 /* round it up to a multiple of VMXNET3_RING_SIZE_ALIGN */
471 new_tx_ring_size = (param->tx_pending + VMXNET3_RING_SIZE_MASK) &
472 ~VMXNET3_RING_SIZE_MASK;
473 new_tx_ring_size = min_t(u32, new_tx_ring_size,
474 VMXNET3_TX_RING_MAX_SIZE);
475 if (new_tx_ring_size > VMXNET3_TX_RING_MAX_SIZE || (new_tx_ring_size %
476 VMXNET3_RING_SIZE_ALIGN) != 0)
477 return -EINVAL;
478
479 /* ring0 has to be a multiple of
480 * rx_buf_per_pkt * VMXNET3_RING_SIZE_ALIGN
481 */
482 sz = adapter->rx_buf_per_pkt * VMXNET3_RING_SIZE_ALIGN;
483 new_rx_ring_size = (param->rx_pending + sz - 1) / sz * sz;
484 new_rx_ring_size = min_t(u32, new_rx_ring_size,
485 VMXNET3_RX_RING_MAX_SIZE / sz * sz);
486 if (new_rx_ring_size > VMXNET3_RX_RING_MAX_SIZE || (new_rx_ring_size %
487 sz) != 0)
488 return -EINVAL;
489
490 if (new_tx_ring_size == adapter->tx_queue.tx_ring.size &&
491 new_rx_ring_size == adapter->rx_queue.rx_ring[0].size) {
492 return 0;
493 }
494
495 /*
496 * Reset_work may be in the middle of resetting the device, wait for its
497 * completion.
498 */
499 while (test_and_set_bit(VMXNET3_STATE_BIT_RESETTING, &adapter->state))
500 msleep(1);
501
502 if (netif_running(netdev)) {
503 vmxnet3_quiesce_dev(adapter);
504 vmxnet3_reset_dev(adapter);
505
506 /* recreate the rx queue and the tx queue based on the
507 * new sizes */
508 vmxnet3_tq_destroy(&adapter->tx_queue, adapter);
509 vmxnet3_rq_destroy(&adapter->rx_queue, adapter);
510
511 err = vmxnet3_create_queues(adapter, new_tx_ring_size,
512 new_rx_ring_size, VMXNET3_DEF_RX_RING_SIZE);
513 if (err) {
514 /* failed, most likely because of OOM, try default
515 * size */
516 printk(KERN_ERR "%s: failed to apply new sizes, try the"
517 " default ones\n", netdev->name);
518 err = vmxnet3_create_queues(adapter,
519 VMXNET3_DEF_TX_RING_SIZE,
520 VMXNET3_DEF_RX_RING_SIZE,
521 VMXNET3_DEF_RX_RING_SIZE);
522 if (err) {
523 printk(KERN_ERR "%s: failed to create queues "
524 "with default sizes. Closing it\n",
525 netdev->name);
526 goto out;
527 }
528 }
529
530 err = vmxnet3_activate_dev(adapter);
531 if (err)
532 printk(KERN_ERR "%s: failed to re-activate, error %d."
533 " Closing it\n", netdev->name, err);
534 }
535
536out:
537 clear_bit(VMXNET3_STATE_BIT_RESETTING, &adapter->state);
538 if (err)
539 vmxnet3_force_close(adapter);
540
541 return err;
542}
543
544
545static struct ethtool_ops vmxnet3_ethtool_ops = {
546 .get_settings = vmxnet3_get_settings,
547 .get_drvinfo = vmxnet3_get_drvinfo,
548 .get_regs_len = vmxnet3_get_regs_len,
549 .get_regs = vmxnet3_get_regs,
550 .get_wol = vmxnet3_get_wol,
551 .set_wol = vmxnet3_set_wol,
552 .get_link = ethtool_op_get_link,
553 .get_rx_csum = vmxnet3_get_rx_csum,
554 .set_rx_csum = vmxnet3_set_rx_csum,
555 .get_tx_csum = ethtool_op_get_tx_csum,
556 .set_tx_csum = ethtool_op_set_tx_hw_csum,
557 .get_sg = ethtool_op_get_sg,
558 .set_sg = ethtool_op_set_sg,
559 .get_tso = ethtool_op_get_tso,
560 .set_tso = ethtool_op_set_tso,
561 .get_strings = vmxnet3_get_strings,
562 .get_flags = vmxnet3_get_flags,
563 .set_flags = vmxnet3_set_flags,
564 .get_sset_count = vmxnet3_get_sset_count,
565 .get_ethtool_stats = vmxnet3_get_ethtool_stats,
566 .get_ringparam = vmxnet3_get_ringparam,
567 .set_ringparam = vmxnet3_set_ringparam,
568};
569
570void vmxnet3_set_ethtool_ops(struct net_device *netdev)
571{
572 SET_ETHTOOL_OPS(netdev, &vmxnet3_ethtool_ops);
573}