virtio-dev.lists.oasis-open.org archive mirror
 help / color / mirror / Atom feed
From: Parav Pandit <parav@nvidia.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: "virtio-dev@lists.oasis-open.org"
	<virtio-dev@lists.oasis-open.org>,
	"cohuck@redhat.com" <cohuck@redhat.com>,
	"virtio-comment@lists.oasis-open.org"
	<virtio-comment@lists.oasis-open.org>,
	Shahaf Shuler <shahafs@nvidia.com>
Subject: [virtio-dev] Re: [virtio-comment] Re: [PATCH 00/11] Introduce transitional mmr pci device
Date: Mon, 3 Apr 2023 18:00:13 -0400	[thread overview]
Message-ID: <25d15176-042a-f579-0b59-d08f7eb7eafb@nvidia.com> (raw)
In-Reply-To: <20230403163730-mutt-send-email-mst@kernel.org>



On 4/3/2023 5:04 PM, Michael S. Tsirkin wrote:
> On Mon, Apr 03, 2023 at 08:25:02PM +0000, Parav Pandit wrote:
>>
>>> From: Michael S. Tsirkin <mst@redhat.com>
>>> Sent: Monday, April 3, 2023 2:02 PM
>>
>>>> Because vqs involve DMA operations.
>>>> It is left to the device implementation to do it, but a generic wisdom
>>>> is not implement such slow work in the data path engines.
>>>> So such register access vqs can/may be through firmware.
>>>> Hence it can involve a lot higher latency.
>>>
>>> Then that wisdom is wrong? tens of microseconds is not workable even for
>>> ethtool operations, you are killing boot time.
>>>
>> Huh.
>> What ethtool latencies have you experienced? Number?
> 
> I know an order of tens of eth calls happens during boot.
> If as you said each takes tens of ms then we are talking close to a second.
> That is measureable.
I said it can take, doesn't have to be always same for all the commands.
Better to work with real numbers. :)

Let me take an example to walk through.

If a cvq or aq command takes 0.5msec, total of 100 such commands will 
take 50msec.

Once a while if two of commands say take 5msec, will result in 50 -> 60 
msec.


> OK then. Then if it is a dead end then it looks weird to add a whole new
> config space as memory mapped.
> 
I am aligned with you to not add any new register as memory mapped for 1.x.
Or access through device own's tvq is fine if such q can be initialized 
before during device reset (init) phase.

I explained that legacy registers are sub-set of existing 1.x.
They should not consume extra memory.

Lets walk through the merits and negatives of both to conclude.

>>> Let me try again.

> If hardware vendors do not want to bear the costs of registers then they
> will not implement devices with registers, and then the whole thing will
> become yet another legacy thing we need to support. If legacy emulation
> without IO is useful, then can we not find a way to do it that will
> survive the test of time?
legacy_register_transport_vq for VF can be a option, but not for PF 
emulation.
More below.

> 
>> Again, I want to emphasize that register read/write over tvq has merits with trade-off.
>> And so the mmr has merits with trade-off too.
>>
>> Better to list them and proceed forward.
>>
>> Method-1: VF's register read/write via PF based transport VQ
>> Pros:
>> a. Light weight registers implementation in device for new memory region window
> 
> Is that all? I mentioned more.
> 
b. device reset is more optimal with transport VQ
c. a hypervisor may want to check (but not necessary) register content
d. Some unknown guest VM driver which modifies mac address and still 
expect atomicity can benefit if hypervisor wants to do extra checks

>> Cons:
>> a. Higher DMA read/write latency
>> b. Device requires synchronization between non legacy memory mapped registers and legacy regs access via tvq
> 
> Same as a separate mmemory bar really.  Just don't do it. Either access
> legacy or non legacy.
> 
It is really not same to treat them equally as tvq encapsulation is 
different, and hw wouldn't prefer to treat them equally like regular 
memory writes.

