From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Sender: List-Post: List-Help: List-Unsubscribe: List-Subscribe: Received: from lists.oasis-open.org (oasis-open.org [10.110.1.242]) by lists.oasis-open.org (Postfix) with ESMTP id E0258986332 for ; Tue, 9 Aug 2022 15:34:08 +0000 (UTC) From: Cornelia Huck In-Reply-To: <270139d6-1c00-9cd4-1ea9-b6f9769fedb8@linux.alibaba.com> References: <1659337182-128890-1-git-send-email-hengqi@linux.alibaba.com> <8ab46a3e-8f00-e05f-0dca-d0009164aa16@linux.alibaba.com> <87bkt086ef.fsf@redhat.com> <270139d6-1c00-9cd4-1ea9-b6f9769fedb8@linux.alibaba.com> Date: Tue, 09 Aug 2022 17:33:56 +0200 Message-ID: <87tu6lcty3.fsf@redhat.com> MIME-Version: 1.0 Subject: Re: [virtio-dev] Re: [PATCH] virtio_net: support split header Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable To: Heng Qi Cc: Jason Wang , xuanzhuo@linux.alibaba.com, kangjie.xu@linux.alibaba.com, virtio-dev@lists.oasis-open.org List-ID: On Fri, Aug 05 2022, Heng Qi wrote: > =E5=9C=A8 2022/8/4 =E4=B8=8B=E5=8D=889:50, Cornelia Huck =E5=86=99=E9=81= =93: >> On Thu, Aug 04 2022, Heng Qi wrote: >> >>> =E5=9C=A8 2022/8/4 =E4=B8=8B=E5=8D=882:27, Jason Wang =E5=86=99=E9=81= =93: >>>> On Mon, Aug 1, 2022 at 2:59 PM Heng Qi wro= te: >>>>> @@ -3820,9 +3826,13 @@ \subsubsection{Processing of Incoming Packets}= \label{sec:Device Types / Network >>>>> driver MUST NOT use the \field{csum_start} and \field{csum_offset}= . >>>>> >>>>> If one of the VIRTIO_NET_F_GUEST_TSO4, TSO6, UFO, USO4 or USO6 opt= ions have >>>>> -been negotiated, the driver MAY use \field{hdr_len} only as a hint a= bout the >>>>> +been negotiated and the VIRTIO_NET_HDR_F_SPLIT_HEADER bit in \field{= flags} >>>>> +is not set, the driver MAY use \field{hdr_len} only as a hint about = the >>>>> transport header size. >>>>> -The driver MUST NOT rely on \field{hdr_len} to be correct. >>>>> + >>>>> +If the VIRTIO_NET_HDR_F_SPLIT_HEADER bit in \field{flags} is not set= , the driver >>>>> +MUST NOT rely on \field{hdr_len} to be correct. >>>> I think we should keep the above description as-is. For whatever case, >>>> the driver must not trust the metadata set by the device and must >>>> perform necessary sanity tests on them. >>> >>> My idea is to keep the current description as it is, >>> but to emphasize in the next version: >>> "If the VIRTIO_NET_HDR_F_SPLIT_HEADER bit in \field{flags} is set, >>> the driver MAY treat the \field{hdr_len} as the length of the >>> protocol header inside the first descriptor." >> >> Just to be clear, you suggest using >> >> "If one of the VIRTIO_NET_F_GUEST_TSO4, TSO6, UFO, USO4 or USO6 options = have >> been negotiated, the driver MAY use \field{hdr_len} only as a hint about= the >> transport header size. >> >> The driver MUST NOT rely on \field{hdr_len} to be correct. >> >> If the VIRTIO_NET_HDR_F_SPLIT_HEADER bit in \field{flags} is set, >> the driver MAY treat the \field{hdr_len} as the length of the >> protocol header inside the first descriptor." > > Yes. I will use the above description to make it clearer in the next vers= ion. > > >> >> (Maybe "...the driver MAY use \field{hdr_len} as a hint about the length >> of the protocol header..."? It's still not reliable, right?) >> > \field{hdr_len} is unreliable when VIRTIO_NET_F_SPLIT_HEADER is not negot= iated. > > > If VIRTIO_NET_F_SPLIT_HEADER is negotiated, "split header" MAY perform th= e split > from the IP layer, so the protocol header and the transport header are di= fferent. > > so I think the "...the driver MAY use \field{hdr_len} only as a hint abou= t the > transport header size..." paragraph can be left as-is. Ok, then let's keep it like that. --------------------------------------------------------------------- To unsubscribe, e-mail: virtio-dev-unsubscribe@lists.oasis-open.org For additional commands, e-mail: virtio-dev-help@lists.oasis-open.org