qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Yuri Benditovich <yuri.benditovich@daynix.com>
Cc: Yan Vugenfirer <yan@daynix.com>, Jason Wang <jasowang@redhat.com>,
	qemu-devel@nongnu.org
Subject: Re: [PATCH 1/3] virtio-net: introduce RSS RX steering feature
Date: Fri, 6 Mar 2020 05:25:43 -0500	[thread overview]
Message-ID: <20200306052517-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <CAOEp5Oc+dTzJHzof9suUbXEgBnYoa4bh87K-ALWMzw_MzYf4Mw@mail.gmail.com>

On Fri, Mar 06, 2020 at 11:29:50AM +0200, Yuri Benditovich wrote:
> 
> 
> On Thu, Mar 5, 2020 at 3:21 PM Michael S. Tsirkin <mst@redhat.com> wrote:
> 
>     On Wed, Feb 26, 2020 at 07:48:07PM +0200, Yuri Benditovich wrote:
>     > Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
>     > ---
>     >  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.


Make a private copy of it with a different name for now.
Add a comment so we don't forget to remove down the road.

> 
> 
>     > 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	other threads:[~2020-03-06 10:26 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-26 17:48 [PATCH 0/3] reference implementation of RSS Yuri Benditovich
2020-02-26 17:48 ` [PATCH 1/3] virtio-net: introduce RSS RX steering feature Yuri Benditovich
2020-03-05 13:21   ` Michael S. Tsirkin
2020-03-06  9:29     ` Yuri Benditovich
2020-03-06 10:25       ` Michael S. Tsirkin [this message]
2020-02-26 17:48 ` [PATCH 2/3] virtio-net: implement RSS configuration command Yuri Benditovich
2020-02-26 17:48 ` [PATCH 3/3] virtio-net: implement RX RSS processing Yuri Benditovich
2020-03-05 13:20   ` Michael S. Tsirkin
2020-03-05 19:54     ` Yuri Benditovich
2020-03-05 20:02       ` Michael S. Tsirkin
2020-03-05 21:04         ` Yuri Benditovich
2020-03-05 12:57 ` [PATCH 0/3] reference implementation of RSS Yuri Benditovich
2020-03-06  9:27 ` Jason Wang
2020-03-06  9:50   ` Yuri Benditovich
2020-03-08  8:06     ` Michael S. Tsirkin
2020-03-08  9:56       ` Yuri Benditovich
2020-03-08 12:17         ` Michael S. Tsirkin
2020-03-08 12:44           ` Yuri Benditovich
2020-03-08 13:15             ` Michael S. Tsirkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200306052517-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=yan@daynix.com \
    --cc=yuri.benditovich@daynix.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).