Skip to content

Commit d1a890f

Browse files
Shreyas Bhatewaradavem330
authored andcommitted
net: VMware virtual Ethernet NIC driver: vmxnet3
Ethernet NIC driver for VMware's vmxnet3 From: Shreyas Bhatewara <[email protected]> This patch adds driver support for VMware's virtual Ethernet NIC: vmxnet3 Guests running on VMware hypervisors supporting vmxnet3 device will thus have access to improved network functionalities and performance. Signed-off-by: Shreyas Bhatewara <[email protected]> Signed-off-by: Bhavesh Davda <[email protected]> Signed-off-by: Ronghua Zhang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent b9696ea commit d1a890f

File tree

9 files changed

+4193
-0
lines changed

9 files changed

+4193
-0
lines changed

MAINTAINERS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5612,6 +5612,13 @@ S: Maintained
56125612
F: drivers/vlynq/vlynq.c
56135613
F: include/linux/vlynq.h
56145614

5615+
VMWARE VMXNET3 ETHERNET DRIVER
5616+
M: Shreyas Bhatewara <[email protected]>
5617+
M: VMware, Inc. <[email protected]>
5618+
5619+
S: Maintained
5620+
F: drivers/net/vmxnet3/
5621+
56155622
VOLTAGE AND CURRENT REGULATOR FRAMEWORK
56165623
M: Liam Girdwood <[email protected]>
56175624
M: Mark Brown <[email protected]>

drivers/net/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3230,4 +3230,12 @@ config VIRTIO_NET
32303230
This is the virtual network driver for virtio. It can be used with
32313231
lguest or QEMU based VMMs (like KVM or Xen). Say Y or M.
32323232

3233+
config VMXNET3
3234+
tristate "VMware VMXNET3 ethernet driver"
3235+
depends on PCI && X86
3236+
help
3237+
This driver supports VMware's vmxnet3 virtual ethernet NIC.
3238+
To compile this driver as a module, choose M here: the
3239+
module will be called vmxnet3.
3240+
32333241
endif # NETDEVICES

drivers/net/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ obj-$(CONFIG_TEHUTI) += tehuti.o
3030
obj-$(CONFIG_ENIC) += enic/
3131
obj-$(CONFIG_JME) += jme.o
3232
obj-$(CONFIG_BE2NET) += benet/
33+
obj-$(CONFIG_VMXNET3) += vmxnet3/
3334

3435
gianfar_driver-objs := gianfar.o \
3536
gianfar_ethtool.o \

drivers/net/vmxnet3/Makefile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
################################################################################
2+
#
3+
# Linux driver for VMware's vmxnet3 ethernet NIC.
4+
#
5+
# Copyright (C) 2007-2009, VMware, Inc. All Rights Reserved.
6+
#
7+
# This program is free software; you can redistribute it and/or modify it
8+
# under the terms of the GNU General Public License as published by the
9+
# Free Software Foundation; version 2 of the License and no later version.
10+
#
11+
# This program is distributed in the hope that it will be useful, but
12+
# WITHOUT ANY WARRANTY; without even the implied warranty of
13+
# MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
14+
# NON INFRINGEMENT. See the GNU General Public License for more
15+
# details.
16+
#
17+
# You should have received a copy of the GNU General Public License
18+
# along with this program; if not, write to the Free Software
19+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+
#
21+
# The full GNU General Public License is included in this distribution in
22+
# the file called "COPYING".
23+
#
24+
# Maintained by: Shreyas Bhatewara <[email protected]>
25+
#
26+
#
27+
################################################################################
28+
29+
#
30+
# Makefile for the VMware vmxnet3 ethernet NIC driver
31+
#
32+
33+
obj-$(CONFIG_VMXNET3) += vmxnet3.o
34+
35+
vmxnet3-objs := vmxnet3_drv.o vmxnet3_ethtool.o

drivers/net/vmxnet3/upt1_defs.h

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
/*
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 <[email protected]>
24+
*
25+
*/
26+
27+
#ifndef _UPT1_DEFS_H
28+
#define _UPT1_DEFS_H
29+
30+
struct UPT1_TxStats {
31+
u64 TSOPktsTxOK; /* TSO pkts post-segmentation */
32+
u64 TSOBytesTxOK;
33+
u64 ucastPktsTxOK;
34+
u64 ucastBytesTxOK;
35+
u64 mcastPktsTxOK;
36+
u64 mcastBytesTxOK;
37+
u64 bcastPktsTxOK;
38+
u64 bcastBytesTxOK;
39+
u64 pktsTxError;
40+
u64 pktsTxDiscard;
41+
};
42+
43+
struct UPT1_RxStats {
44+
u64 LROPktsRxOK; /* LRO pkts */
45+
u64 LROBytesRxOK; /* bytes from LRO pkts */
46+
/* the following counters are for pkts from the wire, i.e., pre-LRO */
47+
u64 ucastPktsRxOK;
48+
u64 ucastBytesRxOK;
49+
u64 mcastPktsRxOK;
50+
u64 mcastBytesRxOK;
51+
u64 bcastPktsRxOK;
52+
u64 bcastBytesRxOK;
53+
u64 pktsRxOutOfBuf;
54+
u64 pktsRxError;
55+
};
56+
57+
/* interrupt moderation level */
58+
enum {
59+
UPT1_IML_NONE = 0, /* no interrupt moderation */
60+
UPT1_IML_HIGHEST = 7, /* least intr generated */
61+
UPT1_IML_ADAPTIVE = 8, /* adpative intr moderation */
62+
};
63+
/* values for UPT1_RSSConf.hashFunc */
64+
enum {
65+
UPT1_RSS_HASH_TYPE_NONE = 0x0,
66+
UPT1_RSS_HASH_TYPE_IPV4 = 0x01,
67+
UPT1_RSS_HASH_TYPE_TCP_IPV4 = 0x02,
68+
UPT1_RSS_HASH_TYPE_IPV6 = 0x04,
69+
UPT1_RSS_HASH_TYPE_TCP_IPV6 = 0x08,
70+
};
71+
72+
enum {
73+
UPT1_RSS_HASH_FUNC_NONE = 0x0,
74+
UPT1_RSS_HASH_FUNC_TOEPLITZ = 0x01,
75+
};
76+
77+
#define UPT1_RSS_MAX_KEY_SIZE 40
78+
#define UPT1_RSS_MAX_IND_TABLE_SIZE 128
79+
80+
struct UPT1_RSSConf {
81+
u16 hashType;
82+
u16 hashFunc;
83+
u16 hashKeySize;
84+
u16 indTableSize;
85+
u8 hashKey[UPT1_RSS_MAX_KEY_SIZE];
86+
u8 indTable[UPT1_RSS_MAX_IND_TABLE_SIZE];
87+
};
88+
89+
/* features */
90+
enum {
91+
UPT1_F_RXCSUM = 0x0001, /* rx csum verification */
92+
UPT1_F_RSS = 0x0002,
93+
UPT1_F_RXVLAN = 0x0004, /* VLAN tag stripping */
94+
UPT1_F_LRO = 0x0008,
95+
};
96+
#endif

0 commit comments

Comments
 (0)