vhost-user legacy behavior has been to mark mbuf with Tx offload flags based on what the virtio-net header contained (but provide no Rx information, like IP checksum or L4 checksum validity).
Changing to the non legacy mode means that no code out of OVS should set any RTE_MBUF_F_TX_* flag. Had a check accordingly. Link: https://git.dpdk.org/dpdk/commit/?id=ca7036b4af3a Reported-at: https://issues.redhat.com/browse/FDP-1147 Signed-off-by: David Marchand <david.march...@redhat.com> --- lib/netdev-dpdk.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c index 594af43c4f..e28a254275 100644 --- a/lib/netdev-dpdk.c +++ b/lib/netdev-dpdk.c @@ -2647,6 +2647,7 @@ static bool netdev_dpdk_prep_hwol_packet(struct netdev_dpdk *dev, struct rte_mbuf *mbuf) { struct dp_packet *pkt = CONTAINER_OF(mbuf, struct dp_packet, mbuf); + uint64_t unexpected = mbuf->ol_flags & RTE_MBUF_F_TX_OFFLOAD_MASK; const struct ip_header *ip; bool is_sctp; bool l3_csum; @@ -2657,20 +2658,20 @@ netdev_dpdk_prep_hwol_packet(struct netdev_dpdk *dev, struct rte_mbuf *mbuf) void *l3; void *l4; + if (OVS_UNLIKELY(unexpected)) { + VLOG_WARN_RL(&rl, "%s: Unexpected Tx offload flags: %#"PRIx64, + netdev_get_name(&dev->up), unexpected); + netdev_dpdk_mbuf_dump(netdev_get_name(&dev->up), + "Packet with unexpected ol_flags", mbuf); + return false; + } + if (!dp_packet_ip_checksum_partial(pkt) && !dp_packet_inner_ip_checksum_partial(pkt) && !dp_packet_l4_checksum_partial(pkt) && !dp_packet_inner_l4_checksum_partial(pkt) && !mbuf->tso_segsz) { - uint64_t unexpected = mbuf->ol_flags & RTE_MBUF_F_TX_OFFLOAD_MASK; - if (OVS_UNLIKELY(unexpected)) { - VLOG_WARN_RL(&rl, "%s: Unexpected Tx offload flags: %#"PRIx64, - netdev_get_name(&dev->up), unexpected); - netdev_dpdk_mbuf_dump(netdev_get_name(&dev->up), - "Packet with unexpected ol_flags", mbuf); - return false; - } return true; } @@ -6430,6 +6431,10 @@ netdev_dpdk_vhost_client_reconfigure(struct netdev *netdev) vhost_flags |= RTE_VHOST_USER_POSTCOPY_SUPPORT; } + /* Use "compliant" ol_flags API so that the vhost library behaves + * like a DPDK ethdev driver. */ + vhost_flags |= RTE_VHOST_USER_NET_COMPLIANT_OL_FLAGS; + /* Enable External Buffers if TCP Segmentation Offload is enabled. */ if (enable_tso) { vhost_flags |= RTE_VHOST_USER_EXTBUF_SUPPORT; -- 2.48.1 _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev