From: "Michael S. Tsirkin" <mst@redhat.com>
To: Jason Wang <jasowang@redhat.com>
Cc: Heng Qi <hengqi@linux.alibaba.com>,
virtio-comment@lists.oasis-open.org,
virtio-dev@lists.oasis-open.org, Parav Pandit <parav@nvidia.com>,
Yuri Benditovich <yuri.benditovich@daynix.com>,
Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Subject: [virtio-dev] Re: [virtio-comment] Re: [PATCH v19] virtio-net: support inner header hash
Date: Thu, 29 Jun 2023 07:54:23 -0400 [thread overview]
Message-ID: <20230629074925-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <2522ab61-a333-a33b-784c-01ea6b4b42da@redhat.com>
On Thu, Jun 29, 2023 at 11:31:58AM +0800, Jason Wang wrote:
>
> 在 2023/6/28 18:10, Michael S. Tsirkin 写道:
> > On Wed, Jun 28, 2023 at 11:46:22AM +0800, Jason Wang wrote:
> > > On Wed, Jun 28, 2023 at 12:35 AM Heng Qi <hengqi@linux.alibaba.com> wrote:
> > > > 1. Currently, a received encapsulated packet has an outer and an inner header, but
> > > > the virtio device is unable to calculate the hash for the inner header. The same
> > > > flow can traverse through different tunnels, resulting in the encapsulated
> > > > packets being spread across multiple receive queues (refer to the figure below).
> > > > However, in certain scenarios, we may need to direct these encapsulated packets of
> > > > the same flow to a single receive queue. This facilitates the processing
> > > > of the flow by the same CPU to improve performance (warm caches, less locking, etc.).
> > > >
> > > > client1 client2
> > > > | +-------+ |
> > > > +------->|tunnels|<--------+
> > > > +-------+
> > > > | |
> > > > v v
> > > > +-----------------+
> > > > | monitoring host |
> > > > +-----------------+
> > > >
> > > > To achieve this, the device can calculate a symmetric hash based on the inner headers
> > > > of the same flow.
> > > >
> > > > 2. For legacy systems, they may lack entropy fields which modern protocols have in
> > > > the outer header, resulting in multiple flows with the same outer header but
> > > > different inner headers being directed to the same receive queue. This results in
> > > > poor receive performance.
> > > >
> > > > To address this limitation, inner header hash can be used to enable the device to advertise
> > > > the capability to calculate the hash for the inner packet, regaining better receive performance.
> > > >
> > > > Fixes: https://github.com/oasis-tcs/virtio-spec/issues/173
> > > > Signed-off-by: Heng Qi <hengqi@linux.alibaba.com>
> > > > Reviewed-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
> > > > Reviewed-by: Parav Pandit <parav@nvidia.com>
> > > > ---
> > > > v18->v19:
> > > > 1. Have a single structure instead of two. @Michael S . Tsirkin
> > > > 2. Some small rewrites. @Michael S . Tsirkin
> > > > 3. Rebase to master.
> > > >
> > > > v17->v18:
> > > > 1. Some rewording suggestions from Michael (Thanks!).
> > > > 2. Use 0 to disable inner header hash and remove
> > > > VIRTIO_NET_HASH_TUNNEL_TYPE_NONE.
> > > > v16->v17:
> > > > 1. Some small rewrites. @Parav Pandit
> > > > 2. Add Parav's Reviewed-by tag (Thanks!).
> > > >
> > > > v15->v16:
> > > > 1. Remove the hash_option. In order to delimit the inner header hash and RSS
> > > > configuration, the ability to configure the outer src udp port hash is given
> > > > to RSS. This is orthogonal to inner header hash, which will be done in the
> > > > RSS capability extension topic (considered as an RSS extension together
> > > > with the symmetric toeplitz hash algorithm, etc.). @Parav Pandit @Michael S . Tsirkin
> > > > 2. Fix a 'field' typo. @Parav Pandit
> > > >
> > > > v14->v15:
> > > > 1. Add tunnel hash option suggested by @Michael S . Tsirkin
> > > > 2. Adjust some descriptions.
> > > >
> > > > v13->v14:
> > > > 1. Move supported_hash_tunnel_types from config space into cvq command. @Parav Pandit
> > > I may miss some discussions, but this complicates the provisioning a lot.
> > >
> > > Having it in the config space, then a type agnostic provisioning
> > > through config space + feature bits just works fine.
> > >
> > > If we move it only via cvq, we need device specific provisioning interface.
> > >
> > > Thanks
> > Yea that's what I said too. Debugging too. I think we should build a
> > consistent solution that allows accessing config space through DMA,
> > separately from this effort. Parav do you think you can live with this
> > approach so this specific proposal can move forward?
>
>
> We can probably go another way, invent a new device configuration space
> capability which fixed size like PCI configuration access capability?
>
> struct virtio_pci_cfg_cap {
> struct virtio_pci_cap cap;
> u8 dev_cfg_data[4]; /* Data for device configuration space access.
> */
> };
>
> So it won't grow as the size of device configuration space grows.
>
> Thanks
It is true, it does not have to be DMA strictly speaking.
The basic issue is with synchronous access.
We can change the capability in some way to allow asynch then
that works. E.g. make device change length to 0 and driver
must poll before considering the operation done.
Having said that, this will increase # of VM exits even more.
Not a fan, DMA seems cleaner.
--
MST
---------------------------------------------------------------------
To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org
For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org
next prev parent reply other threads:[~2023-06-29 11:54 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-27 16:35 [virtio-dev] [PATCH v19] virtio-net: support inner header hash Heng Qi
2023-06-28 3:46 ` [virtio-dev] " Jason Wang
2023-06-28 4:23 ` [virtio-dev] " Parav Pandit
2023-06-28 5:37 ` [virtio-dev] " Jason Wang
2023-06-28 15:59 ` [virtio-dev] " Parav Pandit
2023-06-29 3:17 ` [virtio-dev] " Jason Wang
2023-06-30 11:42 ` Parav Pandit
2023-06-28 10:27 ` [virtio-dev] Re: [virtio-comment] " Michael S. Tsirkin
2023-06-28 16:18 ` [virtio-dev] " Parav Pandit
2023-06-28 16:45 ` [virtio-dev] " Michael S. Tsirkin
2023-06-28 17:06 ` [virtio-dev] " Parav Pandit
2023-06-28 17:16 ` [virtio-dev] " Michael S. Tsirkin
2023-06-28 17:28 ` [virtio-dev] " Parav Pandit
2023-06-28 17:23 ` [virtio-dev] " Michael S. Tsirkin
2023-06-28 17:38 ` [virtio-dev] " Parav Pandit
2023-06-28 19:44 ` [virtio-dev] " Michael S. Tsirkin
2023-06-29 1:56 ` [virtio-dev] " Parav Pandit
2023-06-29 2:05 ` [virtio-dev] " Heng Qi
2023-06-29 11:48 ` Michael S. Tsirkin
2023-06-29 13:08 ` Heng Qi
2023-06-29 16:59 ` [virtio-dev] " Parav Pandit
2023-06-30 0:54 ` Heng Qi
2023-06-30 1:36 ` Parav Pandit
2023-06-30 1:55 ` Heng Qi
2023-06-30 5:59 ` [virtio-dev] Re: [virtio-comment] " Michael S. Tsirkin
2023-06-30 6:15 ` Heng Qi
2023-06-30 8:17 ` Michael S. Tsirkin
2023-06-30 14:04 ` [virtio-dev] Re: [virtio-comment] " Heng Qi
2023-06-30 14:52 ` Michael S. Tsirkin
2023-06-30 16:09 ` Heng Qi
2023-06-30 16:56 ` Michael S. Tsirkin
2023-06-30 17:33 ` Heng Qi
2023-06-29 6:03 ` [virtio-dev] " Michael S. Tsirkin
2023-06-29 6:40 ` Heng Qi
2023-06-29 11:38 ` [virtio-dev] " Parav Pandit
2023-06-29 11:46 ` [virtio-dev] " Michael S. Tsirkin
2023-06-29 12:01 ` [virtio-dev] " Parav Pandit
2023-06-29 7:07 ` [virtio-dev] " Michael S. Tsirkin
2023-06-30 11:38 ` Parav Pandit
2023-06-30 15:30 ` Michael S. Tsirkin
2023-06-28 10:10 ` [virtio-dev] " Michael S. Tsirkin
2023-06-29 3:31 ` Jason Wang
2023-06-29 11:54 ` Michael S. Tsirkin [this message]
2023-06-29 11:55 ` [virtio-dev] Re: [virtio-comment] " 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=20230629074925-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=hengqi@linux.alibaba.com \
--cc=jasowang@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