oasis-tcs / virtio-spec

OASIS Virtual I/O Device TC: Source code for the VIRTIO (Virtual I/O) Specification maintained by the OASIS Virtual I/O Device (VIRTIO) Technical Committee
https://github.com/oasis-tcs/virtio-spec
Other
241 stars 72 forks source link

virtio_net: support inner header hash #151

Closed hengqiali closed 1 year ago

hengqiali commented 1 year ago

When VIRTIO_NET_F_RSS is negotiated and the tunnel is used to encapsulate the packets, the hash calculated using the outer header of the receive packets is always fixed for the same flow packets, i.e. they will be steered to the same receive queue.

We add a VIRTIO_NET_F_HASH_GRE_VXLAN_GENEVE_INNER feature bit and related bitmasks in \field{hash_types}, which instructs the device to calculate the hash using the inner headers of GRE, VXLAN or GENEVE-encapsulated packets. Besides, \field{hash_report_tunnel} are added to report packet type when calculating hash over the inner header.

https://lists.oasis-open.org/archives/virtio-dev/202212/msg00000.html

hengqiali commented 1 year ago

If the tunnel is used to encapsulate the packets, the hash calculated using the outer header of the receive packets is always fixed for the same flow packets, i.e. they will be steered to the same receive queue.

We add a tunnel feature bit VIRTIO_NET_F_HASH_TUNNEL and related bitmasks in \field{hash_types}, which instructs the device to calculate the hash using the inner headers of tunnel-encapsulated packets. Besides, values in \field{hash_report_tunnel} are added to report tunnel types.

https://lists.oasis-open.org/archives/virtio-dev/202301/msg00023.html