[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
On Mon, Feb 05 2024, Parav Pandit <parav@nvidia.com> wrote: >> 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. It's up to padding_reserved with F_HASH_REPORT and up to num_buffers if not, isn't it?
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]