From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: virtio-dev-return-6880-cohuck=redhat.com@lists.oasis-open.org Sender: List-Post: List-Help: List-Unsubscribe: List-Subscribe: Received: from lists.oasis-open.org (oasis-open.org [10.110.1.242]) by lists.oasis-open.org (Postfix) with ESMTP id B6D25985F0F for ; Tue, 3 Mar 2020 14:17:51 +0000 (UTC) MIME-Version: 1.0 References: <20200302115003.14877-1-yuri.benditovich@daynix.com> <20200302115003.14877-3-yuri.benditovich@daynix.com> In-Reply-To: <20200302115003.14877-3-yuri.benditovich@daynix.com> From: Rob Miller Date: Tue, 3 Mar 2020 09:17:24 -0500 Message-ID: Subject: Re: [virtio-dev] [PATCH v4 2/3] virtio-net: Introduce RSS receive steering feature Content-Type: multipart/alternative; boundary="000000000000ff937a059ff3f7e0" To: Virtio-Dev List-ID: --000000000000ff937a059ff3f7e0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Given that this new feature clarifies RSS, should the existing references to RSS be updated in the spec to have RSS replaced with RFS (aka Receive Flow Steering)? Rob Miller rob.miller@broadcom.com (919)721-3339 On Mon, Mar 2, 2020 at 6:52 AM Yuri Benditovich wrote: > RSS (Receive-side scaling) defines hash calculation > rules and decision on receive virtqueue according to > the calculated hash, provided mask to apply and > provided indirection table containing indices of > receive virqueues. The driver sends the control > command to enable multiqueue and provide parameters > for receive steering. > > Signed-off-by: Yuri Benditovich > --- > include/uapi/linux/virtio_net.h | 42 +++++++++++++++++++++++++++++++-- > 1 file changed, 40 insertions(+), 2 deletions(-) > > diff --git a/include/uapi/linux/virtio_net.h > b/include/uapi/linux/virtio_net.h > index 6466c5979a93..aec6fac3666a 100644 > --- a/include/uapi/linux/virtio_net.h > +++ b/include/uapi/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_RSC_EXT 61 /* extended coalescing info */ > #define VIRTIO_NET_F_STANDBY 62 /* Act as standby for another > device > * with the same MAC. > @@ -70,6 +71,17 @@ > #define VIRTIO_NET_S_LINK_UP 1 /* Link is up */ > #define VIRTIO_NET_S_ANNOUNCE 2 /* Announcement is needed */ > > +/* supported/enabled hash types */ > +#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) */ > __u8 mac[ETH_ALEN]; > @@ -93,6 +105,12 @@ struct virtio_net_config { > * Any other value stands for unknown. > */ > __u8 duplex; > + /* maximum size of RSS key */ > + __u8 rss_max_key_size; > + /* maximum number of indirection table entries */ > + __le16 rss_max_indirection_table_length; > + /* bitmask of supported VIRTIO_NET_RSS_HASH_ types */ > + __le32 supported_hash_types; > } __attribute__((packed)); > > /* > @@ -248,7 +266,9 @@ struct virtio_net_ctrl_mac { > > /* > * Control Receive Flow Steering > - * > + */ > +#define VIRTIO_NET_CTRL_MQ 4 > +/* > * The command VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET > * enables Receive Flow Steering, specifying the number of the transmit > and > * receive queues that will be used. After the command is consumed and > acked by > @@ -261,11 +281,29 @@ 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 > > +/* > + * The command VIRTIO_NET_CTRL_MQ_RSS_CONFIG has the same effect as > + * VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET does and additionally configures > + * the receive steering to use a hash calculated for incoming packet > + * to decide on receive virtqueue to place the packet. The command > + * also provides parameters to calculate a hash and receive virtqueue. > + */ > +struct virtio_net_rss_config { > + __le32 hash_types; > + __le16 indirection_table_mask; > + __le16 unclassified_queue; > + __le16 indirection_table[1/* + indirection_table_mask */]; > + __le16 max_tx_vq; > + __u8 hash_key_length; > + __u8 hash_key_data[/* hash_key_length */]; > +}; > + > + #define VIRTIO_NET_CTRL_MQ_RSS_CONFIG 1 > + > /* > * Control network offloads > * > -- > 2.17.1 > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org > For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org > > --000000000000ff937a059ff3f7e0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Given=C2=A0that this new feature clarifies RSS, should the= existing references to RSS be updated in the spec to have RSS replaced wit= h RFS (aka Receive Flow Steering)?

Rob Miller
(919)721-3339
=


On Mon, Mar 2, 2020 at 6:52 AM Yuri Benditovich <<= a href=3D"mailto:yuri.benditovich@daynix.com">yuri.benditovich@daynix.com> wrote:
RS= S (Receive-side scaling) defines hash calculation
rules and decision on receive virtqueue according to
the calculated hash, provided mask to apply and
provided indirection table containing indices of
receive virqueues. The driver sends the control
command to enable multiqueue and provide parameters
for receive steering.

Signed-off-by: Yuri Benditovich <yuri.benditovich@daynix.com>
---
=C2=A0include/uapi/linux/virtio_net.h | 42 +++++++++++++++++++++++++++++++-= -
=C2=A01 file changed, 40 insertions(+), 2 deletions(-)

diff --git a/include/uapi/linux/virtio_net.h b/include/uapi/linux/virtio_ne= t.h
index 6466c5979a93..aec6fac3666a 100644
--- a/include/uapi/linux/virtio_net.h
+++ b/include/uapi/linux/virtio_net.h
@@ -57,6 +57,7 @@
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0* = Steering */
=C2=A0#define VIRTIO_NET_F_CTRL_MAC_ADDR 23=C2=A0 /* Set MAC address */

+#define VIRTIO_NET_F_RSS=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A060=C2=A0 =C2=A0 = /* Supports RSS RX steering */
=C2=A0#define VIRTIO_NET_F_RSC_EXT=C2=A0 =C2=A0 =C2=A061=C2=A0 =C2=A0 /* ex= tended coalescing info */
=C2=A0#define VIRTIO_NET_F_STANDBY=C2=A0 =C2=A0 =C2=A062=C2=A0 =C2=A0 /* Ac= t as standby for another device
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0* = with the same MAC.
@@ -70,6 +71,17 @@
=C2=A0#define VIRTIO_NET_S_LINK_UP=C2=A0 =C2=A01=C2=A0 =C2=A0 =C2=A0 =C2=A0= /* Link is up */
=C2=A0#define VIRTIO_NET_S_ANNOUNCE=C2=A0 2=C2=A0 =C2=A0 =C2=A0 =C2=A0/* An= nouncement is needed */

+/* supported/enabled hash types */
+#define VIRTIO_NET_RSS_HASH_TYPE_IPv4=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (1= << 0)
+#define VIRTIO_NET_RSS_HASH_TYPE_TCPv4=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(1= << 1)
+#define VIRTIO_NET_RSS_HASH_TYPE_UDPv4=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(1= << 2)
+#define VIRTIO_NET_RSS_HASH_TYPE_IPv6=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (1= << 3)
+#define VIRTIO_NET_RSS_HASH_TYPE_TCPv6=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(1= << 4)
+#define VIRTIO_NET_RSS_HASH_TYPE_UDPv6=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(1= << 5)
+#define VIRTIO_NET_RSS_HASH_TYPE_IP_EX=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(1= << 6)
+#define VIRTIO_NET_RSS_HASH_TYPE_TCP_EX=C2=A0 =C2=A0 =C2=A0 =C2=A0 (1 <= < 7)
+#define VIRTIO_NET_RSS_HASH_TYPE_UDP_EX=C2=A0 =C2=A0 =C2=A0 =C2=A0 (1 <= < 8)
+
=C2=A0struct virtio_net_config {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 /* The config defining mac address (if VIRTIO_N= ET_F_MAC) */
=C2=A0 =C2=A0 =C2=A0 =C2=A0 __u8 mac[ETH_ALEN];
@@ -93,6 +105,12 @@ struct virtio_net_config {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0* Any other value stands for unknown.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*/
=C2=A0 =C2=A0 =C2=A0 =C2=A0 __u8 duplex;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0/* maximum size of RSS key */
+=C2=A0 =C2=A0 =C2=A0 =C2=A0__u8 rss_max_key_size;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0/* maximum number of indirection table entries = */
+=C2=A0 =C2=A0 =C2=A0 =C2=A0__le16 rss_max_indirection_table_length;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0/* bitmask of supported VIRTIO_NET_RSS_HASH_ ty= pes */
+=C2=A0 =C2=A0 =C2=A0 =C2=A0__le32 supported_hash_types;
=C2=A0} __attribute__((packed));

=C2=A0/*
@@ -248,7 +266,9 @@ struct virtio_net_ctrl_mac {

=C2=A0/*
=C2=A0 * Control Receive Flow Steering
- *
+ */
+#define VIRTIO_NET_CTRL_MQ=C2=A0 =C2=A04
+/*
=C2=A0 * The command VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET
=C2=A0 * enables Receive Flow Steering, specifying the number of the transm= it and
=C2=A0 * receive queues that will be used. After the command is consumed an= d acked by
@@ -261,11 +281,29 @@ struct virtio_net_ctrl_mq {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 __virtio16 virtqueue_pairs;
=C2=A0};

-#define VIRTIO_NET_CTRL_MQ=C2=A0 =C2=A04
=C2=A0 #define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET=C2=A0 =C2=A0 =C2=A0 =C2=A0 0=
=C2=A0 #define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MIN=C2=A0 =C2=A0 =C2=A0 =C2=A0 1=
=C2=A0 #define VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX=C2=A0 =C2=A0 =C2=A0 =C2=A0 0= x8000

+/*
+ * The command VIRTIO_NET_CTRL_MQ_RSS_CONFIG has the same effect as
+ * VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET does and additionally configures
+ * the receive steering to use a hash calculated for incoming packet
+ * to decide on receive virtqueue to place the packet. The command
+ * also provides parameters to calculate a hash and receive virtqueue.
+ */
+struct virtio_net_rss_config {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0__le32 hash_types;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0__le16 indirection_table_mask;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0__le16 unclassified_queue;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0__le16 indirection_table[1/* + indirection_tabl= e_mask */];
+=C2=A0 =C2=A0 =C2=A0 =C2=A0__le16 max_tx_vq;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0__u8 hash_key_length;
+=C2=A0 =C2=A0 =C2=A0 =C2=A0__u8 hash_key_data[/* hash_key_length */];
+};
+
+ #define VIRTIO_NET_CTRL_MQ_RSS_CONFIG=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 1=
+
=C2=A0/*
=C2=A0 * Control network offloads
=C2=A0 *
--
2.17.1


---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail:
virtio-dev-help@lists.oasis-open.org
--000000000000ff937a059ff3f7e0--