2 * Linux driver for VMware's vmxnet3 ethernet NIC.
4 * Copyright (C) 2008-2009, VMware, Inc. All Rights Reserved.
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.
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
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.
20 * The full GNU General Public License is included in this distribution in
21 * the file called "COPYING".
23 * Maintained by: Shreyas Bhatewara <pv-drivers@vmware.com>
28 #include "vmxnet3_int.h"
30 struct vmxnet3_stat_desc {
31 char desc[ETH_GSTRING_LEN];
37 vmxnet3_get_rx_csum(struct net_device *netdev)
39 struct vmxnet3_adapter *adapter = netdev_priv(netdev);
40 return adapter->rxcsum;
45 vmxnet3_set_rx_csum(struct net_device *netdev, u32 val)
47 struct vmxnet3_adapter *adapter = netdev_priv(netdev);
50 if (adapter->rxcsum != val) {
51 adapter->rxcsum = val;
52 if (netif_running(netdev)) {
54 adapter->shared->devRead.misc.uptFeatures |=
57 adapter->shared->devRead.misc.uptFeatures &=
60 spin_lock_irqsave(&adapter->cmd_lock, flags);
61 VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD,
62 VMXNET3_CMD_UPDATE_FEATURE);
63 spin_unlock_irqrestore(&adapter->cmd_lock, flags);
70 /* per tq stats maintained by the device */
71 static const struct vmxnet3_stat_desc
72 vmxnet3_tq_dev_stats[] = {
73 /* description, offset */
75 { " TSO pkts tx", offsetof(struct UPT1_TxStats, TSOPktsTxOK) },
76 { " TSO bytes tx", offsetof(struct UPT1_TxStats, TSOBytesTxOK) },
77 { " ucast pkts tx", offsetof(struct UPT1_TxStats, ucastPktsTxOK) },
78 { " ucast bytes tx", offsetof(struct UPT1_TxStats, ucastBytesTxOK) },
79 { " mcast pkts tx", offsetof(struct UPT1_TxStats, mcastPktsTxOK) },
80 { " mcast bytes tx", offsetof(struct UPT1_TxStats, mcastBytesTxOK) },
81 { " bcast pkts tx", offsetof(struct UPT1_TxStats, bcastPktsTxOK) },
82 { " bcast bytes tx", offsetof(struct UPT1_TxStats, bcastBytesTxOK) },
83 { " pkts tx err", offsetof(struct UPT1_TxStats, pktsTxError) },
84 { " pkts tx discard", offsetof(struct UPT1_TxStats, pktsTxDiscard) },
87 /* per tq stats maintained by the driver */
88 static const struct vmxnet3_stat_desc
89 vmxnet3_tq_driver_stats[] = {
90 /* description, offset */
91 {" drv dropped tx total", offsetof(struct vmxnet3_tq_driver_stats,
93 { " too many frags", offsetof(struct vmxnet3_tq_driver_stats,
94 drop_too_many_frags) },
95 { " giant hdr", offsetof(struct vmxnet3_tq_driver_stats,
96 drop_oversized_hdr) },
97 { " hdr err", offsetof(struct vmxnet3_tq_driver_stats,
98 drop_hdr_inspect_err) },
99 { " tso", offsetof(struct vmxnet3_tq_driver_stats,
101 { " ring full", offsetof(struct vmxnet3_tq_driver_stats,
103 { " pkts linearized", offsetof(struct vmxnet3_tq_driver_stats,
105 { " hdr cloned", offsetof(struct vmxnet3_tq_driver_stats,
107 { " giant hdr", offsetof(struct vmxnet3_tq_driver_stats,
111 /* per rq stats maintained by the device */
112 static const struct vmxnet3_stat_desc
113 vmxnet3_rq_dev_stats[] = {
115 { " LRO pkts rx", offsetof(struct UPT1_RxStats, LROPktsRxOK) },
116 { " LRO byte rx", offsetof(struct UPT1_RxStats, LROBytesRxOK) },
117 { " ucast pkts rx", offsetof(struct UPT1_RxStats, ucastPktsRxOK) },
118 { " ucast bytes rx", offsetof(struct UPT1_RxStats, ucastBytesRxOK) },
119 { " mcast pkts rx", offsetof(struct UPT1_RxStats, mcastPktsRxOK) },
120 { " mcast bytes rx", offsetof(struct UPT1_RxStats, mcastBytesRxOK) },
121 { " bcast pkts rx", offsetof(struct UPT1_RxStats, bcastPktsRxOK) },
122 { " bcast bytes rx", offsetof(struct UPT1_RxStats, bcastBytesRxOK) },
123 { " pkts rx OOB", offsetof(struct UPT1_RxStats, pktsRxOutOfBuf) },
124 { " pkts rx err", offsetof(struct UPT1_RxStats, pktsRxError) },
127 /* per rq stats maintained by the driver */
128 static const struct vmxnet3_stat_desc
129 vmxnet3_rq_driver_stats[] = {
130 /* description, offset */
131 { " drv dropped rx total", offsetof(struct vmxnet3_rq_driver_stats,
133 { " err", offsetof(struct vmxnet3_rq_driver_stats,
135 { " fcs", offsetof(struct vmxnet3_rq_driver_stats,
137 { " rx buf alloc fail", offsetof(struct vmxnet3_rq_driver_stats,
138 rx_buf_alloc_failure) },
141 /* gloabl stats maintained by the driver */
142 static const struct vmxnet3_stat_desc
143 vmxnet3_global_stats[] = {
144 /* description, offset */
145 { "tx timeout count", offsetof(struct vmxnet3_adapter,
150 struct net_device_stats *
151 vmxnet3_get_stats(struct net_device *netdev)
153 struct vmxnet3_adapter *adapter;
154 struct vmxnet3_tq_driver_stats *drvTxStats;
155 struct vmxnet3_rq_driver_stats *drvRxStats;
156 struct UPT1_TxStats *devTxStats;
157 struct UPT1_RxStats *devRxStats;
158 struct net_device_stats *net_stats = &netdev->stats;
162 adapter = netdev_priv(netdev);
164 /* Collect the dev stats into the shared area */
165 spin_lock_irqsave(&adapter->cmd_lock, flags);
166 VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, VMXNET3_CMD_GET_STATS);
167 spin_unlock_irqrestore(&adapter->cmd_lock, flags);
169 memset(net_stats, 0, sizeof(*net_stats));
170 for (i = 0; i < adapter->num_tx_queues; i++) {
171 devTxStats = &adapter->tqd_start[i].stats;
172 drvTxStats = &adapter->tx_queue[i].stats;
173 net_stats->tx_packets += devTxStats->ucastPktsTxOK +
174 devTxStats->mcastPktsTxOK +
175 devTxStats->bcastPktsTxOK;
176 net_stats->tx_bytes += devTxStats->ucastBytesTxOK +
177 devTxStats->mcastBytesTxOK +
178 devTxStats->bcastBytesTxOK;
179 net_stats->tx_errors += devTxStats->pktsTxError;
180 net_stats->tx_dropped += drvTxStats->drop_total;
183 for (i = 0; i < adapter->num_rx_queues; i++) {
184 devRxStats = &adapter->rqd_start[i].stats;
185 drvRxStats = &adapter->rx_queue[i].stats;
186 net_stats->rx_packets += devRxStats->ucastPktsRxOK +
187 devRxStats->mcastPktsRxOK +
188 devRxStats->bcastPktsRxOK;
190 net_stats->rx_bytes += devRxStats->ucastBytesRxOK +
191 devRxStats->mcastBytesRxOK +
192 devRxStats->bcastBytesRxOK;
194 net_stats->rx_errors += devRxStats->pktsRxError;
195 net_stats->rx_dropped += drvRxStats->drop_total;
196 net_stats->multicast += devRxStats->mcastPktsRxOK;
202 vmxnet3_get_sset_count(struct net_device *netdev, int sset)
204 struct vmxnet3_adapter *adapter = netdev_priv(netdev);
207 return (ARRAY_SIZE(vmxnet3_tq_dev_stats) +
208 ARRAY_SIZE(vmxnet3_tq_driver_stats)) *
209 adapter->num_tx_queues +
210 (ARRAY_SIZE(vmxnet3_rq_dev_stats) +
211 ARRAY_SIZE(vmxnet3_rq_driver_stats)) *
212 adapter->num_rx_queues +
213 ARRAY_SIZE(vmxnet3_global_stats);
220 /* Should be multiple of 4 */
221 #define NUM_TX_REGS 8
222 #define NUM_RX_REGS 12
225 vmxnet3_get_regs_len(struct net_device *netdev)
227 struct vmxnet3_adapter *adapter = netdev_priv(netdev);
228 return (adapter->num_tx_queues * NUM_TX_REGS * sizeof(u32) +
229 adapter->num_rx_queues * NUM_RX_REGS * sizeof(u32));
234 vmxnet3_get_drvinfo(struct net_device *netdev, struct ethtool_drvinfo *drvinfo)
236 struct vmxnet3_adapter *adapter = netdev_priv(netdev);
238 strlcpy(drvinfo->driver, vmxnet3_driver_name, sizeof(drvinfo->driver));
239 drvinfo->driver[sizeof(drvinfo->driver) - 1] = '\0';
241 strlcpy(drvinfo->version, VMXNET3_DRIVER_VERSION_REPORT,
242 sizeof(drvinfo->version));
243 drvinfo->driver[sizeof(drvinfo->version) - 1] = '\0';
245 strlcpy(drvinfo->fw_version, "N/A", sizeof(drvinfo->fw_version));
246 drvinfo->fw_version[sizeof(drvinfo->fw_version) - 1] = '\0';
248 strlcpy(drvinfo->bus_info, pci_name(adapter->pdev),
249 ETHTOOL_BUSINFO_LEN);
250 drvinfo->n_stats = vmxnet3_get_sset_count(netdev, ETH_SS_STATS);
251 drvinfo->testinfo_len = 0;
252 drvinfo->eedump_len = 0;
253 drvinfo->regdump_len = vmxnet3_get_regs_len(netdev);
258 vmxnet3_get_strings(struct net_device *netdev, u32 stringset, u8 *buf)
260 struct vmxnet3_adapter *adapter = netdev_priv(netdev);
261 if (stringset == ETH_SS_STATS) {
263 for (j = 0; j < adapter->num_tx_queues; j++) {
264 for (i = 0; i < ARRAY_SIZE(vmxnet3_tq_dev_stats); i++) {
265 memcpy(buf, vmxnet3_tq_dev_stats[i].desc,
267 buf += ETH_GSTRING_LEN;
269 for (i = 0; i < ARRAY_SIZE(vmxnet3_tq_driver_stats);
271 memcpy(buf, vmxnet3_tq_driver_stats[i].desc,
273 buf += ETH_GSTRING_LEN;
277 for (j = 0; j < adapter->num_rx_queues; j++) {
278 for (i = 0; i < ARRAY_SIZE(vmxnet3_rq_dev_stats); i++) {
279 memcpy(buf, vmxnet3_rq_dev_stats[i].desc,
281 buf += ETH_GSTRING_LEN;
283 for (i = 0; i < ARRAY_SIZE(vmxnet3_rq_driver_stats);
285 memcpy(buf, vmxnet3_rq_driver_stats[i].desc,
287 buf += ETH_GSTRING_LEN;
291 for (i = 0; i < ARRAY_SIZE(vmxnet3_global_stats); i++) {
292 memcpy(buf, vmxnet3_global_stats[i].desc,
294 buf += ETH_GSTRING_LEN;
300 vmxnet3_set_flags(struct net_device *netdev, u32 data)
302 struct vmxnet3_adapter *adapter = netdev_priv(netdev);
303 u8 lro_requested = (data & ETH_FLAG_LRO) == 0 ? 0 : 1;
304 u8 lro_present = (netdev->features & NETIF_F_LRO) == 0 ? 0 : 1;
307 if (ethtool_invalid_flags(netdev, data, ETH_FLAG_LRO))
310 if (lro_requested ^ lro_present) {
311 /* toggle the LRO feature*/
312 netdev->features ^= NETIF_F_LRO;
314 /* Update private LRO flag */
315 adapter->lro = lro_requested;
317 /* update harware LRO capability accordingly */
319 adapter->shared->devRead.misc.uptFeatures |=
322 adapter->shared->devRead.misc.uptFeatures &=
324 spin_lock_irqsave(&adapter->cmd_lock, flags);
325 VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD,
326 VMXNET3_CMD_UPDATE_FEATURE);
327 spin_unlock_irqrestore(&adapter->cmd_lock, flags);
333 vmxnet3_get_ethtool_stats(struct net_device *netdev,
334 struct ethtool_stats *stats, u64 *buf)
336 struct vmxnet3_adapter *adapter = netdev_priv(netdev);
342 spin_lock_irqsave(&adapter->cmd_lock, flags);
343 VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, VMXNET3_CMD_GET_STATS);
344 spin_unlock_irqrestore(&adapter->cmd_lock, flags);
346 /* this does assume each counter is 64-bit wide */
347 for (j = 0; j < adapter->num_tx_queues; j++) {
348 base = (u8 *)&adapter->tqd_start[j].stats;
350 for (i = 1; i < ARRAY_SIZE(vmxnet3_tq_dev_stats); i++)
351 *buf++ = *(u64 *)(base +
352 vmxnet3_tq_dev_stats[i].offset);
354 base = (u8 *)&adapter->tx_queue[j].stats;
355 for (i = 0; i < ARRAY_SIZE(vmxnet3_tq_driver_stats); i++)
356 *buf++ = *(u64 *)(base +
357 vmxnet3_tq_driver_stats[i].offset);
360 for (j = 0; j < adapter->num_tx_queues; j++) {
361 base = (u8 *)&adapter->rqd_start[j].stats;
363 for (i = 1; i < ARRAY_SIZE(vmxnet3_rq_dev_stats); i++)
364 *buf++ = *(u64 *)(base +
365 vmxnet3_rq_dev_stats[i].offset);
367 base = (u8 *)&adapter->rx_queue[j].stats;
368 for (i = 0; i < ARRAY_SIZE(vmxnet3_rq_driver_stats); i++)
369 *buf++ = *(u64 *)(base +
370 vmxnet3_rq_driver_stats[i].offset);
373 base = (u8 *)adapter;
374 for (i = 0; i < ARRAY_SIZE(vmxnet3_global_stats); i++)
375 *buf++ = *(u64 *)(base + vmxnet3_global_stats[i].offset);
380 vmxnet3_get_regs(struct net_device *netdev, struct ethtool_regs *regs, void *p)
382 struct vmxnet3_adapter *adapter = netdev_priv(netdev);
386 memset(p, 0, vmxnet3_get_regs_len(netdev));
390 /* Update vmxnet3_get_regs_len if we want to dump more registers */
392 /* make each ring use multiple of 16 bytes */
393 for (i = 0; i < adapter->num_tx_queues; i++) {
394 buf[j++] = adapter->tx_queue[i].tx_ring.next2fill;
395 buf[j++] = adapter->tx_queue[i].tx_ring.next2comp;
396 buf[j++] = adapter->tx_queue[i].tx_ring.gen;
399 buf[j++] = adapter->tx_queue[i].comp_ring.next2proc;
400 buf[j++] = adapter->tx_queue[i].comp_ring.gen;
401 buf[j++] = adapter->tx_queue[i].stopped;
405 for (i = 0; i < adapter->num_rx_queues; i++) {
406 buf[j++] = adapter->rx_queue[i].rx_ring[0].next2fill;
407 buf[j++] = adapter->rx_queue[i].rx_ring[0].next2comp;
408 buf[j++] = adapter->rx_queue[i].rx_ring[0].gen;
411 buf[j++] = adapter->rx_queue[i].rx_ring[1].next2fill;
412 buf[j++] = adapter->rx_queue[i].rx_ring[1].next2comp;
413 buf[j++] = adapter->rx_queue[i].rx_ring[1].gen;
416 buf[j++] = adapter->rx_queue[i].comp_ring.next2proc;
417 buf[j++] = adapter->rx_queue[i].comp_ring.gen;
426 vmxnet3_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
428 struct vmxnet3_adapter *adapter = netdev_priv(netdev);
430 wol->supported = WAKE_UCAST | WAKE_ARP | WAKE_MAGIC;
431 wol->wolopts = adapter->wol;
436 vmxnet3_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
438 struct vmxnet3_adapter *adapter = netdev_priv(netdev);
440 if (wol->wolopts & (WAKE_PHY | WAKE_MCAST | WAKE_BCAST |
445 adapter->wol = wol->wolopts;
447 device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol);
454 vmxnet3_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
456 struct vmxnet3_adapter *adapter = netdev_priv(netdev);
458 ecmd->supported = SUPPORTED_10000baseT_Full | SUPPORTED_1000baseT_Full |
460 ecmd->advertising = ADVERTISED_TP;
461 ecmd->port = PORT_TP;
462 ecmd->transceiver = XCVR_INTERNAL;
464 if (adapter->link_speed) {
465 ecmd->speed = adapter->link_speed;
466 ecmd->duplex = DUPLEX_FULL;
476 vmxnet3_get_ringparam(struct net_device *netdev,
477 struct ethtool_ringparam *param)
479 struct vmxnet3_adapter *adapter = netdev_priv(netdev);
481 param->rx_max_pending = VMXNET3_RX_RING_MAX_SIZE;
482 param->tx_max_pending = VMXNET3_TX_RING_MAX_SIZE;
483 param->rx_mini_max_pending = 0;
484 param->rx_jumbo_max_pending = 0;
486 param->rx_pending = adapter->rx_queue[0].rx_ring[0].size *
487 adapter->num_rx_queues;
488 param->tx_pending = adapter->tx_queue[0].tx_ring.size *
489 adapter->num_tx_queues;
490 param->rx_mini_pending = 0;
491 param->rx_jumbo_pending = 0;
496 vmxnet3_set_ringparam(struct net_device *netdev,
497 struct ethtool_ringparam *param)
499 struct vmxnet3_adapter *adapter = netdev_priv(netdev);
500 u32 new_tx_ring_size, new_rx_ring_size;
504 if (param->tx_pending == 0 || param->tx_pending >
505 VMXNET3_TX_RING_MAX_SIZE)
508 if (param->rx_pending == 0 || param->rx_pending >
509 VMXNET3_RX_RING_MAX_SIZE)
513 /* round it up to a multiple of VMXNET3_RING_SIZE_ALIGN */
514 new_tx_ring_size = (param->tx_pending + VMXNET3_RING_SIZE_MASK) &
515 ~VMXNET3_RING_SIZE_MASK;
516 new_tx_ring_size = min_t(u32, new_tx_ring_size,
517 VMXNET3_TX_RING_MAX_SIZE);
518 if (new_tx_ring_size > VMXNET3_TX_RING_MAX_SIZE || (new_tx_ring_size %
519 VMXNET3_RING_SIZE_ALIGN) != 0)
522 /* ring0 has to be a multiple of
523 * rx_buf_per_pkt * VMXNET3_RING_SIZE_ALIGN
525 sz = adapter->rx_buf_per_pkt * VMXNET3_RING_SIZE_ALIGN;
526 new_rx_ring_size = (param->rx_pending + sz - 1) / sz * sz;
527 new_rx_ring_size = min_t(u32, new_rx_ring_size,
528 VMXNET3_RX_RING_MAX_SIZE / sz * sz);
529 if (new_rx_ring_size > VMXNET3_RX_RING_MAX_SIZE || (new_rx_ring_size %
533 if (new_tx_ring_size == adapter->tx_queue[0].tx_ring.size &&
534 new_rx_ring_size == adapter->rx_queue[0].rx_ring[0].size) {
539 * Reset_work may be in the middle of resetting the device, wait for its
542 while (test_and_set_bit(VMXNET3_STATE_BIT_RESETTING, &adapter->state))
545 if (netif_running(netdev)) {
546 vmxnet3_quiesce_dev(adapter);
547 vmxnet3_reset_dev(adapter);
549 /* recreate the rx queue and the tx queue based on the
551 vmxnet3_tq_destroy_all(adapter);
552 vmxnet3_rq_destroy_all(adapter);
554 err = vmxnet3_create_queues(adapter, new_tx_ring_size,
555 new_rx_ring_size, VMXNET3_DEF_RX_RING_SIZE);
558 /* failed, most likely because of OOM, try default
560 printk(KERN_ERR "%s: failed to apply new sizes, try the"
561 " default ones\n", netdev->name);
562 err = vmxnet3_create_queues(adapter,
563 VMXNET3_DEF_TX_RING_SIZE,
564 VMXNET3_DEF_RX_RING_SIZE,
565 VMXNET3_DEF_RX_RING_SIZE);
567 printk(KERN_ERR "%s: failed to create queues "
568 "with default sizes. Closing it\n",
574 err = vmxnet3_activate_dev(adapter);
576 printk(KERN_ERR "%s: failed to re-activate, error %d."
577 " Closing it\n", netdev->name, err);
581 clear_bit(VMXNET3_STATE_BIT_RESETTING, &adapter->state);
583 vmxnet3_force_close(adapter);
590 vmxnet3_get_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *info,
593 struct vmxnet3_adapter *adapter = netdev_priv(netdev);
595 case ETHTOOL_GRXRINGS:
596 info->data = adapter->num_rx_queues;
604 vmxnet3_get_rss_indir(struct net_device *netdev,
605 struct ethtool_rxfh_indir *p)
607 struct vmxnet3_adapter *adapter = netdev_priv(netdev);
608 struct UPT1_RSSConf *rssConf = adapter->rss_conf;
609 unsigned int n = min_t(unsigned int, p->size, rssConf->indTableSize);
611 p->size = rssConf->indTableSize;
613 p->ring_index[n] = rssConf->indTable[n];
619 vmxnet3_set_rss_indir(struct net_device *netdev,
620 const struct ethtool_rxfh_indir *p)
624 struct vmxnet3_adapter *adapter = netdev_priv(netdev);
625 struct UPT1_RSSConf *rssConf = adapter->rss_conf;
627 if (p->size != rssConf->indTableSize)
629 for (i = 0; i < rssConf->indTableSize; i++) {
631 * Return with error code if any of the queue indices
634 if (p->ring_index[i] < 0 ||
635 p->ring_index[i] >= adapter->num_rx_queues)
639 for (i = 0; i < rssConf->indTableSize; i++)
640 rssConf->indTable[i] = p->ring_index[i];
642 spin_lock_irqsave(&adapter->cmd_lock, flags);
643 VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD,
644 VMXNET3_CMD_UPDATE_RSSIDT);
645 spin_unlock_irqrestore(&adapter->cmd_lock, flags);
652 static struct ethtool_ops vmxnet3_ethtool_ops = {
653 .get_settings = vmxnet3_get_settings,
654 .get_drvinfo = vmxnet3_get_drvinfo,
655 .get_regs_len = vmxnet3_get_regs_len,
656 .get_regs = vmxnet3_get_regs,
657 .get_wol = vmxnet3_get_wol,
658 .set_wol = vmxnet3_set_wol,
659 .get_link = ethtool_op_get_link,
660 .get_rx_csum = vmxnet3_get_rx_csum,
661 .set_rx_csum = vmxnet3_set_rx_csum,
662 .get_tx_csum = ethtool_op_get_tx_csum,
663 .set_tx_csum = ethtool_op_set_tx_hw_csum,
664 .get_sg = ethtool_op_get_sg,
665 .set_sg = ethtool_op_set_sg,
666 .get_tso = ethtool_op_get_tso,
667 .set_tso = ethtool_op_set_tso,
668 .get_strings = vmxnet3_get_strings,
669 .get_flags = ethtool_op_get_flags,
670 .set_flags = vmxnet3_set_flags,
671 .get_sset_count = vmxnet3_get_sset_count,
672 .get_ethtool_stats = vmxnet3_get_ethtool_stats,
673 .get_ringparam = vmxnet3_get_ringparam,
674 .set_ringparam = vmxnet3_set_ringparam,
675 .get_rxnfc = vmxnet3_get_rxnfc,
677 .get_rxfh_indir = vmxnet3_get_rss_indir,
678 .set_rxfh_indir = vmxnet3_set_rss_indir,
682 void vmxnet3_set_ethtool_ops(struct net_device *netdev)
684 SET_ETHTOOL_OPS(netdev, &vmxnet3_ethtool_ops);