OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

virtio-comment message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: RE: [virtio-comment] Re: [PATCH v2 1/2] virtio-net: Fix receive buffer size calculation text



> From: Cornelia Huck <cohuck@redhat.com>
> Sent: Monday, February 5, 2024 8:50 PM
> 
> On Tue, Jan 16 2024, "Michael S. Tsirkin" <mst@redhat.com> wrote:
> 
> > On Tue, Jan 16, 2024 at 01:18:59PM +0000, Parav Pandit wrote:
> >>
> >> > From: Cornelia Huck <cohuck@redhat.com>
> >> > Sent: Tuesday, January 16, 2024 6:08 PM
> >> > To: Parav Pandit <parav@nvidia.com>;
> >> > virtio-comment@lists.oasis-open.org;
> >> > mst@redhat.com
> >> > Cc: Shahaf Shuler <shahafs@nvidia.com>; xuanzhuo@linux.alibaba.com;
> >> > yuri.benditovich@daynix.com
> >> > Subject: RE: [PATCH v2 1/2] virtio-net: Fix receive buffer size
> >> > calculation text
> >> >
> >> > On Tue, Jan 16 2024, Parav Pandit <parav@nvidia.com> wrote:
> >> >
> >> > >> From: Cornelia Huck <cohuck@redhat.com>
> >> > >> Sent: Tuesday, January 16, 2024 4:33 PM
> >> > >> To: Parav Pandit <parav@nvidia.com>;
> >> > >> virtio-comment@lists.oasis-open.org;
> >> > >> mst@redhat.com
> >> > >> Cc: Shahaf Shuler <shahafs@nvidia.com>;
> >> > >> xuanzhuo@linux.alibaba.com; yuri.benditovich@daynix.com
> >> > >> Subject: RE: [PATCH v2 1/2] virtio-net: Fix receive buffer size
> >> > >> calculation text
> >> > >>
> >> > >> On Tue, Jan 16 2024, Parav Pandit <parav@nvidia.com> wrote:
> >> > >>
> >> > >> >> From: Cornelia Huck <cohuck@redhat.com>
> >> > >> >> Sent: Monday, January 15, 2024 10:14 PM
> >> > >> >
> >> > >> >> On Mon, Jan 15 2024, Parav Pandit <parav@nvidia.com> wrote:
> >> > >> >> > +The driver MUST consider size of field \field{struct
> >> > >> >> > +virtio_net_hdr}
> >> > >> >> > +20 bytes if VIRTIO_NET_F_HASH_REPORT is negotiated, and 12
> >> > >> >> > +bytes if
> >> > >> >> not.
> >> > >> >> > +
> >> > >> >>
> >> > >> >> Requiring the driver to consider the size of something to be
> >> > >> >> its actual size seems a bit odd :) I don't think we need
> >> > >> >> this, as the
> 
> My comment here still holds.
>
It is a variable length data structure with few trailing fields as not valid.
The "actual size" depends on negotiated feature bit, which is what is written here.
 
How about below?

When calculating the size of \field{struct virtio_net_hdr}, the driver must consider all the fields
inclusive up to \field{padding_reserved}, i.e. 20 bytes if VIRTIO_NET_F_HASH_REPORT is negotiated,
and 12 bytes if not.


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]