Skip to content

Commit

Permalink
Merge branch 'vmxnet3-version-6'
Browse files Browse the repository at this point in the history
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 <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Jul 17, 2021
2 parents f4919ff + ce2639a commit ab0441b
Show file tree
Hide file tree
Showing 6 changed files with 235 additions and 82 deletions.
2 changes: 1 addition & 1 deletion drivers/net/vmxnet3/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# Linux driver for VMware's vmxnet3 ethernet NIC.
#
# Copyright (C) 2007-2020, VMware, Inc. All Rights Reserved.
# Copyright (C) 2007-2021, VMware, Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/vmxnet3/upt1_defs.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Linux driver for VMware's vmxnet3 ethernet NIC.
*
* Copyright (C) 2008-2020, VMware, Inc. All Rights Reserved.
* Copyright (C) 2008-2021, VMware, Inc. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
Expand Down
50 changes: 41 additions & 9 deletions drivers/net/vmxnet3/vmxnet3_defs.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Linux driver for VMware's vmxnet3 ethernet NIC.
*
* Copyright (C) 2008-2020, VMware, Inc. All Rights Reserved.
* Copyright (C) 2008-2021, VMware, Inc. All Rights Reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
Expand Down Expand Up @@ -98,6 +98,9 @@ enum {
VMXNET3_CMD_GET_TXDATA_DESC_SIZE,
VMXNET3_CMD_GET_COALESCE,
VMXNET3_CMD_GET_RSS_FIELDS,
VMXNET3_CMD_GET_RESERVED2,
VMXNET3_CMD_GET_RESERVED3,
VMXNET3_CMD_GET_MAX_QUEUES_CONF,
};

/*
Expand Down Expand Up @@ -341,13 +344,15 @@ struct Vmxnet3_RxCompDescExt {
#define VMXNET3_TXD_EOP_SIZE 1

/* value of RxCompDesc.rssType */
enum {
VMXNET3_RCD_RSS_TYPE_NONE = 0,
VMXNET3_RCD_RSS_TYPE_IPV4 = 1,
VMXNET3_RCD_RSS_TYPE_TCPIPV4 = 2,
VMXNET3_RCD_RSS_TYPE_IPV6 = 3,
VMXNET3_RCD_RSS_TYPE_TCPIPV6 = 4,
};
#define VMXNET3_RCD_RSS_TYPE_NONE 0
#define VMXNET3_RCD_RSS_TYPE_IPV4 1
#define VMXNET3_RCD_RSS_TYPE_TCPIPV4 2
#define VMXNET3_RCD_RSS_TYPE_IPV6 3
#define VMXNET3_RCD_RSS_TYPE_TCPIPV6 4
#define VMXNET3_RCD_RSS_TYPE_UDPIPV4 5
#define VMXNET3_RCD_RSS_TYPE_UDPIPV6 6
#define VMXNET3_RCD_RSS_TYPE_ESPIPV4 7
#define VMXNET3_RCD_RSS_TYPE_ESPIPV6 8


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

/* Version 6 and later will use below macros */
#define VMXNET3_EXT_MAX_TX_QUEUES 32
#define VMXNET3_EXT_MAX_RX_QUEUES 32
/* addition 1 for events */
#define VMXNET3_EXT_MAX_INTRS 65
#define VMXNET3_FIRST_SET_INTRS 64

/* value of intrCtrl */
#define VMXNET3_IC_DISABLE_ALL 0x1 /* bit 0 */

Expand All @@ -547,6 +559,19 @@ struct Vmxnet3_IntrConf {
__le32 reserved[2];
};

struct Vmxnet3_IntrConfExt {
u8 autoMask;
u8 numIntrs; /* # of interrupts */
u8 eventIntrIdx;
u8 reserved;
__le32 intrCtrl;
__le32 reserved1;
u8 modLevels[VMXNET3_EXT_MAX_INTRS]; /* moderation level for
* each intr
*/
u8 reserved2[3];
};

/* one bit per VLAN ID, the size is in the units of u32 */
#define VMXNET3_VFT_SIZE (4096 / (sizeof(u32) * 8))

Expand Down Expand Up @@ -719,11 +744,16 @@ struct Vmxnet3_DSDevRead {
struct Vmxnet3_VariableLenConfDesc pluginConfDesc;
};

struct Vmxnet3_DSDevReadExt {
/* read-only region for device, read by dev in response to a SET cmd */
struct Vmxnet3_IntrConfExt intrConfExt;
};

/* All structures in DriverShared are padded to multiples of 8 bytes */
struct Vmxnet3_DriverShared {
__le32 magic;
/* make devRead start at 64bit boundaries */
__le32 pad;
__le32 size; /* size of DriverShared */
struct Vmxnet3_DSDevRead devRead;
__le32 ecr;
__le32 reserved;
Expand All @@ -734,6 +764,7 @@ struct Vmxnet3_DriverShared {
* command
*/
} cu;
struct Vmxnet3_DSDevReadExt devReadExt;
};


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

#define VMXNET3_MAX_MTU 9000
#define VMXNET3_V6_MAX_MTU 9190
#define VMXNET3_MIN_MTU 60

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

0 comments on commit ab0441b

Please sign in to comment.