2 * Linux driver for VMware's vmxnet3 ethernet NIC.
4 * Copyright (C) 2008-2020, 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: pv-drivers@vmware.com
28 #include "vmxnet3_int.h"
30 struct vmxnet3_stat_desc
{
31 char desc
[ETH_GSTRING_LEN
];
36 /* per tq stats maintained by the device */
37 static const struct vmxnet3_stat_desc
38 vmxnet3_tq_dev_stats
[] = {
39 /* description, offset */
41 { " TSO pkts tx", offsetof(struct UPT1_TxStats
, TSOPktsTxOK
) },
42 { " TSO bytes tx", offsetof(struct UPT1_TxStats
, TSOBytesTxOK
) },
43 { " ucast pkts tx", offsetof(struct UPT1_TxStats
, ucastPktsTxOK
) },
44 { " ucast bytes tx", offsetof(struct UPT1_TxStats
, ucastBytesTxOK
) },
45 { " mcast pkts tx", offsetof(struct UPT1_TxStats
, mcastPktsTxOK
) },
46 { " mcast bytes tx", offsetof(struct UPT1_TxStats
, mcastBytesTxOK
) },
47 { " bcast pkts tx", offsetof(struct UPT1_TxStats
, bcastPktsTxOK
) },
48 { " bcast bytes tx", offsetof(struct UPT1_TxStats
, bcastBytesTxOK
) },
49 { " pkts tx err", offsetof(struct UPT1_TxStats
, pktsTxError
) },
50 { " pkts tx discard", offsetof(struct UPT1_TxStats
, pktsTxDiscard
) },
53 /* per tq stats maintained by the driver */
54 static const struct vmxnet3_stat_desc
55 vmxnet3_tq_driver_stats
[] = {
56 /* description, offset */
57 {" drv dropped tx total", offsetof(struct vmxnet3_tq_driver_stats
,
59 { " too many frags", offsetof(struct vmxnet3_tq_driver_stats
,
60 drop_too_many_frags
) },
61 { " giant hdr", offsetof(struct vmxnet3_tq_driver_stats
,
62 drop_oversized_hdr
) },
63 { " hdr err", offsetof(struct vmxnet3_tq_driver_stats
,
64 drop_hdr_inspect_err
) },
65 { " tso", offsetof(struct vmxnet3_tq_driver_stats
,
67 { " ring full", offsetof(struct vmxnet3_tq_driver_stats
,
69 { " pkts linearized", offsetof(struct vmxnet3_tq_driver_stats
,
71 { " hdr cloned", offsetof(struct vmxnet3_tq_driver_stats
,
73 { " giant hdr", offsetof(struct vmxnet3_tq_driver_stats
,
77 /* per rq stats maintained by the device */
78 static const struct vmxnet3_stat_desc
79 vmxnet3_rq_dev_stats
[] = {
81 { " LRO pkts rx", offsetof(struct UPT1_RxStats
, LROPktsRxOK
) },
82 { " LRO byte rx", offsetof(struct UPT1_RxStats
, LROBytesRxOK
) },
83 { " ucast pkts rx", offsetof(struct UPT1_RxStats
, ucastPktsRxOK
) },
84 { " ucast bytes rx", offsetof(struct UPT1_RxStats
, ucastBytesRxOK
) },
85 { " mcast pkts rx", offsetof(struct UPT1_RxStats
, mcastPktsRxOK
) },
86 { " mcast bytes rx", offsetof(struct UPT1_RxStats
, mcastBytesRxOK
) },
87 { " bcast pkts rx", offsetof(struct UPT1_RxStats
, bcastPktsRxOK
) },
88 { " bcast bytes rx", offsetof(struct UPT1_RxStats
, bcastBytesRxOK
) },
89 { " pkts rx OOB", offsetof(struct UPT1_RxStats
, pktsRxOutOfBuf
) },
90 { " pkts rx err", offsetof(struct UPT1_RxStats
, pktsRxError
) },
93 /* per rq stats maintained by the driver */
94 static const struct vmxnet3_stat_desc
95 vmxnet3_rq_driver_stats
[] = {
96 /* description, offset */
97 { " drv dropped rx total", offsetof(struct vmxnet3_rq_driver_stats
,
99 { " err", offsetof(struct vmxnet3_rq_driver_stats
,
101 { " fcs", offsetof(struct vmxnet3_rq_driver_stats
,
103 { " rx buf alloc fail", offsetof(struct vmxnet3_rq_driver_stats
,
104 rx_buf_alloc_failure
) },
107 /* global stats maintained by the driver */
108 static const struct vmxnet3_stat_desc
109 vmxnet3_global_stats
[] = {
110 /* description, offset */
111 { "tx timeout count", offsetof(struct vmxnet3_adapter
,
117 vmxnet3_get_stats64(struct net_device
*netdev
,
118 struct rtnl_link_stats64
*stats
)
120 struct vmxnet3_adapter
*adapter
;
121 struct vmxnet3_tq_driver_stats
*drvTxStats
;
122 struct vmxnet3_rq_driver_stats
*drvRxStats
;
123 struct UPT1_TxStats
*devTxStats
;
124 struct UPT1_RxStats
*devRxStats
;
128 adapter
= netdev_priv(netdev
);
130 /* Collect the dev stats into the shared area */
131 spin_lock_irqsave(&adapter
->cmd_lock
, flags
);
132 VMXNET3_WRITE_BAR1_REG(adapter
, VMXNET3_REG_CMD
, VMXNET3_CMD_GET_STATS
);
133 spin_unlock_irqrestore(&adapter
->cmd_lock
, flags
);
135 for (i
= 0; i
< adapter
->num_tx_queues
; i
++) {
136 devTxStats
= &adapter
->tqd_start
[i
].stats
;
137 drvTxStats
= &adapter
->tx_queue
[i
].stats
;
138 stats
->tx_packets
+= devTxStats
->ucastPktsTxOK
+
139 devTxStats
->mcastPktsTxOK
+
140 devTxStats
->bcastPktsTxOK
;
141 stats
->tx_bytes
+= devTxStats
->ucastBytesTxOK
+
142 devTxStats
->mcastBytesTxOK
+
143 devTxStats
->bcastBytesTxOK
;
144 stats
->tx_errors
+= devTxStats
->pktsTxError
;
145 stats
->tx_dropped
+= drvTxStats
->drop_total
;
148 for (i
= 0; i
< adapter
->num_rx_queues
; i
++) {
149 devRxStats
= &adapter
->rqd_start
[i
].stats
;
150 drvRxStats
= &adapter
->rx_queue
[i
].stats
;
151 stats
->rx_packets
+= devRxStats
->ucastPktsRxOK
+
152 devRxStats
->mcastPktsRxOK
+
153 devRxStats
->bcastPktsRxOK
;
155 stats
->rx_bytes
+= devRxStats
->ucastBytesRxOK
+
156 devRxStats
->mcastBytesRxOK
+
157 devRxStats
->bcastBytesRxOK
;
159 stats
->rx_errors
+= devRxStats
->pktsRxError
;
160 stats
->rx_dropped
+= drvRxStats
->drop_total
;
161 stats
->multicast
+= devRxStats
->mcastPktsRxOK
;
166 vmxnet3_get_sset_count(struct net_device
*netdev
, int sset
)
168 struct vmxnet3_adapter
*adapter
= netdev_priv(netdev
);
171 return (ARRAY_SIZE(vmxnet3_tq_dev_stats
) +
172 ARRAY_SIZE(vmxnet3_tq_driver_stats
)) *
173 adapter
->num_tx_queues
+
174 (ARRAY_SIZE(vmxnet3_rq_dev_stats
) +
175 ARRAY_SIZE(vmxnet3_rq_driver_stats
)) *
176 adapter
->num_rx_queues
+
177 ARRAY_SIZE(vmxnet3_global_stats
);
184 /* This is a version 2 of the vmxnet3 ethtool_regs which goes hand in hand with
185 * the version 2 of the vmxnet3 support for ethtool(8) --register-dump.
186 * Therefore, if any registers are added, removed or modified, then a version
187 * bump and a corresponding change in the vmxnet3 support for ethtool(8)
188 * --register-dump would be required.
191 vmxnet3_get_regs_len(struct net_device
*netdev
)
193 struct vmxnet3_adapter
*adapter
= netdev_priv(netdev
);
195 return ((9 /* BAR1 registers */ +
196 (1 + adapter
->intr
.num_intrs
) +
197 (1 + adapter
->num_tx_queues
* 17 /* Tx queue registers */) +
198 (1 + adapter
->num_rx_queues
* 23 /* Rx queue registers */)) *
204 vmxnet3_get_drvinfo(struct net_device
*netdev
, struct ethtool_drvinfo
*drvinfo
)
206 struct vmxnet3_adapter
*adapter
= netdev_priv(netdev
);
208 strlcpy(drvinfo
->driver
, vmxnet3_driver_name
, sizeof(drvinfo
->driver
));
210 strlcpy(drvinfo
->version
, VMXNET3_DRIVER_VERSION_REPORT
,
211 sizeof(drvinfo
->version
));
213 strlcpy(drvinfo
->bus_info
, pci_name(adapter
->pdev
),
214 sizeof(drvinfo
->bus_info
));
219 vmxnet3_get_strings(struct net_device
*netdev
, u32 stringset
, u8
*buf
)
221 struct vmxnet3_adapter
*adapter
= netdev_priv(netdev
);
222 if (stringset
== ETH_SS_STATS
) {
224 for (j
= 0; j
< adapter
->num_tx_queues
; j
++) {
225 for (i
= 0; i
< ARRAY_SIZE(vmxnet3_tq_dev_stats
); i
++) {
226 memcpy(buf
, vmxnet3_tq_dev_stats
[i
].desc
,
228 buf
+= ETH_GSTRING_LEN
;
230 for (i
= 0; i
< ARRAY_SIZE(vmxnet3_tq_driver_stats
);
232 memcpy(buf
, vmxnet3_tq_driver_stats
[i
].desc
,
234 buf
+= ETH_GSTRING_LEN
;
238 for (j
= 0; j
< adapter
->num_rx_queues
; j
++) {
239 for (i
= 0; i
< ARRAY_SIZE(vmxnet3_rq_dev_stats
); i
++) {
240 memcpy(buf
, vmxnet3_rq_dev_stats
[i
].desc
,
242 buf
+= ETH_GSTRING_LEN
;
244 for (i
= 0; i
< ARRAY_SIZE(vmxnet3_rq_driver_stats
);
246 memcpy(buf
, vmxnet3_rq_driver_stats
[i
].desc
,
248 buf
+= ETH_GSTRING_LEN
;
252 for (i
= 0; i
< ARRAY_SIZE(vmxnet3_global_stats
); i
++) {
253 memcpy(buf
, vmxnet3_global_stats
[i
].desc
,
255 buf
+= ETH_GSTRING_LEN
;
260 netdev_features_t
vmxnet3_fix_features(struct net_device
*netdev
,
261 netdev_features_t features
)
263 /* If Rx checksum is disabled, then LRO should also be disabled */
264 if (!(features
& NETIF_F_RXCSUM
))
265 features
&= ~NETIF_F_LRO
;
270 netdev_features_t
vmxnet3_features_check(struct sk_buff
*skb
,
271 struct net_device
*netdev
,
272 netdev_features_t features
)
274 struct vmxnet3_adapter
*adapter
= netdev_priv(netdev
);
276 /* Validate if the tunneled packet is being offloaded by the device */
277 if (VMXNET3_VERSION_GE_4(adapter
) &&
278 skb
->encapsulation
&& skb
->ip_summed
== CHECKSUM_PARTIAL
) {
281 switch (vlan_get_protocol(skb
)) {
282 case htons(ETH_P_IP
):
283 l4_proto
= ip_hdr(skb
)->protocol
;
285 case htons(ETH_P_IPV6
):
286 l4_proto
= ipv6_hdr(skb
)->nexthdr
;
289 return features
& ~(NETIF_F_CSUM_MASK
| NETIF_F_GSO_MASK
);
292 if (l4_proto
!= IPPROTO_UDP
)
293 return features
& ~(NETIF_F_CSUM_MASK
| NETIF_F_GSO_MASK
);
298 static void vmxnet3_enable_encap_offloads(struct net_device
*netdev
)
300 struct vmxnet3_adapter
*adapter
= netdev_priv(netdev
);
302 if (VMXNET3_VERSION_GE_4(adapter
)) {
303 netdev
->hw_enc_features
|= NETIF_F_SG
| NETIF_F_RXCSUM
|
304 NETIF_F_HW_CSUM
| NETIF_F_HW_VLAN_CTAG_TX
|
305 NETIF_F_HW_VLAN_CTAG_RX
| NETIF_F_TSO
| NETIF_F_TSO6
|
306 NETIF_F_LRO
| NETIF_F_GSO_UDP_TUNNEL
|
307 NETIF_F_GSO_UDP_TUNNEL_CSUM
;
311 static void vmxnet3_disable_encap_offloads(struct net_device
*netdev
)
313 struct vmxnet3_adapter
*adapter
= netdev_priv(netdev
);
315 if (VMXNET3_VERSION_GE_4(adapter
)) {
316 netdev
->hw_enc_features
&= ~(NETIF_F_SG
| NETIF_F_RXCSUM
|
317 NETIF_F_HW_CSUM
| NETIF_F_HW_VLAN_CTAG_TX
|
318 NETIF_F_HW_VLAN_CTAG_RX
| NETIF_F_TSO
| NETIF_F_TSO6
|
319 NETIF_F_LRO
| NETIF_F_GSO_UDP_TUNNEL
|
320 NETIF_F_GSO_UDP_TUNNEL_CSUM
);
324 int vmxnet3_set_features(struct net_device
*netdev
, netdev_features_t features
)
326 struct vmxnet3_adapter
*adapter
= netdev_priv(netdev
);
328 netdev_features_t changed
= features
^ netdev
->features
;
329 netdev_features_t tun_offload_mask
= NETIF_F_GSO_UDP_TUNNEL
|
330 NETIF_F_GSO_UDP_TUNNEL_CSUM
;
331 u8 udp_tun_enabled
= (netdev
->features
& tun_offload_mask
) != 0;
333 if (changed
& (NETIF_F_RXCSUM
| NETIF_F_LRO
|
334 NETIF_F_HW_VLAN_CTAG_RX
| tun_offload_mask
)) {
335 if (features
& NETIF_F_RXCSUM
)
336 adapter
->shared
->devRead
.misc
.uptFeatures
|=
339 adapter
->shared
->devRead
.misc
.uptFeatures
&=
342 /* update hardware LRO capability accordingly */
343 if (features
& NETIF_F_LRO
)
344 adapter
->shared
->devRead
.misc
.uptFeatures
|=
347 adapter
->shared
->devRead
.misc
.uptFeatures
&=
350 if (features
& NETIF_F_HW_VLAN_CTAG_RX
)
351 adapter
->shared
->devRead
.misc
.uptFeatures
|=
354 adapter
->shared
->devRead
.misc
.uptFeatures
&=
357 if ((features
& tun_offload_mask
) != 0 && !udp_tun_enabled
) {
358 vmxnet3_enable_encap_offloads(netdev
);
359 adapter
->shared
->devRead
.misc
.uptFeatures
|=
361 } else if ((features
& tun_offload_mask
) == 0 &&
363 vmxnet3_disable_encap_offloads(netdev
);
364 adapter
->shared
->devRead
.misc
.uptFeatures
&=
368 spin_lock_irqsave(&adapter
->cmd_lock
, flags
);
369 VMXNET3_WRITE_BAR1_REG(adapter
, VMXNET3_REG_CMD
,
370 VMXNET3_CMD_UPDATE_FEATURE
);
371 spin_unlock_irqrestore(&adapter
->cmd_lock
, flags
);
377 vmxnet3_get_ethtool_stats(struct net_device
*netdev
,
378 struct ethtool_stats
*stats
, u64
*buf
)
380 struct vmxnet3_adapter
*adapter
= netdev_priv(netdev
);
386 spin_lock_irqsave(&adapter
->cmd_lock
, flags
);
387 VMXNET3_WRITE_BAR1_REG(adapter
, VMXNET3_REG_CMD
, VMXNET3_CMD_GET_STATS
);
388 spin_unlock_irqrestore(&adapter
->cmd_lock
, flags
);
390 /* this does assume each counter is 64-bit wide */
391 for (j
= 0; j
< adapter
->num_tx_queues
; j
++) {
392 base
= (u8
*)&adapter
->tqd_start
[j
].stats
;
394 for (i
= 1; i
< ARRAY_SIZE(vmxnet3_tq_dev_stats
); i
++)
395 *buf
++ = *(u64
*)(base
+
396 vmxnet3_tq_dev_stats
[i
].offset
);
398 base
= (u8
*)&adapter
->tx_queue
[j
].stats
;
399 for (i
= 0; i
< ARRAY_SIZE(vmxnet3_tq_driver_stats
); i
++)
400 *buf
++ = *(u64
*)(base
+
401 vmxnet3_tq_driver_stats
[i
].offset
);
404 for (j
= 0; j
< adapter
->num_rx_queues
; j
++) {
405 base
= (u8
*)&adapter
->rqd_start
[j
].stats
;
407 for (i
= 1; i
< ARRAY_SIZE(vmxnet3_rq_dev_stats
); i
++)
408 *buf
++ = *(u64
*)(base
+
409 vmxnet3_rq_dev_stats
[i
].offset
);
411 base
= (u8
*)&adapter
->rx_queue
[j
].stats
;
412 for (i
= 0; i
< ARRAY_SIZE(vmxnet3_rq_driver_stats
); i
++)
413 *buf
++ = *(u64
*)(base
+
414 vmxnet3_rq_driver_stats
[i
].offset
);
417 base
= (u8
*)adapter
;
418 for (i
= 0; i
< ARRAY_SIZE(vmxnet3_global_stats
); i
++)
419 *buf
++ = *(u64
*)(base
+ vmxnet3_global_stats
[i
].offset
);
423 /* This is a version 2 of the vmxnet3 ethtool_regs which goes hand in hand with
424 * the version 2 of the vmxnet3 support for ethtool(8) --register-dump.
425 * Therefore, if any registers are added, removed or modified, then a version
426 * bump and a corresponding change in the vmxnet3 support for ethtool(8)
427 * --register-dump would be required.
430 vmxnet3_get_regs(struct net_device
*netdev
, struct ethtool_regs
*regs
, void *p
)
432 struct vmxnet3_adapter
*adapter
= netdev_priv(netdev
);
436 memset(p
, 0, vmxnet3_get_regs_len(netdev
));
440 /* Update vmxnet3_get_regs_len if we want to dump more registers */
442 buf
[j
++] = VMXNET3_READ_BAR1_REG(adapter
, VMXNET3_REG_VRRS
);
443 buf
[j
++] = VMXNET3_READ_BAR1_REG(adapter
, VMXNET3_REG_UVRS
);
444 buf
[j
++] = VMXNET3_READ_BAR1_REG(adapter
, VMXNET3_REG_DSAL
);
445 buf
[j
++] = VMXNET3_READ_BAR1_REG(adapter
, VMXNET3_REG_DSAH
);
446 buf
[j
++] = VMXNET3_READ_BAR1_REG(adapter
, VMXNET3_REG_CMD
);
447 buf
[j
++] = VMXNET3_READ_BAR1_REG(adapter
, VMXNET3_REG_MACL
);
448 buf
[j
++] = VMXNET3_READ_BAR1_REG(adapter
, VMXNET3_REG_MACH
);
449 buf
[j
++] = VMXNET3_READ_BAR1_REG(adapter
, VMXNET3_REG_ICR
);
450 buf
[j
++] = VMXNET3_READ_BAR1_REG(adapter
, VMXNET3_REG_ECR
);
452 buf
[j
++] = adapter
->intr
.num_intrs
;
453 for (i
= 0; i
< adapter
->intr
.num_intrs
; i
++) {
454 buf
[j
++] = VMXNET3_READ_BAR0_REG(adapter
, VMXNET3_REG_IMR
455 + i
* VMXNET3_REG_ALIGN
);
458 buf
[j
++] = adapter
->num_tx_queues
;
459 for (i
= 0; i
< adapter
->num_tx_queues
; i
++) {
460 struct vmxnet3_tx_queue
*tq
= &adapter
->tx_queue
[i
];
462 buf
[j
++] = VMXNET3_READ_BAR0_REG(adapter
, VMXNET3_REG_TXPROD
+
463 i
* VMXNET3_REG_ALIGN
);
465 buf
[j
++] = VMXNET3_GET_ADDR_LO(tq
->tx_ring
.basePA
);
466 buf
[j
++] = VMXNET3_GET_ADDR_HI(tq
->tx_ring
.basePA
);
467 buf
[j
++] = tq
->tx_ring
.size
;
468 buf
[j
++] = tq
->tx_ring
.next2fill
;
469 buf
[j
++] = tq
->tx_ring
.next2comp
;
470 buf
[j
++] = tq
->tx_ring
.gen
;
472 buf
[j
++] = VMXNET3_GET_ADDR_LO(tq
->data_ring
.basePA
);
473 buf
[j
++] = VMXNET3_GET_ADDR_HI(tq
->data_ring
.basePA
);
474 buf
[j
++] = tq
->data_ring
.size
;
475 buf
[j
++] = tq
->txdata_desc_size
;
477 buf
[j
++] = VMXNET3_GET_ADDR_LO(tq
->comp_ring
.basePA
);
478 buf
[j
++] = VMXNET3_GET_ADDR_HI(tq
->comp_ring
.basePA
);
479 buf
[j
++] = tq
->comp_ring
.size
;
480 buf
[j
++] = tq
->comp_ring
.next2proc
;
481 buf
[j
++] = tq
->comp_ring
.gen
;
483 buf
[j
++] = tq
->stopped
;
486 buf
[j
++] = adapter
->num_rx_queues
;
487 for (i
= 0; i
< adapter
->num_rx_queues
; i
++) {
488 struct vmxnet3_rx_queue
*rq
= &adapter
->rx_queue
[i
];
490 buf
[j
++] = VMXNET3_READ_BAR0_REG(adapter
, VMXNET3_REG_RXPROD
+
491 i
* VMXNET3_REG_ALIGN
);
492 buf
[j
++] = VMXNET3_READ_BAR0_REG(adapter
, VMXNET3_REG_RXPROD2
+
493 i
* VMXNET3_REG_ALIGN
);
495 buf
[j
++] = VMXNET3_GET_ADDR_LO(rq
->rx_ring
[0].basePA
);
496 buf
[j
++] = VMXNET3_GET_ADDR_HI(rq
->rx_ring
[0].basePA
);
497 buf
[j
++] = rq
->rx_ring
[0].size
;
498 buf
[j
++] = rq
->rx_ring
[0].next2fill
;
499 buf
[j
++] = rq
->rx_ring
[0].next2comp
;
500 buf
[j
++] = rq
->rx_ring
[0].gen
;
502 buf
[j
++] = VMXNET3_GET_ADDR_LO(rq
->rx_ring
[1].basePA
);
503 buf
[j
++] = VMXNET3_GET_ADDR_HI(rq
->rx_ring
[1].basePA
);
504 buf
[j
++] = rq
->rx_ring
[1].size
;
505 buf
[j
++] = rq
->rx_ring
[1].next2fill
;
506 buf
[j
++] = rq
->rx_ring
[1].next2comp
;
507 buf
[j
++] = rq
->rx_ring
[1].gen
;
509 buf
[j
++] = VMXNET3_GET_ADDR_LO(rq
->data_ring
.basePA
);
510 buf
[j
++] = VMXNET3_GET_ADDR_HI(rq
->data_ring
.basePA
);
511 buf
[j
++] = rq
->rx_ring
[0].size
;
512 buf
[j
++] = rq
->data_ring
.desc_size
;
514 buf
[j
++] = VMXNET3_GET_ADDR_LO(rq
->comp_ring
.basePA
);
515 buf
[j
++] = VMXNET3_GET_ADDR_HI(rq
->comp_ring
.basePA
);
516 buf
[j
++] = rq
->comp_ring
.size
;
517 buf
[j
++] = rq
->comp_ring
.next2proc
;
518 buf
[j
++] = rq
->comp_ring
.gen
;
524 vmxnet3_get_wol(struct net_device
*netdev
, struct ethtool_wolinfo
*wol
)
526 struct vmxnet3_adapter
*adapter
= netdev_priv(netdev
);
528 wol
->supported
= WAKE_UCAST
| WAKE_ARP
| WAKE_MAGIC
;
529 wol
->wolopts
= adapter
->wol
;
534 vmxnet3_set_wol(struct net_device
*netdev
, struct ethtool_wolinfo
*wol
)
536 struct vmxnet3_adapter
*adapter
= netdev_priv(netdev
);
538 if (wol
->wolopts
& (WAKE_PHY
| WAKE_MCAST
| WAKE_BCAST
|
543 adapter
->wol
= wol
->wolopts
;
545 device_set_wakeup_enable(&adapter
->pdev
->dev
, adapter
->wol
);
552 vmxnet3_get_link_ksettings(struct net_device
*netdev
,
553 struct ethtool_link_ksettings
*ecmd
)
555 struct vmxnet3_adapter
*adapter
= netdev_priv(netdev
);
557 ethtool_link_ksettings_zero_link_mode(ecmd
, supported
);
558 ethtool_link_ksettings_add_link_mode(ecmd
, supported
, 10000baseT_Full
);
559 ethtool_link_ksettings_add_link_mode(ecmd
, supported
, 1000baseT_Full
);
560 ethtool_link_ksettings_add_link_mode(ecmd
, supported
, TP
);
561 ethtool_link_ksettings_zero_link_mode(ecmd
, advertising
);
562 ethtool_link_ksettings_add_link_mode(ecmd
, advertising
, TP
);
563 ecmd
->base
.port
= PORT_TP
;
565 if (adapter
->link_speed
) {
566 ecmd
->base
.speed
= adapter
->link_speed
;
567 ecmd
->base
.duplex
= DUPLEX_FULL
;
569 ecmd
->base
.speed
= SPEED_UNKNOWN
;
570 ecmd
->base
.duplex
= DUPLEX_UNKNOWN
;
577 vmxnet3_get_ringparam(struct net_device
*netdev
,
578 struct ethtool_ringparam
*param
)
580 struct vmxnet3_adapter
*adapter
= netdev_priv(netdev
);
582 param
->rx_max_pending
= VMXNET3_RX_RING_MAX_SIZE
;
583 param
->tx_max_pending
= VMXNET3_TX_RING_MAX_SIZE
;
584 param
->rx_mini_max_pending
= VMXNET3_VERSION_GE_3(adapter
) ?
585 VMXNET3_RXDATA_DESC_MAX_SIZE
: 0;
586 param
->rx_jumbo_max_pending
= VMXNET3_RX_RING2_MAX_SIZE
;
588 param
->rx_pending
= adapter
->rx_ring_size
;
589 param
->tx_pending
= adapter
->tx_ring_size
;
590 param
->rx_mini_pending
= VMXNET3_VERSION_GE_3(adapter
) ?
591 adapter
->rxdata_desc_size
: 0;
592 param
->rx_jumbo_pending
= adapter
->rx_ring2_size
;
597 vmxnet3_set_ringparam(struct net_device
*netdev
,
598 struct ethtool_ringparam
*param
)
600 struct vmxnet3_adapter
*adapter
= netdev_priv(netdev
);
601 u32 new_tx_ring_size
, new_rx_ring_size
, new_rx_ring2_size
;
602 u16 new_rxdata_desc_size
;
606 if (param
->tx_pending
== 0 || param
->tx_pending
>
607 VMXNET3_TX_RING_MAX_SIZE
)
610 if (param
->rx_pending
== 0 || param
->rx_pending
>
611 VMXNET3_RX_RING_MAX_SIZE
)
614 if (param
->rx_jumbo_pending
== 0 ||
615 param
->rx_jumbo_pending
> VMXNET3_RX_RING2_MAX_SIZE
)
618 /* if adapter not yet initialized, do nothing */
619 if (adapter
->rx_buf_per_pkt
== 0) {
620 netdev_err(netdev
, "adapter not completely initialized, "
621 "ring size cannot be changed yet\n");
625 if (VMXNET3_VERSION_GE_3(adapter
)) {
626 if (param
->rx_mini_pending
> VMXNET3_RXDATA_DESC_MAX_SIZE
)
628 } else if (param
->rx_mini_pending
!= 0) {
632 /* round it up to a multiple of VMXNET3_RING_SIZE_ALIGN */
633 new_tx_ring_size
= (param
->tx_pending
+ VMXNET3_RING_SIZE_MASK
) &
634 ~VMXNET3_RING_SIZE_MASK
;
635 new_tx_ring_size
= min_t(u32
, new_tx_ring_size
,
636 VMXNET3_TX_RING_MAX_SIZE
);
637 if (new_tx_ring_size
> VMXNET3_TX_RING_MAX_SIZE
|| (new_tx_ring_size
%
638 VMXNET3_RING_SIZE_ALIGN
) != 0)
641 /* ring0 has to be a multiple of
642 * rx_buf_per_pkt * VMXNET3_RING_SIZE_ALIGN
644 sz
= adapter
->rx_buf_per_pkt
* VMXNET3_RING_SIZE_ALIGN
;
645 new_rx_ring_size
= (param
->rx_pending
+ sz
- 1) / sz
* sz
;
646 new_rx_ring_size
= min_t(u32
, new_rx_ring_size
,
647 VMXNET3_RX_RING_MAX_SIZE
/ sz
* sz
);
648 if (new_rx_ring_size
> VMXNET3_RX_RING_MAX_SIZE
|| (new_rx_ring_size
%
652 /* ring2 has to be a multiple of VMXNET3_RING_SIZE_ALIGN */
653 new_rx_ring2_size
= (param
->rx_jumbo_pending
+ VMXNET3_RING_SIZE_MASK
) &
654 ~VMXNET3_RING_SIZE_MASK
;
655 new_rx_ring2_size
= min_t(u32
, new_rx_ring2_size
,
656 VMXNET3_RX_RING2_MAX_SIZE
);
658 /* rx data ring buffer size has to be a multiple of
659 * VMXNET3_RXDATA_DESC_SIZE_ALIGN
661 new_rxdata_desc_size
=
662 (param
->rx_mini_pending
+ VMXNET3_RXDATA_DESC_SIZE_MASK
) &
663 ~VMXNET3_RXDATA_DESC_SIZE_MASK
;
664 new_rxdata_desc_size
= min_t(u16
, new_rxdata_desc_size
,
665 VMXNET3_RXDATA_DESC_MAX_SIZE
);
667 if (new_tx_ring_size
== adapter
->tx_ring_size
&&
668 new_rx_ring_size
== adapter
->rx_ring_size
&&
669 new_rx_ring2_size
== adapter
->rx_ring2_size
&&
670 new_rxdata_desc_size
== adapter
->rxdata_desc_size
) {
675 * Reset_work may be in the middle of resetting the device, wait for its
678 while (test_and_set_bit(VMXNET3_STATE_BIT_RESETTING
, &adapter
->state
))
679 usleep_range(1000, 2000);
681 if (netif_running(netdev
)) {
682 vmxnet3_quiesce_dev(adapter
);
683 vmxnet3_reset_dev(adapter
);
685 /* recreate the rx queue and the tx queue based on the
687 vmxnet3_tq_destroy_all(adapter
);
688 vmxnet3_rq_destroy_all(adapter
);
690 err
= vmxnet3_create_queues(adapter
, new_tx_ring_size
,
691 new_rx_ring_size
, new_rx_ring2_size
,
692 adapter
->txdata_desc_size
,
693 new_rxdata_desc_size
);
695 /* failed, most likely because of OOM, try default
697 netdev_err(netdev
, "failed to apply new sizes, "
698 "try the default ones\n");
699 new_rx_ring_size
= VMXNET3_DEF_RX_RING_SIZE
;
700 new_rx_ring2_size
= VMXNET3_DEF_RX_RING2_SIZE
;
701 new_tx_ring_size
= VMXNET3_DEF_TX_RING_SIZE
;
702 new_rxdata_desc_size
= VMXNET3_VERSION_GE_3(adapter
) ?
703 VMXNET3_DEF_RXDATA_DESC_SIZE
: 0;
705 err
= vmxnet3_create_queues(adapter
,
709 adapter
->txdata_desc_size
,
710 new_rxdata_desc_size
);
712 netdev_err(netdev
, "failed to create queues "
713 "with default sizes. Closing it\n");
718 err
= vmxnet3_activate_dev(adapter
);
720 netdev_err(netdev
, "failed to re-activate, error %d."
721 " Closing it\n", err
);
723 adapter
->tx_ring_size
= new_tx_ring_size
;
724 adapter
->rx_ring_size
= new_rx_ring_size
;
725 adapter
->rx_ring2_size
= new_rx_ring2_size
;
726 adapter
->rxdata_desc_size
= new_rxdata_desc_size
;
729 clear_bit(VMXNET3_STATE_BIT_RESETTING
, &adapter
->state
);
731 vmxnet3_force_close(adapter
);
737 vmxnet3_get_rss_hash_opts(struct vmxnet3_adapter
*adapter
,
738 struct ethtool_rxnfc
*info
)
740 enum Vmxnet3_RSSField rss_fields
;
742 if (netif_running(adapter
->netdev
)) {
745 spin_lock_irqsave(&adapter
->cmd_lock
, flags
);
747 VMXNET3_WRITE_BAR1_REG(adapter
, VMXNET3_REG_CMD
,
748 VMXNET3_CMD_GET_RSS_FIELDS
);
749 rss_fields
= VMXNET3_READ_BAR1_REG(adapter
, VMXNET3_REG_CMD
);
750 spin_unlock_irqrestore(&adapter
->cmd_lock
, flags
);
752 rss_fields
= adapter
->rss_fields
;
757 /* Report default options for RSS on vmxnet3 */
758 switch (info
->flow_type
) {
761 info
->data
|= RXH_L4_B_0_1
| RXH_L4_B_2_3
|
762 RXH_IP_SRC
| RXH_IP_DST
;
765 if (rss_fields
& VMXNET3_RSS_FIELDS_UDPIP4
)
766 info
->data
|= RXH_L4_B_0_1
| RXH_L4_B_2_3
;
767 info
->data
|= RXH_IP_SRC
| RXH_IP_DST
;
772 if (rss_fields
& VMXNET3_RSS_FIELDS_ESPIP4
)
773 info
->data
|= RXH_L4_B_0_1
| RXH_L4_B_2_3
;
777 info
->data
|= RXH_IP_SRC
| RXH_IP_DST
;
780 if (rss_fields
& VMXNET3_RSS_FIELDS_UDPIP6
)
781 info
->data
|= RXH_L4_B_0_1
| RXH_L4_B_2_3
;
782 info
->data
|= RXH_IP_SRC
| RXH_IP_DST
;
789 info
->data
|= RXH_IP_SRC
| RXH_IP_DST
;
799 vmxnet3_set_rss_hash_opt(struct net_device
*netdev
,
800 struct vmxnet3_adapter
*adapter
,
801 struct ethtool_rxnfc
*nfc
)
803 enum Vmxnet3_RSSField rss_fields
= adapter
->rss_fields
;
805 /* RSS does not support anything other than hashing
806 * to queues on src and dst IPs and ports
808 if (nfc
->data
& ~(RXH_IP_SRC
| RXH_IP_DST
|
809 RXH_L4_B_0_1
| RXH_L4_B_2_3
))
812 switch (nfc
->flow_type
) {
815 if (!(nfc
->data
& RXH_IP_SRC
) ||
816 !(nfc
->data
& RXH_IP_DST
) ||
817 !(nfc
->data
& RXH_L4_B_0_1
) ||
818 !(nfc
->data
& RXH_L4_B_2_3
))
822 if (!(nfc
->data
& RXH_IP_SRC
) ||
823 !(nfc
->data
& RXH_IP_DST
))
825 switch (nfc
->data
& (RXH_L4_B_0_1
| RXH_L4_B_2_3
)) {
827 rss_fields
&= ~VMXNET3_RSS_FIELDS_UDPIP4
;
829 case (RXH_L4_B_0_1
| RXH_L4_B_2_3
):
830 rss_fields
|= VMXNET3_RSS_FIELDS_UDPIP4
;
837 if (!(nfc
->data
& RXH_IP_SRC
) ||
838 !(nfc
->data
& RXH_IP_DST
))
840 switch (nfc
->data
& (RXH_L4_B_0_1
| RXH_L4_B_2_3
)) {
842 rss_fields
&= ~VMXNET3_RSS_FIELDS_UDPIP6
;
844 case (RXH_L4_B_0_1
| RXH_L4_B_2_3
):
845 rss_fields
|= VMXNET3_RSS_FIELDS_UDPIP6
;
854 if (!(nfc
->data
& RXH_IP_SRC
) ||
855 !(nfc
->data
& RXH_IP_DST
))
857 switch (nfc
->data
& (RXH_L4_B_0_1
| RXH_L4_B_2_3
)) {
859 rss_fields
&= ~VMXNET3_RSS_FIELDS_ESPIP4
;
861 case (RXH_L4_B_0_1
| RXH_L4_B_2_3
):
862 rss_fields
|= VMXNET3_RSS_FIELDS_ESPIP4
;
873 if (!(nfc
->data
& RXH_IP_SRC
) ||
874 !(nfc
->data
& RXH_IP_DST
) ||
875 (nfc
->data
& RXH_L4_B_0_1
) ||
876 (nfc
->data
& RXH_L4_B_2_3
))
883 /* if we changed something we need to update flags */
884 if (rss_fields
!= adapter
->rss_fields
) {
885 adapter
->default_rss_fields
= false;
886 if (netif_running(netdev
)) {
887 struct Vmxnet3_DriverShared
*shared
= adapter
->shared
;
888 union Vmxnet3_CmdInfo
*cmdInfo
= &shared
->cu
.cmdInfo
;
891 spin_lock_irqsave(&adapter
->cmd_lock
, flags
);
892 cmdInfo
->setRssFields
= rss_fields
;
893 VMXNET3_WRITE_BAR1_REG(adapter
, VMXNET3_REG_CMD
,
894 VMXNET3_CMD_SET_RSS_FIELDS
);
896 /* Not all requested RSS may get applied, so get and
897 * cache what was actually applied.
899 VMXNET3_WRITE_BAR1_REG(adapter
, VMXNET3_REG_CMD
,
900 VMXNET3_CMD_GET_RSS_FIELDS
);
901 adapter
->rss_fields
=
902 VMXNET3_READ_BAR1_REG(adapter
, VMXNET3_REG_CMD
);
903 spin_unlock_irqrestore(&adapter
->cmd_lock
, flags
);
905 /* When the device is activated, we will try to apply
906 * these rules and cache the applied value later.
908 adapter
->rss_fields
= rss_fields
;
915 vmxnet3_get_rxnfc(struct net_device
*netdev
, struct ethtool_rxnfc
*info
,
918 struct vmxnet3_adapter
*adapter
= netdev_priv(netdev
);
922 case ETHTOOL_GRXRINGS
:
923 info
->data
= adapter
->num_rx_queues
;
926 if (!VMXNET3_VERSION_GE_4(adapter
)) {
936 err
= vmxnet3_get_rss_hash_opts(adapter
, info
);
947 vmxnet3_set_rxnfc(struct net_device
*netdev
, struct ethtool_rxnfc
*info
)
949 struct vmxnet3_adapter
*adapter
= netdev_priv(netdev
);
952 if (!VMXNET3_VERSION_GE_4(adapter
)) {
965 err
= vmxnet3_set_rss_hash_opt(netdev
, adapter
, info
);
978 vmxnet3_get_rss_indir_size(struct net_device
*netdev
)
980 struct vmxnet3_adapter
*adapter
= netdev_priv(netdev
);
981 struct UPT1_RSSConf
*rssConf
= adapter
->rss_conf
;
983 return rssConf
->indTableSize
;
987 vmxnet3_get_rss(struct net_device
*netdev
, u32
*p
, u8
*key
, u8
*hfunc
)
989 struct vmxnet3_adapter
*adapter
= netdev_priv(netdev
);
990 struct UPT1_RSSConf
*rssConf
= adapter
->rss_conf
;
991 unsigned int n
= rssConf
->indTableSize
;
994 *hfunc
= ETH_RSS_HASH_TOP
;
997 if (n
> UPT1_RSS_MAX_IND_TABLE_SIZE
)
1000 p
[n
] = rssConf
->indTable
[n
];
1006 vmxnet3_set_rss(struct net_device
*netdev
, const u32
*p
, const u8
*key
,
1010 unsigned long flags
;
1011 struct vmxnet3_adapter
*adapter
= netdev_priv(netdev
);
1012 struct UPT1_RSSConf
*rssConf
= adapter
->rss_conf
;
1014 /* We do not allow change in unsupported parameters */
1016 (hfunc
!= ETH_RSS_HASH_NO_CHANGE
&& hfunc
!= ETH_RSS_HASH_TOP
))
1020 for (i
= 0; i
< rssConf
->indTableSize
; i
++)
1021 rssConf
->indTable
[i
] = p
[i
];
1023 spin_lock_irqsave(&adapter
->cmd_lock
, flags
);
1024 VMXNET3_WRITE_BAR1_REG(adapter
, VMXNET3_REG_CMD
,
1025 VMXNET3_CMD_UPDATE_RSSIDT
);
1026 spin_unlock_irqrestore(&adapter
->cmd_lock
, flags
);
1034 vmxnet3_get_coalesce(struct net_device
*netdev
, struct ethtool_coalesce
*ec
)
1036 struct vmxnet3_adapter
*adapter
= netdev_priv(netdev
);
1038 if (!VMXNET3_VERSION_GE_3(adapter
))
1041 switch (adapter
->coal_conf
->coalMode
) {
1042 case VMXNET3_COALESCE_DISABLED
:
1043 /* struct ethtool_coalesce is already initialized to 0 */
1045 case VMXNET3_COALESCE_ADAPT
:
1046 ec
->use_adaptive_rx_coalesce
= true;
1048 case VMXNET3_COALESCE_STATIC
:
1049 ec
->tx_max_coalesced_frames
=
1050 adapter
->coal_conf
->coalPara
.coalStatic
.tx_comp_depth
;
1051 ec
->rx_max_coalesced_frames
=
1052 adapter
->coal_conf
->coalPara
.coalStatic
.rx_depth
;
1054 case VMXNET3_COALESCE_RBC
: {
1057 rbc_rate
= adapter
->coal_conf
->coalPara
.coalRbc
.rbc_rate
;
1058 ec
->rx_coalesce_usecs
= VMXNET3_COAL_RBC_USECS(rbc_rate
);
1069 vmxnet3_set_coalesce(struct net_device
*netdev
, struct ethtool_coalesce
*ec
)
1071 struct vmxnet3_adapter
*adapter
= netdev_priv(netdev
);
1072 struct Vmxnet3_DriverShared
*shared
= adapter
->shared
;
1073 union Vmxnet3_CmdInfo
*cmdInfo
= &shared
->cu
.cmdInfo
;
1074 unsigned long flags
;
1076 if (!VMXNET3_VERSION_GE_3(adapter
))
1079 if ((ec
->rx_coalesce_usecs
== 0) &&
1080 (ec
->use_adaptive_rx_coalesce
== 0) &&
1081 (ec
->tx_max_coalesced_frames
== 0) &&
1082 (ec
->rx_max_coalesced_frames
== 0)) {
1083 memset(adapter
->coal_conf
, 0, sizeof(*adapter
->coal_conf
));
1084 adapter
->coal_conf
->coalMode
= VMXNET3_COALESCE_DISABLED
;
1088 if (ec
->rx_coalesce_usecs
!= 0) {
1091 if ((ec
->use_adaptive_rx_coalesce
!= 0) ||
1092 (ec
->tx_max_coalesced_frames
!= 0) ||
1093 (ec
->rx_max_coalesced_frames
!= 0)) {
1097 rbc_rate
= VMXNET3_COAL_RBC_RATE(ec
->rx_coalesce_usecs
);
1098 if (rbc_rate
< VMXNET3_COAL_RBC_MIN_RATE
||
1099 rbc_rate
> VMXNET3_COAL_RBC_MAX_RATE
) {
1103 memset(adapter
->coal_conf
, 0, sizeof(*adapter
->coal_conf
));
1104 adapter
->coal_conf
->coalMode
= VMXNET3_COALESCE_RBC
;
1105 adapter
->coal_conf
->coalPara
.coalRbc
.rbc_rate
= rbc_rate
;
1109 if (ec
->use_adaptive_rx_coalesce
!= 0) {
1110 if ((ec
->rx_coalesce_usecs
!= 0) ||
1111 (ec
->tx_max_coalesced_frames
!= 0) ||
1112 (ec
->rx_max_coalesced_frames
!= 0)) {
1115 memset(adapter
->coal_conf
, 0, sizeof(*adapter
->coal_conf
));
1116 adapter
->coal_conf
->coalMode
= VMXNET3_COALESCE_ADAPT
;
1120 if ((ec
->tx_max_coalesced_frames
!= 0) ||
1121 (ec
->rx_max_coalesced_frames
!= 0)) {
1122 if ((ec
->rx_coalesce_usecs
!= 0) ||
1123 (ec
->use_adaptive_rx_coalesce
!= 0)) {
1127 if ((ec
->tx_max_coalesced_frames
>
1128 VMXNET3_COAL_STATIC_MAX_DEPTH
) ||
1129 (ec
->rx_max_coalesced_frames
>
1130 VMXNET3_COAL_STATIC_MAX_DEPTH
)) {
1134 memset(adapter
->coal_conf
, 0, sizeof(*adapter
->coal_conf
));
1135 adapter
->coal_conf
->coalMode
= VMXNET3_COALESCE_STATIC
;
1137 adapter
->coal_conf
->coalPara
.coalStatic
.tx_comp_depth
=
1138 (ec
->tx_max_coalesced_frames
?
1139 ec
->tx_max_coalesced_frames
:
1140 VMXNET3_COAL_STATIC_DEFAULT_DEPTH
);
1142 adapter
->coal_conf
->coalPara
.coalStatic
.rx_depth
=
1143 (ec
->rx_max_coalesced_frames
?
1144 ec
->rx_max_coalesced_frames
:
1145 VMXNET3_COAL_STATIC_DEFAULT_DEPTH
);
1147 adapter
->coal_conf
->coalPara
.coalStatic
.tx_depth
=
1148 VMXNET3_COAL_STATIC_DEFAULT_DEPTH
;
1153 adapter
->default_coal_mode
= false;
1154 if (netif_running(netdev
)) {
1155 spin_lock_irqsave(&adapter
->cmd_lock
, flags
);
1156 cmdInfo
->varConf
.confVer
= 1;
1157 cmdInfo
->varConf
.confLen
=
1158 cpu_to_le32(sizeof(*adapter
->coal_conf
));
1159 cmdInfo
->varConf
.confPA
= cpu_to_le64(adapter
->coal_conf_pa
);
1160 VMXNET3_WRITE_BAR1_REG(adapter
, VMXNET3_REG_CMD
,
1161 VMXNET3_CMD_SET_COALESCE
);
1162 spin_unlock_irqrestore(&adapter
->cmd_lock
, flags
);
1168 static const struct ethtool_ops vmxnet3_ethtool_ops
= {
1169 .supported_coalesce_params
= ETHTOOL_COALESCE_RX_USECS
|
1170 ETHTOOL_COALESCE_MAX_FRAMES
|
1171 ETHTOOL_COALESCE_USE_ADAPTIVE_RX
,
1172 .get_drvinfo
= vmxnet3_get_drvinfo
,
1173 .get_regs_len
= vmxnet3_get_regs_len
,
1174 .get_regs
= vmxnet3_get_regs
,
1175 .get_wol
= vmxnet3_get_wol
,
1176 .set_wol
= vmxnet3_set_wol
,
1177 .get_link
= ethtool_op_get_link
,
1178 .get_coalesce
= vmxnet3_get_coalesce
,
1179 .set_coalesce
= vmxnet3_set_coalesce
,
1180 .get_strings
= vmxnet3_get_strings
,
1181 .get_sset_count
= vmxnet3_get_sset_count
,
1182 .get_ethtool_stats
= vmxnet3_get_ethtool_stats
,
1183 .get_ringparam
= vmxnet3_get_ringparam
,
1184 .set_ringparam
= vmxnet3_set_ringparam
,
1185 .get_rxnfc
= vmxnet3_get_rxnfc
,
1186 .set_rxnfc
= vmxnet3_set_rxnfc
,
1188 .get_rxfh_indir_size
= vmxnet3_get_rss_indir_size
,
1189 .get_rxfh
= vmxnet3_get_rss
,
1190 .set_rxfh
= vmxnet3_set_rss
,
1192 .get_link_ksettings
= vmxnet3_get_link_ksettings
,
1195 void vmxnet3_set_ethtool_ops(struct net_device
*netdev
)
1197 netdev
->ethtool_ops
= &vmxnet3_ethtool_ops
;