|
57 | 57 | * Steering */
|
58 | 58 | #define VIRTIO_NET_F_CTRL_MAC_ADDR 23 /* Set MAC address */
|
59 | 59 |
|
| 60 | +#define VIRTIO_NET_F_HASH_REPORT 57 /* Supports hash report */ |
60 | 61 | #define VIRTIO_NET_F_RSS 60 /* Supports RSS RX steering */
|
61 | 62 | #define VIRTIO_NET_F_RSC_EXT 61 /* extended coalescing info */
|
62 | 63 | #define VIRTIO_NET_F_STANDBY 62 /* Act as standby for another device
|
@@ -156,6 +157,23 @@ struct virtio_net_hdr_v1 {
|
156 | 157 | __virtio16 num_buffers; /* Number of merged rx buffers */
|
157 | 158 | };
|
158 | 159 |
|
| 160 | +struct virtio_net_hdr_v1_hash { |
| 161 | + struct virtio_net_hdr_v1 hdr; |
| 162 | + __le32 hash_value; |
| 163 | +#define VIRTIO_NET_HASH_REPORT_NONE 0 |
| 164 | +#define VIRTIO_NET_HASH_REPORT_IPv4 1 |
| 165 | +#define VIRTIO_NET_HASH_REPORT_TCPv4 2 |
| 166 | +#define VIRTIO_NET_HASH_REPORT_UDPv4 3 |
| 167 | +#define VIRTIO_NET_HASH_REPORT_IPv6 4 |
| 168 | +#define VIRTIO_NET_HASH_REPORT_TCPv6 5 |
| 169 | +#define VIRTIO_NET_HASH_REPORT_UDPv6 6 |
| 170 | +#define VIRTIO_NET_HASH_REPORT_IPv6_EX 7 |
| 171 | +#define VIRTIO_NET_HASH_REPORT_TCPv6_EX 8 |
| 172 | +#define VIRTIO_NET_HASH_REPORT_UDPv6_EX 9 |
| 173 | + __le16 hash_report; |
| 174 | + __le16 padding; |
| 175 | +}; |
| 176 | + |
159 | 177 | #ifndef VIRTIO_NET_NO_LEGACY
|
160 | 178 | /* This header comes first in the scatter-gather list.
|
161 | 179 | * For legacy virtio, if VIRTIO_F_ANY_LAYOUT is not negotiated, it must
|
@@ -304,6 +322,24 @@ struct virtio_net_rss_config {
|
304 | 322 |
|
305 | 323 | #define VIRTIO_NET_CTRL_MQ_RSS_CONFIG 1
|
306 | 324 |
|
| 325 | +/* |
| 326 | + * The command VIRTIO_NET_CTRL_MQ_HASH_CONFIG requests the device |
| 327 | + * to include in the virtio header of the packet the value of the |
| 328 | + * calculated hash and the report type of hash. It also provides |
| 329 | + * parameters for hash calculation. The command requires feature |
| 330 | + * VIRTIO_NET_F_HASH_REPORT to be negotiated to extend the |
| 331 | + * layout of virtio header as defined in virtio_net_hdr_v1_hash. |
| 332 | + */ |
| 333 | +struct virtio_net_hash_config { |
| 334 | + __le32 hash_types; |
| 335 | + /* for compatibility with virtio_net_rss_config */ |
| 336 | + __le16 reserved[4]; |
| 337 | + __u8 hash_key_length; |
| 338 | + __u8 hash_key_data[/* hash_key_length */]; |
| 339 | +}; |
| 340 | + |
| 341 | + #define VIRTIO_NET_CTRL_MQ_HASH_CONFIG 2 |
| 342 | + |
307 | 343 | /*
|
308 | 344 | * Control network offloads
|
309 | 345 | *
|
|
0 commit comments