On 8/22/23 10:11, David Marchand wrote:
> OVS current sets RTE_MBUF_F_TX_IPV[46] flags in early stages of the
> packet reception and keeps track of the IP packet type as the packet
> goes through OVS pipeline.
> When a packet leaves OVS and hits a DPDK driver, OVS may not request IP
> checksum offloading but leaves one of this packet type flag in ol_flags.
> 
> Setting RTE_MBUF_F_TX_IPV4 without RTE_MBUF_F_TX_IPSUM is not defined
> in the DPDK api.

I'd re-phrase this, because it seems clear to me from the DPDK API
description that these flags are only meaningful if offload is
requested, i.e. drivers should not act on them if offload is not
requested.

> This can confuse some drivers (like net/iavf) which
> then reads zero'd l2_len and l3_len and ends up dropping the packet.
> 
> Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=2231081
> Fixes: 5d11c47d3ebe ("userspace: Enable IP checksum offloading by default.")
> Signed-off-by: David Marchand <[email protected]>
> ---
> Some note: 
> - I submitted a fix on the DPDK side for net/iavf. But to be on the safe
>   side, this OVS patch here is a proposal to avoid hitting bugs in some
>   other drivers,

This will mask the problem.  I agree that from the perspective of
OVS it's better to just clear the flags though.  As long as it
doesn't affect performance for correctly implemented drivers.

> 
> ---
>  lib/netdev-dpdk.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
> index 8f1361e21f..92d10d1c55 100644
> --- a/lib/netdev-dpdk.c
> +++ b/lib/netdev-dpdk.c
> @@ -2431,6 +2431,7 @@ netdev_dpdk_prep_hwol_packet(struct netdev_dpdk *dev, 
> struct rte_mbuf *mbuf)
>  
>      if (!(mbuf->ol_flags & (RTE_MBUF_F_TX_IP_CKSUM | RTE_MBUF_F_TX_L4_MASK
>                              | RTE_MBUF_F_TX_TCP_SEG))) {
> +        mbuf->ol_flags &= ~(RTE_MBUF_F_TX_IPV4|RTE_MBUF_F_TX_IPV6);

This line needs some spaces.

Also, it's an extra write per packet.  Does it have any measurable
performance impact?

Best regards, Ilya Maximets.
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to