diff options
author | Steven Luong <sluong@cisco.com> | 2023-12-14 08:54:55 -0800 |
---|---|---|
committer | Beno�t Ganne <bganne@cisco.com> | 2024-08-29 12:41:30 +0000 |
commit | e9bc3320192d72f817379aa4621c1dff15bdee29 (patch) | |
tree | 4eecbe14e7505f5349cb0d805814d68d8c044327 /src/vnet/devices/virtio/virtio_std.h | |
parent | fc49c63e7426d5c254b4c38f2e74a9a6d75f11ba (diff) |
virtio: RSS support
Add RSS support to make use of multiple queues.
With 4 RX queues and RSS enabled
ping from host to guest vm ip queue use
192.168.2.3 192.168.2.1 2
'' 192.168.2.10 0
'' 192.168.2.5 1
'' 192.168.2.105 3
With 4 RX queues and RSS disabled, queue 0 is always used for all of the above cases
Type: improvement
Change-Id: I3ca78fd83fce26cbe8f23fee0a9034cb572bacb7
Signed-off-by: Steven Luong <sluong@cisco.com>
Diffstat (limited to 'src/vnet/devices/virtio/virtio_std.h')
-rw-r--r-- | src/vnet/devices/virtio/virtio_std.h | 96 |
1 files changed, 54 insertions, 42 deletions
diff --git a/src/vnet/devices/virtio/virtio_std.h b/src/vnet/devices/virtio/virtio_std.h index ec988c08dbb..66b8bac092c 100644 --- a/src/vnet/devices/virtio/virtio_std.h +++ b/src/vnet/devices/virtio/virtio_std.h @@ -15,49 +15,61 @@ #ifndef __VIRTIO_STD_H__ #define __VIRTIO_STD_H__ -#define foreach_virtio_net_features \ - _ (VIRTIO_NET_F_CSUM, 0) /* Host handles pkts w/ partial csum */ \ - _ (VIRTIO_NET_F_GUEST_CSUM, 1) /* Guest handles pkts w/ partial csum */ \ - _ (VIRTIO_NET_F_CTRL_GUEST_OFFLOADS, 2) /* Dynamic offload configuration. */ \ - _ (VIRTIO_NET_F_MTU, 3) /* Initial MTU advice. */ \ - _ (VIRTIO_NET_F_MAC, 5) /* Host has given MAC address. */ \ - _ (VIRTIO_NET_F_GSO, 6) /* Host handles pkts w/ any GSO. */ \ - _ (VIRTIO_NET_F_GUEST_TSO4, 7) /* Guest can handle TSOv4 in. */ \ - _ (VIRTIO_NET_F_GUEST_TSO6, 8) /* Guest can handle TSOv6 in. */ \ - _ (VIRTIO_NET_F_GUEST_ECN, 9) /* Guest can handle TSO[6] w/ ECN in. */ \ - _ (VIRTIO_NET_F_GUEST_UFO, 10) /* Guest can handle UFO in. */ \ - _ (VIRTIO_NET_F_HOST_TSO4, 11) /* Host can handle TSOv4 in. */ \ - _ (VIRTIO_NET_F_HOST_TSO6, 12) /* Host can handle TSOv6 in. */ \ - _ (VIRTIO_NET_F_HOST_ECN, 13) /* Host can handle TSO[6] w/ ECN in. */ \ - _ (VIRTIO_NET_F_HOST_UFO, 14) /* Host can handle UFO in. */ \ - _ (VIRTIO_NET_F_MRG_RXBUF, 15) /* Host can merge receive buffers. */ \ - _ (VIRTIO_NET_F_STATUS, 16) /* virtio_net_config.status available */ \ - _ (VIRTIO_NET_F_CTRL_VQ, 17) /* Control channel available */ \ - _ (VIRTIO_NET_F_CTRL_RX, 18) /* Control channel RX mode support */ \ - _ (VIRTIO_NET_F_CTRL_VLAN, 19) /* Control channel VLAN filtering */ \ - _ (VIRTIO_NET_F_CTRL_RX_EXTRA, 20) /* Extra RX mode control support */ \ - _ (VIRTIO_NET_F_GUEST_ANNOUNCE, 21) /* Guest can announce device on the network */ \ - _ (VIRTIO_NET_F_MQ, 22) /* Device supports Receive Flow Steering */ \ - _ (VIRTIO_NET_F_CTRL_MAC_ADDR, 23) /* Set MAC address */ \ - _ (VIRTIO_F_NOTIFY_ON_EMPTY, 24) \ - _ (VHOST_F_LOG_ALL, 26) /* Log all write descriptors */ \ - _ (VIRTIO_F_ANY_LAYOUT, 27) /* Can the device handle any descriptor layout */ \ - _ (VIRTIO_RING_F_INDIRECT_DESC, 28) /* Support indirect buffer descriptors */ \ - _ (VIRTIO_RING_F_EVENT_IDX, 29) /* The Guest publishes the used index for which it expects an interrupt \ - * at the end of the avail ring. Host should ignore the avail->flags field. */ \ -/* The Host publishes the avail index for which it expects a kick \ - * at the end of the used ring. Guest should ignore the used->flags field. */ \ - _ (VHOST_USER_F_PROTOCOL_FEATURES, 30) \ - _ (VIRTIO_F_VERSION_1, 32) /* v1.0 compliant. */ \ - _ (VIRTIO_F_IOMMU_PLATFORM, 33) \ - _ (VIRTIO_F_RING_PACKED, 34) \ - _ (VIRTIO_F_IN_ORDER, 35) /* all buffers are used by the device in the */ \ - /* same order in which they have been made available */ \ +#define foreach_virtio_net_features \ + _ (VIRTIO_NET_F_CSUM, 0) /* Host handles pkts w/ partial csum */ \ + _ (VIRTIO_NET_F_GUEST_CSUM, 1) /* Guest handles pkts w/ partial csum */ \ + _ (VIRTIO_NET_F_CTRL_GUEST_OFFLOADS, \ + 2) /* Dynamic offload configuration. */ \ + _ (VIRTIO_NET_F_MTU, 3) /* Initial MTU advice. */ \ + _ (VIRTIO_NET_F_MAC, 5) /* Host has given MAC address. */ \ + _ (VIRTIO_NET_F_GSO, 6) /* Host handles pkts w/ any GSO. */ \ + _ (VIRTIO_NET_F_GUEST_TSO4, 7) /* Guest can handle TSOv4 in. */ \ + _ (VIRTIO_NET_F_GUEST_TSO6, 8) /* Guest can handle TSOv6 in. */ \ + _ (VIRTIO_NET_F_GUEST_ECN, 9) /* Guest can handle TSO[6] w/ ECN in. */ \ + _ (VIRTIO_NET_F_GUEST_UFO, 10) /* Guest can handle UFO in. */ \ + _ (VIRTIO_NET_F_HOST_TSO4, 11) /* Host can handle TSOv4 in. */ \ + _ (VIRTIO_NET_F_HOST_TSO6, 12) /* Host can handle TSOv6 in. */ \ + _ (VIRTIO_NET_F_HOST_ECN, 13) /* Host can handle TSO[6] w/ ECN in. */ \ + _ (VIRTIO_NET_F_HOST_UFO, 14) /* Host can handle UFO in. */ \ + _ (VIRTIO_NET_F_MRG_RXBUF, 15) /* Host can merge receive buffers. */ \ + _ (VIRTIO_NET_F_STATUS, 16) /* virtio_net_config.status available */ \ + _ (VIRTIO_NET_F_CTRL_VQ, 17) /* Control channel available */ \ + _ (VIRTIO_NET_F_CTRL_RX, 18) /* Control channel RX mode support */ \ + _ (VIRTIO_NET_F_CTRL_VLAN, 19) /* Control channel VLAN filtering */ \ + _ (VIRTIO_NET_F_CTRL_RX_EXTRA, 20) /* Extra RX mode control support */ \ + _ (VIRTIO_NET_F_GUEST_ANNOUNCE, \ + 21) /* Guest can announce device on the network */ \ + _ (VIRTIO_NET_F_MQ, 22) /* Device supports Receive Flow Steering */ \ + _ (VIRTIO_NET_F_CTRL_MAC_ADDR, 23) /* Set MAC address */ \ + _ (VIRTIO_F_NOTIFY_ON_EMPTY, 24) \ + _ (VHOST_F_LOG_ALL, 26) /* Log all write descriptors */ \ + _ (VIRTIO_F_ANY_LAYOUT, \ + 27) /* Can the device handle any descriptor layout */ \ + _ (VIRTIO_RING_F_INDIRECT_DESC, \ + 28) /* Support indirect buffer descriptors */ \ + _ (VIRTIO_RING_F_EVENT_IDX, \ + 29) /* The Guest publishes the used index for which it expects an \ + * interrupt at the end of the avail ring. Host should ignore the \ + * avail->flags field. */ \ + /* The Host publishes the avail index for which it expects a kick \ + * at the end of the used ring. Guest should ignore the used->flags field. \ + */ \ + _ (VHOST_USER_F_PROTOCOL_FEATURES, 30) \ + _ (VIRTIO_F_VERSION_1, 32) /* v1.0 compliant. */ \ + _ (VIRTIO_F_IOMMU_PLATFORM, 33) \ + _ (VIRTIO_F_RING_PACKED, 34) \ + _ (VIRTIO_F_IN_ORDER, 35) /* all buffers are used by the device in the */ \ + /* same order in which they have been made available */ \ _ (VIRTIO_F_ORDER_PLATFORM, 36) /* memory accesses by the driver and the */ \ - /* device are ordered in a way described by the platfor */ \ - _ (VIRTIO_F_NOTIFICATION_DATA, 38) /* the driver passes extra data (besides */ \ - /* identifying the virtqueue) in its device notifications. */ \ - _ (VIRTIO_NET_F_SPEED_DUPLEX, 63) /* Device set linkspeed and duplex */ + /* device are ordered in a way described by the platfor */ \ + _ (VIRTIO_F_NOTIFICATION_DATA, \ + 38) /* the driver passes extra data (besides */ \ + /* identifying the virtqueue) in its device notifications. */ \ + _ (VIRTIO_NET_F_RING_RESET, 40) /* Device supports individual ring reset */ \ + _ (VIRTIO_NET_F_HASH_REPORT, \ + 57) /* Device supports per packet hash value */ \ + _ (VIRTIO_NET_F_RSS, 60) /* Device supports RSS */ \ + _ (VIRTIO_NET_F_SPEED_DUPLEX, 63) /* Device set linkspeed and duplex */ typedef enum { |