virtio-dev.lists.oasis-open.org archive mirror
 help / color / mirror / Atom feed
From: Heng Qi <hengqi@linux.alibaba.com>
To: Parav Pandit <parav@nvidia.com>
Cc: "Michael S . Tsirkin" <mst@redhat.com>,
	Jason Wang <jasowang@redhat.com>,
	Yuri Benditovich <yuri.benditovich@daynix.com>,
	Xuan Zhuo <xuanzhuo@linux.alibaba.com>,
	"virtio-comment@lists.oasis-open.org"
	<virtio-comment@lists.oasis-open.org>,
	"virtio-dev@lists.oasis-open.org"
	<virtio-dev@lists.oasis-open.org>
Subject: Re: [virtio-dev] RE: [PATCH v15] virtio-net: support inner header hash
Date: Thu, 8 Jun 2023 23:29:35 +0800	[thread overview]
Message-ID: <0e9403b3-b6ec-bb11-5f12-9ee06100320f@linux.alibaba.com> (raw)
In-Reply-To: <PH0PR12MB548119AC6E8CF4A5EBCBA4D3DC50A@PH0PR12MB5481.namprd12.prod.outlook.com>



在 2023/6/8 下午10:26, Parav Pandit 写道:
>> From: Heng Qi <hengqi@linux.alibaba.com>
>> Sent: Thursday, June 8, 2023 2:41 AM
> [..]
>>>> +The device MUST calculate the inner header hash for the configured
>>>> \field{hash_tunnel_types} without the outer UDP header if
>>>> \field{hash_option} is 1.
>>>> +
>>> This I think conflicts with the current RSS where if this override (higher priority
>> than RSS) or not.
>>
>> VIRTIO_NET_F_HASH_TUNNEL instructs the device to calculate an inner header
>> hash for configured tunnel types.
>> Then, which fields are used for the calculation of the inner header hash is
>> determined by the RSS configuration.
>>
>> Therefore, if the inner header hash uses \field{hash_option} to indicate that the
>> outer source UDP port is used to calculate the hash, it overrides the RSS
>> configuration (higher priority than RSS). It now not only indicates for which
>> tunnel types the inner hash should be calculated, but also indicates which fields
>> participate in the RSS hash calculation.
>>
>> At this point, we can
>> 1. continue to allow this behavior. That is, if \field{hash_option} is set to 1, the
>> hash value calculated based on the outer source port indicated by
>> VIRTIO_NET_F_HASH_TUNNEL is provided to the indirection table to select the
>> rxq instead of the hash value provided by RSS.
>>
>> 2. hand over to RSS the ability to specify a hash based on the outer source port.
>> That is, we can add VIRTIO_NET_RSS_HASH_TUNNEL_SRC_PORT_UDP_{v4, v6,
>> EX} in \field{supported_hash_types} to indicate that the hash should be
>> calculated using the outer source port for all UDP tunneling protocols.
>> This approach removes the need for \field{hash_option} and makes the line
>> between VIRTIO_NET_F_HASH_TUNNEL and VIRTIO_NET_F_RSS clearer.
>>
> #2 is preferred.

Ok.

>
> But I must be missing something.
> Without VIRTIO_NET_RSS_HASH_TUNNEL_SRC_PORT_UDP_X, today if one wants to do RSS based on the outer UDP ports,
> It is already supported by the RSS (even in presence of the inner header).
>
> So why do have to introduce VIRTIO_NET_RSS_HASH_TUNNEL_SRC_PORT_UDP_X?

For legacy tunneling protocols like IPIP/GRE_2784/GRE_2890 that do not 
have outer transport headers,
it is worth calculating the inner header hash for these protocols.

For modern tunneling protocols with outer transport headers, although 
they can provide entropy through the outer source udp port,
sometimes we need to perform symmetric hashing on these tunneling protocols.
Then,
1. We can achieve this through the inner header, but we need a way to 
cope with the addition of new tunneling protocols in the future;
2. The outer source udp port can identify the same flow in modern 
tunneling protocols such as VXLAN/VXLAN-GPE/GENEVE/NVGRE.
But this is marked as "SHOULD" or "RECOMMEND" in various RFCs, so it is 
not reliable. This method ( adding
VIRTIO_NET_RSS_HASH_TUNNEL_SRC_PORT_UDP_X) can deal with the needs of 
new tunneling protocols in the future for symmetric hashing.

If #2 is preferred, I'll update it in the next version.
(this also doesn't affect the migration, and maybe we shouldn't need a 
new feature to extend new values for \field{supported_hash_types}.)

Thanks!



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


      parent reply	other threads:[~2023-06-08 15:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-05  7:16 [virtio-dev] [PATCH v15] virtio-net: support inner header hash Heng Qi
2023-06-07 19:55 ` [virtio-dev] " Parav Pandit
2023-06-08  6:40   ` Heng Qi
2023-06-08 14:26     ` Parav Pandit
2023-06-08 14:41       ` Michael S. Tsirkin
2023-06-08 14:45         ` Parav Pandit
2023-06-08 14:47           ` Michael S. Tsirkin
2023-06-08 15:29       ` Heng Qi [this message]

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=0e9403b3-b6ec-bb11-5f12-9ee06100320f@linux.alibaba.com \
    --to=hengqi@linux.alibaba.com \
    --cc=jasowang@redhat.com \
    --cc=mst@redhat.com \
    --cc=parav@nvidia.com \
    --cc=virtio-comment@lists.oasis-open.org \
    --cc=virtio-dev@lists.oasis-open.org \
    --cc=xuanzhuo@linux.alibaba.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 read-only IMAP folder(s) and NNTP newsgroup(s).