Transitional device exposed by hypervisor contains both legacy I/O bar 
and also the memory mapped registers. So a guest vm can access both.

>> c. Can only work with the VF. Cannot work for thin hypervisor, which can map transitional PF to bare metal OS
>> (also listed in cover letter)
> 
> Is that a significant limitation? Why?
It is a functional limitation for the PF, as PF has no parent.
and PF can also utilize memory BAR.

> 
>> Method-2: VF's register read/write via MMR (current proposal)
>> Pros:
>> a. Device utilizes the same legacy and non-legacy registers.
> 
>> b. an order of magnitude lower latency due to avoidance of DMA on register accesses
>> (Important but not critical)
> 
> And no cons? Even if you could not see them yourself did I fail to express myself to such
> an extent?
> 
Method-1 pros covered the advantage of it over method-2, but yes worth 
to list here for completeness.

Cons:
requires creating new memory region window in the device for 
configuration access

>>>> No. Interrupt latency is in usec range.
>>>> The major latency contributors in msec range can arise from the device side.
>>>
>>> So you are saying there are devices out there already with this MMR hack
>>> baked in, and in hardware not firmware, so it works reasonably?
>> It is better to not assert a solution a "hack",
> 
> Sorry if that sounded offensive.  a hack is not necessary a bad thing.
> It's a quick solution to a very local problem, though.
> 
It is a solution because device can do at near to zero extra memory for 
existing registers.
Anyways, we have better technical details to resolve. :)
Lets focus on it.

> Yes motivation is one of the things I'm trying to work out here.
> It does however not help that it's an 11 patch strong patchset
> adding 500 lines of text for what is supposedly a small change.
> 
Many of the patches are rework and incorrect to attribute to the 
specific feature.

Like others it could have been one giant patch... but we see value in 
smaller patches..

Using tvq is even bigger change than this. So we shouldn't be afraid of 
making transitional device actually work using it with larger spec patch.

>> Regarding tvq, I have some idea on how to improve the register read/writes so that its optimal for devices to implement.
> 
> Sounds useful, and maybe if tvq addresses legacy need then focus on
> that?
> 

tvq specific for legacy register access make sense.
Some generic tvq is abstract and dont see any relation here.

So better to name it as legacy_reg_transport_vq (lrt_vq).

How about having below format?

/* Format of 16B descriptors for lrt_vq
  * lrt_vq = legacy register tranport vq.
  */
struct legacy_reg_req_vf {
	union {
		struct {
			le32 reg_wr_data;
			le32 reserved;
		} write;
		struct {
			le64 reg_read_addr;
		};
	};
	le8 rd_wr : 1;	/* rd=0, wr=1 */
	le8 reg_byte_offset : 7;
	le8 req_tag;	/* unique request tag on this vq */
	le16 vf_num;

	le16 flags; /* new flag below */
         le16 next;
};

#define VIRTQ_DESC_F_Q_DEFINED 8
/* Content of the VQ descriptor other than flags field is VQ
  * specific and defined by the VQ type.
  */

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


  reply	other threads:[~2023-04-03 22:00 UTC|newest]

