[dpdk-dev] [PATCH v2 4/4] vhost: fix offload flags in Rx path
David Marchand
david.marchand at redhat.com
Thu Apr 29 21:18:17 CEST 2021
On Thu, Apr 29, 2021 at 8:39 PM Flavio Leitner <fbl at sysclose.org> wrote:
> > - if (l4_hdr && hdr->gso_type != VIRTIO_NET_HDR_GSO_NONE) {
> > + /* GSO request, save required information in mbuf */
> > + if (hdr->gso_type != VIRTIO_NET_HDR_GSO_NONE) {
> > + /* Check unsupported modes */
> > + if (hdr->gso_size == 0)
> > + return -EINVAL;
> > +
> > switch (hdr->gso_type & ~VIRTIO_NET_HDR_GSO_ECN) {
> > case VIRTIO_NET_HDR_GSO_TCPV4:
> > case VIRTIO_NET_HDR_GSO_TCPV6:
> > - tcp_hdr = l4_hdr;
> > - m->ol_flags |= PKT_TX_TCP_SEG;
> > - m->tso_segsz = hdr->gso_size;
> > - m->l4_len = (tcp_hdr->data_off & 0xf0) >> 2;
> > - break;
> > case VIRTIO_NET_HDR_GSO_UDP:
> > - m->ol_flags |= PKT_TX_UDP_SEG;
> > + m->ol_flags |= PKT_RX_LRO | PKT_RX_L4_CKSUM_NONE;
>
> My understanding of the virtio 1.1 spec is that GSO can be
> used independently of CSUM. There is nothing preventing to
> send a fully checksummed TSO packet.
This forces a superfluous cksum in such a situation.
It can be fixed later if needed.
The virtio pmd rx side has the same behavior.
> Anyways, that's unusual and not the goal of this patch.
>
> Acked-by: Flavio Leitner <fbl at sysclose.org>
Thanks!
--
David Marchand
More information about the dev
mailing list