All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: "Uminski, Piotr" <Piotr.Uminski@intel.com>
Cc: "virtio-comment@lists.oasis-open.org"
	<virtio-comment@lists.oasis-open.org>,
	"virtio-dev@lists.oasis-open.org"
	<virtio-dev@lists.oasis-open.org>,
	"jasowang@redhat.com" <jasowang@redhat.com>,
	"cohuck@redhat.com" <cohuck@redhat.com>,
	"sgarzare@redhat.com" <sgarzare@redhat.com>,
	"stefanha@redhat.com" <stefanha@redhat.com>,
	"Jani, Nrupal" <nrupal.jani@intel.com>,
	"Yuan, Hang" <hang.yuan@intel.com>,
	"virtio@lists.oasis-open.org" <virtio@lists.oasis-open.org>,
	"Zhu, Lingshan" <lingshan.zhu@intel.com>,
	"pasic@linux.ibm.com" <pasic@linux.ibm.com>,
	Shahaf Shuler <shahafs@nvidia.com>,
	Parav Pandit <parav@nvidia.com>,
	Max Gurtovoy <mgurtovoy@nvidia.com>
Subject: Re: [virtio-comment] RE: [PATCH v8 8/9] admin: command list discovery
Date: Sat, 24 Dec 2022 13:17:56 -0500	[thread overview]
Message-ID: <20221224131156-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <SN6PR11MB351785B5196165709E603082FFE19@SN6PR11MB3517.namprd11.prod.outlook.com>

On Thu, Dec 15, 2022 at 09:52:07AM +0000, Uminski, Piotr wrote:
> > From: Michael S. Tsirkin <mst@redhat.com>
> > 
> > On Mon, Nov 21, 2022 at 11:06:14AM +0000, Uminski, Piotr wrote:
> > > Instead of a bit-coded list of supported commands, can we just use an
> > array of supported command values? It allows us to use non-contiguous
> > command coding and checking how big  is an array:       le32
> > device_admin_cmds[];
> > 
> > Interesting, what's the usecase exactly?
> In some protocols command IDs are grouped, for example:
> 	Commands 0-99: standard device management
> 	Commands 100 - 199: vendor-specific device management
> 	Commands 200 - 299: standard queue management
> 	Commands 300 - 399: vendor-specific queue management
> Initially in each group only some command IDs are used. It makes it easier to add new commands later.
> > I don't really expect more than order or 200 commands - about 8 dwords.
> Agree that the number of commands will not be big. However if we define a command #1 (say standard one) and command #100 (say vendor-specific), we need to use 4 dwords for 2 commands anyway. 

which doesn't seem big.


I do think I see an issue though in that the driver does not currently
know whether the command buffer was truncated.  It sounds like a useful
piece of information at least for debugging.  I am thinking of adding a
"max-inbuf" value for device to return to driver (together with the
status) but it looks like it will typically repeat the used buffer size
- and duplicating values leads to bugs.

Better ideas?




