Skip to content

Commit ab0441b

Browse files
committed
Merge branch 'vmxnet3-version-6'
Ronak Doshi says: ==================== vmxnet3: upgrade to version 6 vmxnet3 emulation has recently added several new features which includes increase in queues supported, remove power of 2 limitation on queues, add RSS for ESP IPv6, etc. This patch series extends the vmxnet3 driver to leverage these new features. Compatibility is maintained using existing vmxnet3 versioning mechanism as follows: - new features added to vmxnet3 emulation are associated with new vmxnet3 version viz. vmxnet3 version 6. - emulation advertises all the versions it supports to the driver. - during initialization, vmxnet3 driver picks the highest version number supported by both the emulation and the driver and configures emulation to run at that version. In particular, following changes are introduced: Patch 1: This patch introduces utility macros for vmxnet3 version 6 comparison and updates Copyright information. Patch 2: This patch adds support to increase maximum Tx/Rx queues from 8 to 32. Patch 3: This patch removes the limitation of power of 2 on the queues. Patch 4: Uses existing get_rss_hash_opts and set_rss_hash_opts methods to add support for ESP IPv6 RSS. Patch 5: This patch reports correct RSS hash type based on the type of RSS performed. Patch 6: This patch updates maximum configurable mtu to 9190. Patch 7: With all vmxnet3 version 6 changes incorporated in the vmxnet3 driver, with this patch, the driver can configure emulation to run at vmxnet3 version 6. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents f4919ff + ce2639a commit ab0441b

File tree

6 files changed

+235
-82
lines changed

6 files changed

+235
-82
lines changed

drivers/net/vmxnet3/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Linux driver for VMware's vmxnet3 ethernet NIC.
44
#
5-
# Copyright (C) 2007-2020, VMware, Inc. All Rights Reserved.
5+
# Copyright (C) 2007-2021, VMware, Inc. All Rights Reserved.
66
#
77
# This program is free software; you can redistribute it and/or modify it
88
# under the terms of the GNU General Public License as published by the

drivers/net/vmxnet3/upt1_defs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* Linux driver for VMware's vmxnet3 ethernet NIC.
33
*
4-
* Copyright (C) 2008-2020, VMware, Inc. All Rights Reserved.
4+
* Copyright (C) 2008-2021, VMware, Inc. All Rights Reserved.
55
*
66
* This program is free software; you can redistribute it and/or modify it
77
* under the terms of the GNU General Public License as published by the

drivers/net/vmxnet3/vmxnet3_defs.h

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* Linux driver for VMware's vmxnet3 ethernet NIC.
33
*
4-
* Copyright (C) 2008-2020, VMware, Inc. All Rights Reserved.
4+
* Copyright (C) 2008-2021, VMware, Inc. All Rights Reserved.
55
*
66
* This program is free software; you can redistribute it and/or modify it
77
* under the terms of the GNU General Public License as published by the
@@ -98,6 +98,9 @@ enum {
9898
VMXNET3_CMD_GET_TXDATA_DESC_SIZE,
9999
VMXNET3_CMD_GET_COALESCE,
100100
VMXNET3_CMD_GET_RSS_FIELDS,
101+
VMXNET3_CMD_GET_RESERVED2,
102+
VMXNET3_CMD_GET_RESERVED3,
103+
VMXNET3_CMD_GET_MAX_QUEUES_CONF,
101104
};
102105

103106
/*
@@ -341,13 +344,15 @@ struct Vmxnet3_RxCompDescExt {
341344
#define VMXNET3_TXD_EOP_SIZE 1
342345

343346
/* value of RxCompDesc.rssType */
344-
enum {
345-
VMXNET3_RCD_RSS_TYPE_NONE = 0,
346-
VMXNET3_RCD_RSS_TYPE_IPV4 = 1,
347-
VMXNET3_RCD_RSS_TYPE_TCPIPV4 = 2,
348-
VMXNET3_RCD_RSS_TYPE_IPV6 = 3,
349-
VMXNET3_RCD_RSS_TYPE_TCPIPV6 = 4,
350-
};
347+
#define VMXNET3_RCD_RSS_TYPE_NONE 0
348+
#define VMXNET3_RCD_RSS_TYPE_IPV4 1
349+
#define VMXNET3_RCD_RSS_TYPE_TCPIPV4 2
350+
#define VMXNET3_RCD_RSS_TYPE_IPV6 3
351+
#define VMXNET3_RCD_RSS_TYPE_TCPIPV6 4
352+
#define VMXNET3_RCD_RSS_TYPE_UDPIPV4 5
353+
#define VMXNET3_RCD_RSS_TYPE_UDPIPV6 6
354+
#define VMXNET3_RCD_RSS_TYPE_ESPIPV4 7
355+
#define VMXNET3_RCD_RSS_TYPE_ESPIPV6 8
351356

352357

353358
/* a union for accessing all cmd/completion descriptors */
@@ -533,6 +538,13 @@ enum vmxnet3_intr_type {
533538
/* addition 1 for events */
534539
#define VMXNET3_MAX_INTRS 25
535540

541+
/* Version 6 and later will use below macros */
542+
#define VMXNET3_EXT_MAX_TX_QUEUES 32
543+
#define VMXNET3_EXT_MAX_RX_QUEUES 32
544+
/* addition 1 for events */
545+
#define VMXNET3_EXT_MAX_INTRS 65
546+
#define VMXNET3_FIRST_SET_INTRS 64
547+
536548
/* value of intrCtrl */
537549
#define VMXNET3_IC_DISABLE_ALL 0x1 /* bit 0 */
538550

@@ -547,6 +559,19 @@ struct Vmxnet3_IntrConf {
547559
__le32 reserved[2];
548560
};
549561

562+
struct Vmxnet3_IntrConfExt {
563+
u8 autoMask;
564+
u8 numIntrs; /* # of interrupts */
565+
u8 eventIntrIdx;
566+
u8 reserved;
567+
__le32 intrCtrl;
568+
__le32 reserved1;
569+
u8 modLevels[VMXNET3_EXT_MAX_INTRS]; /* moderation level for
570+
* each intr
571+
*/
572+
u8 reserved2[3];
573+
};
574+
550575
/* one bit per VLAN ID, the size is in the units of u32 */
551576
#define VMXNET3_VFT_SIZE (4096 / (sizeof(u32) * 8))
552577

@@ -719,11 +744,16 @@ struct Vmxnet3_DSDevRead {
719744
struct Vmxnet3_VariableLenConfDesc pluginConfDesc;
720745
};
721746

747+
struct Vmxnet3_DSDevReadExt {
748+
/* read-only region for device, read by dev in response to a SET cmd */
749+
struct Vmxnet3_IntrConfExt intrConfExt;
750+
};
751+
722752
/* All structures in DriverShared are padded to multiples of 8 bytes */
723753
struct Vmxnet3_DriverShared {
724754
__le32 magic;
725755
/* make devRead start at 64bit boundaries */
726-
__le32 pad;
756+
__le32 size; /* size of DriverShared */
727757
struct Vmxnet3_DSDevRead devRead;
728758
__le32 ecr;
729759
__le32 reserved;
@@ -734,6 +764,7 @@ struct Vmxnet3_DriverShared {
734764
* command
735765
*/
736766
} cu;
767+
struct Vmxnet3_DSDevReadExt devReadExt;
737768
};
738769

739770

@@ -764,6 +795,7 @@ struct Vmxnet3_DriverShared {
764795
((vfTable[vid >> 5] & (1 << (vid & 31))) != 0)
765796

766797
#define VMXNET3_MAX_MTU 9000
798+
#define VMXNET3_V6_MAX_MTU 9190
767799
#define VMXNET3_MIN_MTU 60
768800

769801
#define VMXNET3_LINK_UP (10000 << 16 | 1) /* 10 Gbps, up */

0 commit comments

Comments
 (0)