* spec clarification (was Re: [PATCH V3 4/6] vDPA: !FEATURES_OK should not block querying device config space) [not found] ` <CACGkMEtvVOtqAgY4Yzt_4=t8yfGJho4d9C=X8MQhW0ZKw1sDNA@mail.gmail.com> @ 2022-07-28 8:20 ` Si-Wei Liu 2022-07-28 11:28 ` [virtio-comment] " Michael S. Tsirkin 0 siblings, 1 reply; 2+ messages in thread From: Si-Wei Liu @ 2022-07-28 8:20 UTC (permalink / raw) To: Jason Wang, mst@redhat.com Cc: netdev@vger.kernel.org, virtio-comment, virtualization@lists.linux-foundation.org, xieyongji@bytedance.com, gautam.dawar@amd.com, Zhu, Lingshan, virtio, Eli Cohen [-- Attachment #1.1: Type: text/plain, Size: 2250 bytes --] Hi Michael, Could you please comment on the different wording between "exist" and "valid" in spec? Having seen quite a few relevant discussions regarding MTU validation and VERSION_1 negotiation on s390, I was in the impression this is not the first time people getting confused because of ambiguity of random wording without detailed example helping to clarify around the context, or due lack of clear definition set ahead. I like your idea to keep things consistent (conditional depending on feature presence), however, without proper interpretation of how spec is supposed to work, we are on a slippery slope towards inconsistency. On 7/28/2022 12:36 AM, Jason Wang wrote: >> And looking at: >> >> "The mac address field always exists (though is only valid if >> VIRTIO_NET_F_MAC is set), and status only exists if VIRTIO_NET_F_STATUS >> is set." >> >> It appears to me there's a border line set between "exist" and "valid". >> If I understand the spec wording correctly, a spec-conforming device >> implementation may or may not offer valid status value in the config >> space when VIRTIO_NET_F_STATUS is offered, but before the feature is >> negotiated. > That's not what I read, maybe Michael can clarify this. > And Jason and I find below normatives are conflict with each other. >> "The device MUST allow reading of any device-specific configuration >> field before FEATURES_OK is set by the driver. This includes fields >> which are conditional on feature bits, as long as those feature bits >> are offered by the device." > ... >> And also there are special cases where the read of specific >> configuration space field MUST be deferred to until FEATURES_OK is set: >> >> "If the VIRTIO_BLK_F_CONFIG_WCE feature is negotiated, the cache mode >> can be read or set through the writeback field. 0 corresponds to a >> writethrough cache, 1 to a writeback cache11. The cache mode after reset >> can be either writeback or writethrough. The actual mode can be >> determined by reading writeback after feature negotiation." >> "The driver MUST NOT read writeback before setting the FEATURES_OK >> device status bit." > This seems to conflict with the normatives I quoted above, and I don't > get why we need this. > Thanks, -Siwei [-- Attachment #1.2: Type: text/html, Size: 3126 bytes --] [-- Attachment #2: Type: text/plain, Size: 183 bytes --] _______________________________________________ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization ^ permalink raw reply [flat|nested] 2+ messages in thread
* [virtio-comment] Re: spec clarification (was Re: [PATCH V3 4/6] vDPA: !FEATURES_OK should not block querying device config space) 2022-07-28 8:20 ` spec clarification (was Re: [PATCH V3 4/6] vDPA: !FEATURES_OK should not block querying device config space) Si-Wei Liu @ 2022-07-28 11:28 ` Michael S. Tsirkin 0 siblings, 0 replies; 2+ messages in thread From: Michael S. Tsirkin @ 2022-07-28 11:28 UTC (permalink / raw) To: Si-Wei Liu Cc: Jason Wang, Zhu, Lingshan, Parav Pandit, Eli Cohen, netdev@vger.kernel.org, xieyongji@bytedance.com, gautam.dawar@amd.com, virtualization@lists.linux-foundation.org, virtio-comment, virtio, Paolo Bonzini On Thu, Jul 28, 2022 at 01:20:26AM -0700, Si-Wei Liu wrote: > Hi Michael, > > Could you please comment on the different wording between "exist" and "valid" > in spec? Having seen quite a few relevant discussions regarding MTU validation > and VERSION_1 negotiation on s390, I was in the impression this is not the > first time people getting confused because of ambiguity of random wording > without detailed example helping to clarify around the context, or due lack of > clear definition set ahead. I like your idea to keep things consistent > (conditional depending on feature presence), however, without proper > interpretation of how spec is supposed to work, we are on a slippery slope > towards inconsistency. > > On 7/28/2022 12:36 AM, Jason Wang wrote: > > And looking at: > > "The mac address field always exists (though is only valid if > VIRTIO_NET_F_MAC is set), and status only exists if VIRTIO_NET_F_STATUS > is set." > > It appears to me there's a border line set between "exist" and "valid". > If I understand the spec wording correctly, a spec-conforming device > implementation may or may not offer valid status value in the config > space when VIRTIO_NET_F_STATUS is offered, but before the feature is > negotiated. > > That's not what I read, maybe Michael can clarify this. > > > > And Jason and I find below normatives are conflict with each other. > > "The device MUST allow reading of any device-specific configuration > field before FEATURES_OK is set by the driver. This includes fields > which are conditional on feature bits, as long as those feature bits are > offered by the device." So I proposed this back in April: https://lists.oasis-open.org/archives/virtio-comment/202201/msg00068.html I intended this for 1.2 but it quickly became clear it won't make it in time. Working on reviving the proposal and addressing the comments. > > ... > > And also there are special cases where the read of specific > configuration space field MUST be deferred to until FEATURES_OK is set: > > "If the VIRTIO_BLK_F_CONFIG_WCE feature is negotiated, the cache mode > can be read or set through the writeback field. 0 corresponds to a > writethrough cache, 1 to a writeback cache11. The cache mode after reset > can be either writeback or writethrough. The actual mode can be > determined by reading writeback after feature negotiation." > "The driver MUST NOT read writeback before setting the FEATURES_OK > device status bit." > > This seems to conflict with the normatives I quoted above, and I don't > get why we need this. > > > > Thanks, > -Siwei The last one I take to mean writeback is special. I am not sure why it should be. Paolo you proposed this text could you comment please? Thanks! -- 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/ ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-07-28 11:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20220701132826.8132-1-lingshan.zhu@intel.com>
[not found] ` <20220701132826.8132-5-lingshan.zhu@intel.com>
[not found] ` <PH0PR12MB548190DE76CC64E56DA2DF13DCBD9@PH0PR12MB5481.namprd12.prod.outlook.com>
[not found] ` <00889067-50ac-d2cd-675f-748f171e5c83@oracle.com>
[not found] ` <63242254-ba84-6810-dad8-34f900b97f2f@intel.com>
[not found] ` <8002554a-a77c-7b25-8f99-8d68248a741d@oracle.com>
[not found] ` <c8bd5396-84f2-e782-79d7-f493aca95781@redhat.com>
[not found] ` <f3fd203d-a3ad-4c36-ddbc-01f061f4f99e@oracle.com>
[not found] ` <CACGkMEtvVOtqAgY4Yzt_4=t8yfGJho4d9C=X8MQhW0ZKw1sDNA@mail.gmail.com>
2022-07-28 8:20 ` spec clarification (was Re: [PATCH V3 4/6] vDPA: !FEATURES_OK should not block querying device config space) Si-Wei Liu
2022-07-28 11:28 ` [virtio-comment] " Michael S. Tsirkin
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox