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 v3 2/3] virtio-net: Introduce RSS receive steering feature


OK my bad, missed the update to the working copy of the spec.

Rob Miller
(919)721-3339


On Mon, Mar 2, 2020 at 8:04 AM Yuri Benditovich <yuri.benditovich@daynix.com> wrote:
On Mon, Mar 2, 2020 at 2:17 PM Rob Miller <rob.miller@broadcom.com> wrote:
>
> I think it would be good to have a means to negotiate which types of RSS that a device is willing to do. Perhaps a CTRLQ command to get RSS capabilities then only set those. For example, if a device wishes not to RSS on UDPx but will RSS on TCPx, and a HASH request on TCP|USP, this would result in a failure.
>
> Also, what is the definitions of the xxx_EX options?
>

The device indicates its capabilities in its configuration space.
The exact details are in the latest master branch of the virtio-spec
(the discussion was in virtio-comment list).
These commits are to align Linux kernel header to what the spec defines.

> Rob Miller
> rob.miller@broadcom.com
> (919)721-3339
>
>
> On Sun, Mar 1, 2020 at 9:33 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 19e76b3e3a64..188ad3eecdc8 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));
>>
>>Â /*
>> @@ -246,7 +264,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
>> @@ -259,11 +279,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]