All of lore.kernel.org
 help / color / mirror / Atom feed
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-comment] Re: [PATCH v19] virtio-net: support inner header hash
Date: Wed, 28 Jun 2023 06:10:36 -0400	[thread overview]
Message-ID: <20230628060519-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <CACGkMEvFmAiWDp8w=ytin21Oi+PcTb1X3Eve7Kt2NVr_RkhgmA@mail.gmail.com>

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?

-- 
MST


This publicly archived list offers a means to provide input to the
OASIS Virtual I/O Device (VIRTIO) TC.

In order to verify user consent to the Feedback License terms and
to minimize spam in the list archive, subscription is required
before posting.

Subscribe: virtio-comment-subscribe@lists.oasis-open.org
Unsubscribe: virtio-comment-unsubscribe@lists.oasis-open.org
List help: virtio-comment-help@lists.oasis-open.org
List archive: https://lists.oasis-open.org/archives/virtio-comment/
Feedback License: https://www.oasis-open.org/who/ipr/feedback_license.pdf
List Guidelines: https://www.oasis-open.org/policies-guidelines/mailing-lists
Committee: https://www.oasis-open.org/committees/virtio/
Join OASIS: https://www.oasis-open.org/join/


WARNING: multiple messages have this Message-ID (diff)
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: [PATCH v19] virtio-net: support inner header hash
Date: Wed, 28 Jun 2023 06:10:36 -0400	[thread overview]
Message-ID: <20230628060519-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <CACGkMEvFmAiWDp8w=ytin21Oi+PcTb1X3Eve7Kt2NVr_RkhgmA@mail.gmail.com>

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?

-- 
MST


---------------------------------------------------------------------
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-28 10:10 UTC|newest]

