numam-dpdk/lib/vhost
David Marchand ca7036b4af vhost: fix offload flags in Rx path
The vhost library currently configures Tx offloading (PKT_TX_*) on any
packet received from a guest virtio device which asks for some offloading.

This is problematic, as Tx offloading is something that the application
must ask for: the application needs to configure devices
to support every used offloads (ip, tcp checksumming, tso..), and the
various l2/l3/l4 lengths must be set following any processing that
happened in the application itself.

On the other hand, the received packets are not marked wrt current
packet l3/l4 checksumming info.

Copy virtio rx processing to fix those offload flags with some
differences:
- accept VIRTIO_NET_HDR_GSO_ECN and VIRTIO_NET_HDR_GSO_UDP,
- ignore anything but the VIRTIO_NET_HDR_F_NEEDS_CSUM flag (to comply with
  the virtio spec),

Some applications might rely on the current behavior, so it is left
untouched by default.
A new RTE_VHOST_USER_NET_COMPLIANT_OL_FLAGS flag is added to enable the
new behavior.

The vhost example has been updated for the new behavior: TSO is applied to
any packet marked LRO.

Fixes: 859b480d5a ("vhost: add guest offload setting")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2021-05-04 10:22:17 +02:00
..
fd_man.c
fd_man.h
iotlb.c
iotlb.h
meson.build
rte_vdpa_dev.h
rte_vdpa.h
rte_vhost_async.h vhost: support packed ring in async datapath 2021-05-04 10:21:52 +02:00
rte_vhost_crypto.h
rte_vhost.h vhost: fix offload flags in Rx path 2021-05-04 10:22:17 +02:00
socket.c vhost: fix offload flags in Rx path 2021-05-04 10:22:17 +02:00
vdpa.c
version.map
vhost_crypto.c
vhost_user.c vhost: fix redundant vring status change notification 2021-04-28 03:52:44 +02:00
vhost_user.h
vhost.c vhost: fix offload flags in Rx path 2021-05-04 10:22:17 +02:00
vhost.h vhost: fix offload flags in Rx path 2021-05-04 10:22:17 +02:00
virtio_crypto.h
virtio_net.c vhost: fix offload flags in Rx path 2021-05-04 10:22:17 +02:00