> > And the operation we normally need is checking whether a given command
> > is supported, with a list that will be a slow lookup.
> I don't think that is a significant difference - this is once-per-initialization operation.
> 
> > Besides with your idea driver first needs to check how many commands are
> > supported, then do the query - two roundtrips to device.
> Right - this is the main disadvantage of my proposal.
> 
> > With the proposed interface, driver just allocates a buffer for commands it
> > knows about. Device truncates the buffer to the length supplied by driver, so
> > any commands outside the buffer are ignored.
> > 
> > --
> > MST
> 
> ---------------------------------------------------------------------
> Intel Technology Poland sp. z o.o.
> ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN.
> Spolka oswiadcza, ze posiada status duzego przedsiebiorcy w rozumieniu ustawy z dnia 8 marca 2013 r. o przeciwdzialaniu nadmiernym opoznieniom w transakcjach handlowych.
> 
> Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek przegladanie lub rozpowszechnianie jest zabronione.
> This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.
> 
> 
> 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/


  reply	other threads:[~2022-12-24 18:17 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-21  1:25 [PATCH v8 0/9] Introduce device group and device management Michael S. Tsirkin
2022-11-21  1:25 ` [PATCH v8 1/9] virtio: document forward compatibility guarantees Michael S. Tsirkin
2022-11-21 15:24   ` [virtio] " Cornelia Huck
2022-11-22 20:26     ` Michael S. Tsirkin
2022-11-23  9:21       ` [virtio-dev] " Cornelia Huck
2022-11-23  9:28         ` Michael S. Tsirkin
2022-11-21  1:25 ` [PATCH v8 2/9] admin: introduce device group and related concepts Michael S. Tsirkin
2022-11-22 12:11   ` [virtio] " Cornelia Huck
2022-11-22 20:17     ` Michael S. Tsirkin
2022-11-23  9:26       ` [virtio-comment] " Cornelia Huck
2022-11-21  1:25 ` [PATCH v8 3/9] admin: introduce group administration commands Michael S. Tsirkin
2022-11-22 12:43   ` [virtio-dev] " Cornelia Huck
2022-11-21  1:25 ` [PATCH v8 4/9] admin: introduce virtio admin virtqueues Michael S. Tsirkin
2022-11-22 13:14   ` [virtio-comment] " Cornelia Huck
2022-11-22 19:31     ` Michael S. Tsirkin
2022-11-23  9:30       ` [virtio-dev] " Cornelia Huck
2022-11-23  9:32         ` Michael S. Tsirkin
2022-11-23  9:54           ` [virtio-dev] " Cornelia Huck
2022-11-21  1:25 ` [PATCH v8 5/9] pci: add admin vq registers to virtio over pci Michael S. Tsirkin
2022-11-22 14:46   ` [virtio-dev] " Cornelia Huck
2022-11-22 19:23     ` Michael S. Tsirkin
2022-11-23  9:36       ` [virtio-comment] " Cornelia Huck
2022-11-23  9:38         ` Michael S. Tsirkin
2022-11-21  1:25 ` [PATCH v8 6/9] mmio: document ADMIN_VQ as reserved Michael S. Tsirkin
2022-11-21  1:25 ` [PATCH v8 7/9] ccw: " Michael S. Tsirkin
2022-11-21 15:53   ` [virtio] " Cornelia Huck
2022-11-21 16:48     ` Michael S. Tsirkin
2022-11-21 17:09     ` Michael S. Tsirkin
2022-11-22  8:50       ` [virtio-dev] " Cornelia Huck
2022-11-22  9:51         ` Michael S. Tsirkin
2022-11-21  1:25 ` [PATCH v8 8/9] admin: command list discovery Michael S. Tsirkin
2022-11-21 11:06   ` Uminski, Piotr
2022-12-15  9:09     ` [virtio-comment] " Michael S. Tsirkin
2022-12-15  9:52       ` Uminski, Piotr
2022-12-24 18:17         ` Michael S. Tsirkin [this message]
2022-11-22 15:25   ` [virtio] " Cornelia Huck
2022-11-22 19:17     ` Michael S. Tsirkin
2022-11-23  9:51       ` [virtio] " Cornelia Huck
2022-11-23 10:00         ` Michael S. Tsirkin
2022-11-23 10:09           ` [virtio] " Cornelia Huck
2022-11-23 10:16             ` Michael S. Tsirkin
2022-11-23 10:33               ` [virtio] " Cornelia Huck
2022-11-23 11:21                 ` Michael S. Tsirkin
2022-11-21  1:25 ` [PATCH v8 9/9] admin: conformance clauses Michael S. Tsirkin
2022-11-22 16:06   ` [virtio] " Cornelia Huck
2022-11-22 19:20     ` Michael S. Tsirkin
2022-11-23  9:52       ` [virtio-dev] " Cornelia Huck

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=20221224131156-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=Piotr.Uminski@intel.com \
    --cc=cohuck@redhat.com \
    --cc=hang.yuan@intel.com \
    --cc=jasowang@redhat.com \
    --cc=lingshan.zhu@intel.com \
    --cc=mgurtovoy@nvidia.com \
    --cc=nrupal.jani@intel.com \
    --cc=parav@nvidia.com \
    --cc=pasic@linux.ibm.com \
    --cc=sgarzare@redhat.com \
    --cc=shahafs@nvidia.com \
    --cc=stefanha@redhat.com \
    --cc=virtio-comment@lists.oasis-open.org \
    --cc=virtio-dev@lists.oasis-open.org \
    --cc=virtio@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 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.