qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/3] virtio-net: introduce RSS RX steering feature


From: Yuri Benditovich
Subject: Re: [PATCH 1/3] virtio-net: introduce RSS RX steering feature
Date: Fri, 6 Mar 2020 11:29:50 +0200



On Thu, Mar 5, 2020 at 3:21 PM Michael S. Tsirkin <address@hidden> wrote:
On Wed, Feb 26, 2020 at 07:48:07PM +0200, Yuri Benditovich wrote:
> Signed-off-by: Yuri Benditovich <address@hidden>
> ---
>  include/standard-headers/linux/virtio_net.h | 37 +++++++++++++++++++--
>  1 file changed, 35 insertions(+), 2 deletions(-)


It will take a bit until next merge window when the linux
headers will be updated.
Until that happens you can just put these defines where
they are used.

We also extend the configuration virtio_net_config structure and its
field 'supported_hash_types' uses these defines. Please advise.
 

> diff --git a/include/standard-headers/linux/virtio_net.h b/include/standard-headers/linux/virtio_net.h
> index 260c3681d7..3bc100afe3 100644
> --- a/include/standard-headers/linux/virtio_net.h
> +++ b/include/standard-headers/linux/virtio_net.h
> @@ -57,6 +57,7 @@
>                                        * Steering */
>  #define VIRTIO_NET_F_CTRL_MAC_ADDR 23        /* Set MAC address */

> +#define VIRTIO_NET_F_RSS       60    /* Supports RSS RX steering */
>  #define VIRTIO_NET_F_STANDBY   62    /* Act as standby for another device
>                                        * with the same MAC.
>                                        */
> @@ -69,6 +70,16 @@
>  #define VIRTIO_NET_S_LINK_UP 1       /* Link is up */
>  #define VIRTIO_NET_S_ANNOUNCE        2       /* Announcement is needed */

> +#define VIRTIO_NET_RSS_HASH_TYPE_IPv4              (1 << 0)
> +#define VIRTIO_NET_RSS_HASH_TYPE_TCPv4             (1 << 1)
> +#define VIRTIO_NET_RSS_HASH_TYPE_UDPv4             (1 << 2)
> +#define VIRTIO_NET_RSS_HASH_TYPE_IPv6              (1 << 3)
> +#define VIRTIO_NET_RSS_HASH_TYPE_TCPv6             (1 << 4)
> +#define VIRTIO_NET_RSS_HASH_TYPE_UDPv6             (1 << 5)
> +#define VIRTIO_NET_RSS_HASH_TYPE_IP_EX             (1 << 6)
> +#define VIRTIO_NET_RSS_HASH_TYPE_TCP_EX            (1 << 7)
> +#define VIRTIO_NET_RSS_HASH_TYPE_UDP_EX            (1 << 8)
> +
>  struct virtio_net_config {
>       /* The config defining mac address (if VIRTIO_NET_F_MAC) */
>       uint8_t mac[ETH_ALEN];
> @@ -92,6 +103,14 @@ struct virtio_net_config {
>        * Any other value stands for unknown.
>        */
>       uint8_t duplex;
> +
> +     /* maximal size of RSS key */
> +     uint8_t rss_max_key_size;
> +     /* maximal number of indirection table entries */
> +     uint16_t rss_max_indirection_table_length;
> +     /* bitmask of supported VIRTIO_NET_RSS_HASH_ types */
> +     uint32_t supported_hash_types;
> +
>  } QEMU_PACKED;

>  /*
> @@ -237,15 +256,29 @@ struct virtio_net_ctrl_mac {
>   * Accordingly, driver should not transmit new packets  on virtqueues other than
>   * specified.
>   */
> +#define VIRTIO_NET_CTRL_MQ   4
> + #define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET        0
> + #define VIRTIO_NET_CTRL_MQ_RSS_CONFIG          1
> +
> +/* for VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET */
>  struct virtio_net_ctrl_mq {
>       __virtio16 virtqueue_pairs;
>  };

> -#define VIRTIO_NET_CTRL_MQ   4
> - #define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET        0
>   #define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MIN        1
>   #define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX        0x8000

> +/* for VIRTIO_NET_CTRL_MQ_RSS_CONFIG */
> +struct virtio_net_rss_config {
> +    uint32_t hash_types;
> +    uint16_t indirection_table_mask;
> +    uint16_t unclassified_queue;
> +    uint16_t indirection_table[1/* + indirection_table_mask*/];
> +    uint16_t max_tx_vq;
> +    uint8_t hash_key_length;
> +    uint8_t hash_key_data[/*hash_key_length*/];
> +};
> +
>  /*
>   * Control network offloads
>   *
> --
> 2.17.1


reply via email to

[Prev in Thread] Current Thread [Next in Thread]