Thread overview: 200+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-30 22:58 [virtio-dev] [PATCH 00/11] Introduce transitional mmr pci device Parav Pandit
2023-03-30 22:58 ` [virtio-dev] [PATCH 01/11] transport-pci: Use lowecase alphabets Parav Pandit
2023-03-30 22:58 ` [virtio-dev] [PATCH 02/11] transport-pci: Move transitional device id to legacy section Parav Pandit
2023-03-31  6:43   ` [virtio-dev] " Michael S. Tsirkin
2023-03-31 21:24     ` [virtio-dev] " Parav Pandit
2023-04-02  7:54       ` [virtio-dev] " Michael S. Tsirkin
2023-04-03 14:42         ` [virtio-dev] " Parav Pandit
2023-04-03 14:50           ` [virtio-dev] " Michael S. Tsirkin
2023-04-03 14:58             ` [virtio-dev] " Parav Pandit
2023-04-03 15:14               ` [virtio-dev] " Michael S. Tsirkin
2023-03-30 22:58 ` [virtio-dev] [PATCH 03/11] transport-pci: Split notes of PCI Device Layout Parav Pandit
2023-03-30 22:58 ` [virtio-dev] [PATCH 04/11] transport-pci: Rename and move legacy PCI Device layout section Parav Pandit
2023-03-30 22:58 ` [virtio-dev] [PATCH 05/11] introduction: Add missing helping verb Parav Pandit
2023-03-30 22:58 ` [virtio-dev] [PATCH 06/11] introduction: Introduce transitional MMR interface Parav Pandit
2023-04-07  9:17   ` [virtio-dev] " Michael S. Tsirkin
2023-03-30 22:58 ` [virtio-dev] [PATCH 07/11] transport-pci: Introduce transitional MMR device id Parav Pandit
2023-04-04  7:28   ` [virtio-dev] " Michael S. Tsirkin
2023-04-04 16:08     ` Parav Pandit
2023-04-07 12:03       ` [virtio-dev] Re: [virtio-comment] " Michael S. Tsirkin
2023-04-07 15:18         ` [virtio-dev] " Parav Pandit
2023-04-07 15:51           ` [virtio-dev] " Michael S. Tsirkin
2023-04-09  3:15             ` [virtio-dev] " Parav Pandit
2023-04-10 10:18               ` [virtio-dev] " Michael S. Tsirkin
2023-04-10 14:34                 ` Parav Pandit
2023-04-10 19:58                   ` Michael S. Tsirkin
2023-04-10 20:16                     ` Parav Pandit
2023-04-07  8:37   ` [virtio-dev] " Michael S. Tsirkin
2023-03-30 22:58 ` [virtio-dev] [PATCH 08/11] transport-pci: Introduce virtio extended capability Parav Pandit
2023-04-04  7:35   ` [virtio-dev] " Michael S. Tsirkin
2023-04-04  7:54     ` Cornelia Huck
2023-04-04 12:43       ` Michael S. Tsirkin
2023-04-04 13:19         ` Cornelia Huck
2023-04-04 14:37           ` Michael S. Tsirkin
2023-04-10 16:21             ` Parav Pandit
2023-04-10 19:49               ` Michael S. Tsirkin
2023-04-10 19:57                 ` [virtio-dev] " Parav Pandit
2023-04-10 20:02                   ` [virtio-dev] " Michael S. Tsirkin
2023-04-11  8:39                     ` Cornelia Huck
2023-04-04 21:18     ` [virtio-dev] " Parav Pandit
2023-04-05  5:10       ` [virtio-dev] " Michael S. Tsirkin
2023-04-05 13:16         ` [virtio-dev] " Parav Pandit
2023-04-07  8:15           ` [virtio-dev] " Michael S. Tsirkin
2023-04-10  1:36   ` [virtio-dev] " Jason Wang
2023-04-10  6:24     ` Michael S. Tsirkin
2023-04-10  7:16       ` Jason Wang
2023-04-10 10:04         ` Michael S. Tsirkin
2023-04-11  2:19           ` Jason Wang
2023-04-11  7:00             ` Michael S. Tsirkin
2023-04-11  9:07               ` Jason Wang
2023-04-11 10:43                 ` Michael S. Tsirkin
2023-04-11 13:59                 ` Parav Pandit
2023-04-11 14:11                 ` Michael S. Tsirkin
2023-04-11 13:47               ` Parav Pandit
2023-04-11 14:02                 ` Michael S. Tsirkin
2023-04-11 14:07                   ` [virtio-dev] RE: [virtio-comment] " Parav Pandit
2023-04-11 14:10                     ` [virtio-dev] " Michael S. Tsirkin
2023-04-11 14:30                       ` [virtio-dev] " Parav Pandit
2023-04-10 17:54     ` Parav Pandit
2023-04-10 17:58       ` [virtio-dev] RE: [virtio-comment] " Parav Pandit
2023-04-11  3:28       ` Jason Wang
2023-04-11 19:01         ` Parav Pandit
2023-04-11 21:25           ` Michael S. Tsirkin
2023-04-12  0:40             ` Parav Pandit
2023-04-12  2:56               ` Michael S. Tsirkin
2023-04-12  4:07             ` Jason Wang
2023-04-12  4:20               ` Michael S. Tsirkin
2023-04-12  4:53                 ` [virtio-dev] Re: [virtio-comment] " Jason Wang
2023-04-12  5:25                   ` Michael S. Tsirkin
2023-04-12  5:37                     ` Jason Wang
2023-04-13 17:03                       ` Michael S. Tsirkin
2023-04-12  4:04           ` Jason Wang
2023-04-12  4:13             ` Parav Pandit
2023-04-12  4:20             ` Michael S. Tsirkin
2023-04-12  4:55               ` Jason Wang
2023-05-19  6:10   ` [virtio-dev] " Michael S. Tsirkin
2023-05-19 21:02     ` [virtio-dev] " Parav Pandit
2023-05-21  5:57       ` [virtio-dev] " Michael S. Tsirkin
2023-05-21 13:24         ` [virtio-dev] " Parav Pandit
2023-05-21 14:34           ` [virtio-dev] " Michael S. Tsirkin
2023-03-30 22:58 ` [virtio-dev] [PATCH 09/11] transport-pci: Describe PCI MMR dev config registers Parav Pandit
2023-04-07  8:55   ` [virtio-dev] " Michael S. Tsirkin
2023-04-10  1:33     ` [virtio-dev] Re: [virtio-comment] " Jason Wang
2023-04-10  6:14       ` Michael S. Tsirkin
2023-04-10  6:20         ` Jason Wang
2023-04-10  6:39           ` Michael S. Tsirkin
2023-04-10  7:20             ` Jason Wang
2023-04-10 10:06               ` Michael S. Tsirkin
2023-04-11  2:13                 ` Jason Wang
2023-04-11  7:04                   ` Michael S. Tsirkin
2023-04-11  9:01                     ` Jason Wang
     [not found]                       ` <CALBs2cXURMEzCGnULicXbsBfwnKE5cZOz=M-_hhFCXZ=Lqb9Nw@mail.gmail.com>
