| .. | .. |
|---|
| 1 | 1 | /* |
|---|
| 2 | 2 | * Linux driver for VMware's vmxnet3 ethernet NIC. |
|---|
| 3 | 3 | * |
|---|
| 4 | | - * Copyright (C) 2008-2016, VMware, Inc. All Rights Reserved. |
|---|
| 4 | + * Copyright (C) 2008-2020, VMware, Inc. All Rights Reserved. |
|---|
| 5 | 5 | * |
|---|
| 6 | 6 | * This program is free software; you can redistribute it and/or modify it |
|---|
| 7 | 7 | * under the terms of the GNU General Public License as published by the |
|---|
| .. | .. |
|---|
| 82 | 82 | VMXNET3_CMD_RESERVED3, |
|---|
| 83 | 83 | VMXNET3_CMD_SET_COALESCE, |
|---|
| 84 | 84 | VMXNET3_CMD_REGISTER_MEMREGS, |
|---|
| 85 | + VMXNET3_CMD_SET_RSS_FIELDS, |
|---|
| 85 | 86 | |
|---|
| 86 | 87 | VMXNET3_CMD_FIRST_GET = 0xF00D0000, |
|---|
| 87 | 88 | VMXNET3_CMD_GET_QUEUE_STATUS = VMXNET3_CMD_FIRST_GET, |
|---|
| .. | .. |
|---|
| 96 | 97 | VMXNET3_CMD_GET_RESERVED1, |
|---|
| 97 | 98 | VMXNET3_CMD_GET_TXDATA_DESC_SIZE, |
|---|
| 98 | 99 | VMXNET3_CMD_GET_COALESCE, |
|---|
| 100 | + VMXNET3_CMD_GET_RSS_FIELDS, |
|---|
| 99 | 101 | }; |
|---|
| 100 | 102 | |
|---|
| 101 | 103 | /* |
|---|
| 102 | 104 | * Little Endian layout of bitfields - |
|---|
| 103 | 105 | * Byte 0 : 7.....len.....0 |
|---|
| 104 | | - * Byte 1 : rsvd gen 13.len.8 |
|---|
| 106 | + * Byte 1 : oco gen 13.len.8 |
|---|
| 105 | 107 | * Byte 2 : 5.msscof.0 ext1 dtype |
|---|
| 106 | 108 | * Byte 3 : 13...msscof...6 |
|---|
| 107 | 109 | * |
|---|
| 108 | 110 | * Big Endian layout of bitfields - |
|---|
| 109 | 111 | * Byte 0: 13...msscof...6 |
|---|
| 110 | 112 | * Byte 1 : 5.msscof.0 ext1 dtype |
|---|
| 111 | | - * Byte 2 : rsvd gen 13.len.8 |
|---|
| 113 | + * Byte 2 : oco gen 13.len.8 |
|---|
| 112 | 114 | * Byte 3 : 7.....len.....0 |
|---|
| 113 | 115 | * |
|---|
| 114 | 116 | * Thus, le32_to_cpu on the dword will allow the big endian driver to read |
|---|
| .. | .. |
|---|
| 123 | 125 | u32 msscof:14; /* MSS, checksum offset, flags */ |
|---|
| 124 | 126 | u32 ext1:1; |
|---|
| 125 | 127 | u32 dtype:1; /* descriptor type */ |
|---|
| 126 | | - u32 rsvd:1; |
|---|
| 128 | + u32 oco:1; |
|---|
| 127 | 129 | u32 gen:1; /* generation bit */ |
|---|
| 128 | 130 | u32 len:14; |
|---|
| 129 | 131 | #else |
|---|
| 130 | 132 | u32 len:14; |
|---|
| 131 | 133 | u32 gen:1; /* generation bit */ |
|---|
| 132 | | - u32 rsvd:1; |
|---|
| 134 | + u32 oco:1; |
|---|
| 133 | 135 | u32 dtype:1; /* descriptor type */ |
|---|
| 134 | 136 | u32 ext1:1; |
|---|
| 135 | 137 | u32 msscof:14; /* MSS, checksum offset, flags */ |
|---|
| .. | .. |
|---|
| 155 | 157 | }; |
|---|
| 156 | 158 | |
|---|
| 157 | 159 | /* TxDesc.OM values */ |
|---|
| 158 | | -#define VMXNET3_OM_NONE 0 |
|---|
| 159 | | -#define VMXNET3_OM_CSUM 2 |
|---|
| 160 | | -#define VMXNET3_OM_TSO 3 |
|---|
| 160 | +#define VMXNET3_OM_NONE 0 |
|---|
| 161 | +#define VMXNET3_OM_ENCAP 1 |
|---|
| 162 | +#define VMXNET3_OM_CSUM 2 |
|---|
| 163 | +#define VMXNET3_OM_TSO 3 |
|---|
| 161 | 164 | |
|---|
| 162 | 165 | /* fields in TxDesc we access w/o using bit fields */ |
|---|
| 163 | 166 | #define VMXNET3_TXD_EOP_SHIFT 12 |
|---|
| .. | .. |
|---|
| 223 | 226 | /* fields in RxDesc we access w/o using bit fields */ |
|---|
| 224 | 227 | #define VMXNET3_RXD_BTYPE_SHIFT 14 |
|---|
| 225 | 228 | #define VMXNET3_RXD_GEN_SHIFT 31 |
|---|
| 229 | + |
|---|
| 230 | +#define VMXNET3_RCD_HDR_INNER_SHIFT 13 |
|---|
| 226 | 231 | |
|---|
| 227 | 232 | struct Vmxnet3_RxCompDesc { |
|---|
| 228 | 233 | #ifdef __BIG_ENDIAN_BITFIELD |
|---|
| .. | .. |
|---|
| 685 | 690 | struct Vmxnet3_MemoryRegion memRegs[1]; |
|---|
| 686 | 691 | }; |
|---|
| 687 | 692 | |
|---|
| 693 | +enum Vmxnet3_RSSField { |
|---|
| 694 | + VMXNET3_RSS_FIELDS_TCPIP4 = 0x0001, |
|---|
| 695 | + VMXNET3_RSS_FIELDS_TCPIP6 = 0x0002, |
|---|
| 696 | + VMXNET3_RSS_FIELDS_UDPIP4 = 0x0004, |
|---|
| 697 | + VMXNET3_RSS_FIELDS_UDPIP6 = 0x0008, |
|---|
| 698 | + VMXNET3_RSS_FIELDS_ESPIP4 = 0x0010, |
|---|
| 699 | + VMXNET3_RSS_FIELDS_ESPIP6 = 0x0020, |
|---|
| 700 | +}; |
|---|
| 701 | + |
|---|
| 688 | 702 | /* If the command data <= 16 bytes, use the shared memory directly. |
|---|
| 689 | 703 | * otherwise, use variable length configuration descriptor. |
|---|
| 690 | 704 | */ |
|---|
| 691 | 705 | union Vmxnet3_CmdInfo { |
|---|
| 692 | 706 | struct Vmxnet3_VariableLenConfDesc varConf; |
|---|
| 693 | 707 | struct Vmxnet3_SetPolling setPolling; |
|---|
| 708 | + enum Vmxnet3_RSSField setRssFields; |
|---|
| 694 | 709 | __le64 data[2]; |
|---|
| 695 | 710 | }; |
|---|
| 696 | 711 | |
|---|