Thread overview: 88+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-27 16:35 [virtio-comment] [PATCH v19] virtio-net: support inner header hash Heng Qi
2023-06-27 16:35 ` [virtio-dev] " Heng Qi
2023-06-28  3:46 ` [virtio-comment] " Jason Wang
2023-06-28  3:46   ` [virtio-dev] " Jason Wang
2023-06-28  4:23   ` [virtio-comment] " Parav Pandit
2023-06-28  4:23     ` [virtio-dev] " Parav Pandit
2023-06-28  5:37     ` [virtio-comment] " Jason Wang
2023-06-28  5:37       ` [virtio-dev] " Jason Wang
2023-06-28 15:59       ` [virtio-comment] " Parav Pandit
2023-06-28 15:59         ` [virtio-dev] " Parav Pandit
2023-06-29  3:17         ` [virtio-comment] " Jason Wang
2023-06-29  3:17           ` [virtio-dev] " Jason Wang
2023-06-30 11:42           ` [virtio-comment] " Parav Pandit
2023-06-30 11:42             ` Parav Pandit
2023-06-28 10:27     ` [virtio-comment] " Michael S. Tsirkin
2023-06-28 10:27       ` [virtio-dev] " Michael S. Tsirkin
2023-06-28 16:18       ` Parav Pandit
2023-06-28 16:18         ` [virtio-dev] " Parav Pandit
2023-06-28 16:45         ` Michael S. Tsirkin
2023-06-28 16:45           ` [virtio-dev] " Michael S. Tsirkin
2023-06-28 17:06           ` Parav Pandit
2023-06-28 17:06             ` [virtio-dev] " Parav Pandit
2023-06-28 17:16             ` Michael S. Tsirkin
2023-06-28 17:16               ` [virtio-dev] " Michael S. Tsirkin
2023-06-28 17:28               ` Parav Pandit
2023-06-28 17:28                 ` [virtio-dev] " Parav Pandit
2023-06-28 17:23             ` Michael S. Tsirkin
2023-06-28 17:23               ` [virtio-dev] " Michael S. Tsirkin
2023-06-28 17:38               ` Parav Pandit
2023-06-28 17:38                 ` [virtio-dev] " Parav Pandit
2023-06-28 19:44                 ` Michael S. Tsirkin
2023-06-28 19:44                   ` [virtio-dev] " Michael S. Tsirkin
2023-06-29  1:56                   ` Parav Pandit
2023-06-29  1:56                     ` [virtio-dev] " Parav Pandit
2023-06-29  2:05                     ` Heng Qi
2023-06-29  2:05                       ` [virtio-dev] " Heng Qi
2023-06-29 11:48                       ` Michael S. Tsirkin
2023-06-29 11:48                         ` [virtio-dev] " Michael S. Tsirkin
2023-06-29 13:08                         ` [virtio-comment] " Heng Qi
2023-06-29 13:08                           ` Heng Qi
2023-06-29 16:59                         ` Parav Pandit
2023-06-29 16:59                           ` [virtio-dev] " Parav Pandit
2023-06-30  0:54                           ` [virtio-comment] " Heng Qi
2023-06-30  0:54                             ` Heng Qi
2023-06-30  1:36                             ` [virtio-comment] " Parav Pandit
2023-06-30  1:36                               ` Parav Pandit
2023-06-30  1:55                               ` [virtio-comment] " Heng Qi
2023-06-30  1:55                                 ` Heng Qi
2023-06-30  5:59                                 ` [virtio-comment] " Michael S. Tsirkin
2023-06-30  5:59                                   ` [virtio-dev] " Michael S. Tsirkin
2023-06-30  6:15                                   ` [virtio-comment] " Heng Qi
2023-06-30  6:15                                     ` Heng Qi
2023-06-30  8:17                                     ` [virtio-comment] " Michael S. Tsirkin
2023-06-30  8:17                                       ` Michael S. Tsirkin
2023-06-30 14:04                                       ` [virtio-comment] " Heng Qi
2023-06-30 14:04                                         ` [virtio-dev] " Heng Qi
2023-06-30 14:52                                         ` Michael S. Tsirkin
2023-06-30 14:52                                           ` [virtio-dev] " Michael S. Tsirkin
2023-06-30 16:09                                           ` Heng Qi
2023-06-30 16:09                                             ` [virtio-dev] " Heng Qi
2023-06-30 16:56                                             ` Michael S. Tsirkin
2023-06-30 16:56                                               ` [virtio-dev] " Michael S. Tsirkin
2023-06-30 17:33                                               ` Heng Qi
2023-06-30 17:33                                                 ` [virtio-dev] " Heng Qi
2023-06-29  6:03                     ` Michael S. Tsirkin
2023-06-29  6:03                       ` [virtio-dev] " Michael S. Tsirkin
2023-06-29  6:40                     ` Heng Qi
2023-06-29  6:40                       ` [virtio-dev] " Heng Qi
2023-06-29 11:38                       ` Parav Pandit
2023-06-29 11:38                         ` [virtio-dev] " Parav Pandit
2023-06-29 11:46                       ` Michael S. Tsirkin
2023-06-29 11:46                         ` [virtio-dev] " Michael S. Tsirkin
2023-06-29 12:01                         ` Parav Pandit
2023-06-29 12:01                           ` [virtio-dev] " Parav Pandit
2023-06-29  7:07                     ` Michael S. Tsirkin
2023-06-29  7:07                       ` [virtio-dev] " Michael S. Tsirkin
2023-06-30 11:38                       ` [virtio-comment] " Parav Pandit
2023-06-30 11:38                         ` Parav Pandit
2023-06-30 15:30                         ` [virtio-comment] " Michael S. Tsirkin
2023-06-30 15:30                           ` Michael S. Tsirkin
2023-06-28 10:10   ` Michael S. Tsirkin [this message]
2023-06-28 10:10     ` [virtio-dev] " Michael S. Tsirkin
2023-06-29  3:31     ` [virtio-comment] " Jason Wang
2023-06-29  3:31       ` [virtio-dev] " Jason Wang
2023-06-29 11:54       ` [virtio-comment] " Michael S. Tsirkin
2023-06-29 11:54         ` [virtio-dev] " Michael S. Tsirkin
2023-06-29 11:55         ` Michael S. Tsirkin
2023-06-29 11:55           ` [virtio-dev] " 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=20230628060519-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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.