OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

virtio-dev message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [virtio-dev] [PATCH v4 2/3] virtio-net: Introduce RSS receive steering feature




On Tue, Mar 3, 2020 at 4:17 PM Rob Miller <rob.miller@broadcom.com> wrote:
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)?

RSS is aÂflavor of receive flow steering in addition to already existing 'automatic'.
Â

Rob Miller
(919)721-3339


On Mon, Mar 2, 2020 at 6:52 AM Yuri Benditovich <yuri.benditovich@daynix.com> 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 <yuri.benditovich@daynix.com>
---
Â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



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]