2023-04-11 10:39                         ` Michael S. Tsirkin
2023-04-11 11:03                           ` Yan Vugenfirer
2023-04-11 10:42                       ` Michael S. Tsirkin
2023-04-12  3:58                         ` Jason Wang
2023-04-12  4:15                           ` Michael S. Tsirkin
2023-04-12  4:51                             ` Jason Wang
2023-04-12  5:01                               ` [virtio-dev] " Parav Pandit
2023-04-12  5:14                                 ` [virtio-dev] " Jason Wang
2023-04-12  5:30                                   ` [virtio-dev] " Parav Pandit
2023-04-12  5:38                                     ` [virtio-dev] " Jason Wang
2023-04-12  5:55                                       ` [virtio-dev] " Parav Pandit
2023-04-12  6:15                                         ` [virtio-dev] " Jason Wang
2023-04-12 14:23                                           ` [virtio-dev] " Parav Pandit
2023-04-13  1:48                                             ` [virtio-dev] " Jason Wang
2023-04-13  3:31                                               ` Parav Pandit
2023-04-13  5:14                                                 ` Jason Wang
2023-04-13 17:19                                                   ` Michael S. Tsirkin
2023-04-13 19:39                                                     ` [virtio-dev] " Parav Pandit
2023-04-14  3:09                                                       ` [virtio-dev] " Jason Wang
2023-04-14  3:18                                                         ` [virtio-dev] " Parav Pandit
2023-04-14  3:37                                                           ` [virtio-dev] " Jason Wang
2023-04-14  3:51                                                             ` [virtio-dev] " Parav Pandit
2023-04-14  7:05                                                               ` [virtio-dev] " Michael S. Tsirkin
2023-04-17  3:22                                                               ` Jason Wang
2023-04-17 17:23                                                                 ` [virtio-dev] " Parav Pandit
2023-04-17 20:26                                                                   ` [virtio-dev] " Michael S. Tsirkin
2023-04-17 20:28                                                                     ` [virtio-dev] " Parav Pandit
2023-04-18  0:36                                                                       ` [virtio-dev] " Jason Wang
2023-04-18  1:30                                                                         ` [virtio-dev] " Parav Pandit
2023-04-18 11:58                                                                           ` [virtio-dev] " Michael S. Tsirkin
2023-04-18 12:09                                                                             ` [virtio-dev] " Parav Pandit
2023-04-18 12:30                                                                               ` [virtio-dev] " Michael S. Tsirkin
2023-04-18 12:36                                                                                 ` [virtio-dev] " Parav Pandit
2023-04-18  1:01                                                                   ` [virtio-dev] " Jason Wang
2023-04-18  1:48                                                                     ` [virtio-dev] " Parav Pandit
2023-04-13 17:24                                                   ` [virtio-dev] " Parav Pandit
2023-04-13 21:02                                                     ` Michael S. Tsirkin
2023-04-13 21:08                                                       ` [virtio-dev] " Parav Pandit
2023-04-14  2:36                                                         ` [virtio-dev] " Jason Wang
2023-04-14  2:43                                                           ` [virtio-dev] " Parav Pandit
2023-04-14  6:57                                                             ` [virtio-dev] " Michael S. Tsirkin
2023-04-16 13:41                                                               ` [virtio-dev] " Parav Pandit
2023-04-16 20:44                                                                 ` [virtio-dev] " Michael S. Tsirkin
2023-04-17 16:59                                                                   ` [virtio-dev] " Parav Pandit
2023-04-18  1:09                                                                     ` [virtio-dev] " Jason Wang
2023-04-18  1:37                                                                       ` [virtio-dev] " Parav Pandit
2023-04-14  6:58                                                           ` [virtio-dev] " Michael S. Tsirkin
2023-04-14  3:08                                                     ` Jason Wang
2023-04-14  3:13                                                       ` [virtio-dev] " Parav Pandit
2023-04-14  3:18                                                         ` [virtio-dev] " Jason Wang
2023-04-14  3:22                                                           ` [virtio-dev] " Parav Pandit
2023-04-14  3:29                                                             ` [virtio-dev] " Jason Wang
2023-04-11 13:57                       ` [virtio-dev] " Parav Pandit
2023-04-12  4:33   ` [virtio-dev] " Michael S. Tsirkin
2023-03-30 22:58 ` [virtio-dev] [PATCH 10/11] transport-pci: Use driver notification PCI capability Parav Pandit
2023-04-12  4:31   ` [virtio-dev] " Michael S. Tsirkin
2023-04-12  4:37     ` [virtio-dev] " Parav Pandit
2023-04-12  4:43       ` [virtio-dev] " Michael S. Tsirkin
2023-04-12  4:48         ` [virtio-dev] " Parav Pandit
2023-04-12  5:02           ` [virtio-dev] " Michael S. Tsirkin
2023-04-12  5:06             ` [virtio-dev] RE: [virtio-comment] " Parav Pandit
2023-04-12  5:17               ` [virtio-dev] " Michael S. Tsirkin
2023-04-12  5:24                 ` [virtio-dev] " Parav Pandit
2023-04-12  5:27                   ` [virtio-dev] " Michael S. Tsirkin
2023-03-30 22:58 ` [virtio-dev] [PATCH 11/11] conformance: Add transitional MMR interface conformance Parav Pandit
2023-03-31  7:03 ` [virtio-dev] Re: [PATCH 00/11] Introduce transitional mmr pci device Michael S. Tsirkin
2023-03-31 21:43   ` Parav Pandit
2023-04-03 14:53     ` Michael S. Tsirkin
2023-04-03 14:57       ` [virtio-dev] " Parav Pandit
2023-04-03 15:06         ` [virtio-dev] " Michael S. Tsirkin
2023-04-03 15:16           ` [virtio-dev] " Parav Pandit
2023-04-03 15:23             ` [virtio-dev] " Michael S. Tsirkin
2023-04-03 15:34               ` Michael S. Tsirkin
2023-04-03 15:47                 ` [virtio-dev] " Parav Pandit
2023-04-03 17:28                   ` [virtio-dev] " Michael S. Tsirkin
2023-04-03 17:35                     ` Parav Pandit
2023-04-03 17:39                       ` Michael S. Tsirkin
2023-04-03 15:36               ` [virtio-dev] RE: [virtio-comment] " Parav Pandit
2023-04-03 17:16                 ` [virtio-dev] " Michael S. Tsirkin
2023-04-03 17:29                   ` Parav Pandit
2023-04-03 18:02                     ` Michael S. Tsirkin
2023-04-03 20:25                       ` [virtio-dev] " Parav Pandit
2023-04-03 21:04                         ` [virtio-dev] " Michael S. Tsirkin
2023-04-03 22:00                           ` Parav Pandit [this message]
2023-04-07  9:35                             ` Michael S. Tsirkin
2023-04-10  1:52                               ` Jason Wang
2023-04-03 14:45 ` [virtio-dev] Re: [virtio-comment] " Stefan Hajnoczi
2023-04-03 14:53   ` Parav Pandit
2023-04-03 17:48     ` Michael S. Tsirkin
2023-04-03 19:11       ` Stefan Hajnoczi
2023-04-03 20:03         ` Michael S. Tsirkin
2023-04-03 19:48       ` [virtio-dev] " Parav Pandit
2023-04-03 20:02         ` [virtio-dev] " Michael S. Tsirkin
2023-04-03 20:42           ` [virtio-dev] " Parav Pandit
2023-04-03 21:14             ` [virtio-dev] " Michael S. Tsirkin
2023-04-03 22:08               ` Parav Pandit
2023-04-03 19:10     ` Stefan Hajnoczi
2023-04-03 20:27       ` [virtio-dev] " Parav Pandit
2023-04-04 14:30         ` [virtio-dev] " Stefan Hajnoczi
2023-04-12  4:48 ` [virtio-dev] " Michael S. Tsirkin
2023-04-12  4:52   ` [virtio-dev] " Parav Pandit
2023-04-12  5:12     ` [virtio-dev] " Michael S. Tsirkin
2023-04-12  5:15       ` [virtio-dev] RE: [virtio-comment] " Parav Pandit
2023-04-12  5:23         ` [virtio-dev] " Michael S. Tsirkin
2023-04-12  5:39           ` [virtio-dev] " Parav Pandit
2023-04-12  6:02       ` Parav Pandit
2023-04-12  5:10 ` [virtio-dev] " Halil Pasic
2023-04-25  2:42 ` [virtio-dev] " Parav Pandit
2023-05-02  7:17   ` [virtio-dev] Re: [virtio-comment] " David Edmondson
2023-05-02 13:54     ` [virtio-dev] " Parav Pandit

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=25d15176-042a-f579-0b59-d08f7eb7eafb@nvidia.com \
    --to=parav@nvidia.com \
    --cc=cohuck@redhat.com \
    --cc=mst@redhat.com \
    --cc=shahafs@nvidia.com \
    --cc=virtio-comment@lists.oasis-open.org \
    --cc=virtio-dev@lists.oasis-open.org \
    /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 NNTP newsgroup(s).