Git SHA: Not retrievable from this patch format
Author: David Marchand <[email protected]>
Subject: dpif-netdev: Enhance checksum coverage for tunnels.

This commit enhances checksum offload coverage for VXLAN tunnels by
adding support for outer checksums in the netdev-dummy driver and
extensive unit tests covering various traffic types and offload
scenarios for both IPv4 and IPv6 VXLAN tunnels.

> diff --git a/lib/netdev-dummy.c b/lib/netdev-dummy.c
> index b72820fcc5..0da7195940 100644
> --- a/lib/netdev-dummy.c
> +++ b/lib/netdev-dummy.c
> @@ -172,6 +172,16 @@ struct netdev_dummy {
>      /* Disable L4 Tx csum offload. */
>      bool ol_l4_tx_csum_disabled OVS_GUARDED;
> 
> +    /* Announce netdev outer IP Tx csum offload. */
> +    bool ol_out_ip_tx_csum OVS_GUARDED;
> +    /* Disable outer IP Tx csum offload. */
> +    bool ol_out_ip_tx_csum_disabled OVS_GUARDED;
> +
> +    /* Announce netdev outer UDP Tx csum offload. */
> +    bool ol_out_udp_tx_csum OVS_GUARDED;
> +    /* Disable outer UDP Tx csum offload. */
> +    bool ol_out_udp_tx_csum_disabled OVS_GUARDED;
> +
>      /* Set the segment size for netdev TSO support. */
>      int ol_tso_segsz OVS_GUARDED;
>  };

The new fields follow the existing pattern consistently.

> @@ -1340,6 +1392,11 @@ netdev_dummy_send(struct netdev *netdev, int qid,
>          }
> 
>          if (VLOG_IS_DBG_ENABLED()) {
> +            bool inner_ip_csum_good;
> +            bool inner_l4_csum_good;
> +            bool inner_ip_csum_bad;
> +            bool inner_l4_csum_bad;
> +            const char *tunnel;
>              bool ip_csum_good;
>              bool l4_csum_good;
>              bool ip_csum_bad;

Does this code cause any alignment issues with the new variable
declarations mixed between inner and outer variables?

> @@ -1349,16 +1406,38 @@ netdev_dummy_send(struct netdev *netdev, int qid,
>              ip_csum_bad = !!(packet->offloads & DP_PACKET_OL_IP_CKSUM_BAD);
>              l4_csum_good = !!(packet->offloads & DP_PACKET_OL_L4_CKSUM_GOOD);
>              l4_csum_bad = !!(packet->offloads & DP_PACKET_OL_L4_CKSUM_BAD);
> -            VLOG_DBG("Tx: packet with csum IP %s, L4 %s, segsz %"PRIu16,
> +            inner_ip_csum_good =
> +                !!(packet->offloads & DP_PACKET_OL_INNER_IP_CKSUM_GOOD);
> +            inner_ip_csum_bad =
> +                !!(packet->offloads & DP_PACKET_OL_INNER_IP_CKSUM_BAD);
> +            inner_l4_csum_good =
> +                !!(packet->offloads & DP_PACKET_OL_INNER_L4_CKSUM_GOOD);
> +            inner_l4_csum_bad =
> +                !!(packet->offloads & DP_PACKET_OL_INNER_L4_CKSUM_BAD);
> +            tunnel = ! dp_packet_tunnel(packet) ? "none"
> +                     : (dp_packet_tunnel_vxlan(packet) ? "vxlan"
> +                        : (dp_packet_tunnel_geneve(packet) ? "geneve"
> +                           : "gre"));

Might the space after the '!' operator create a style violation?

> @@ -1367,8 +1447,15 @@ netdev_dummy_send(struct netdev *netdev, int qid,
>          }
> 
>          if (dp_packet_ip_checksum_partial(packet)
> -            || dp_packet_l4_checksum_partial(packet)) {
> +            || dp_packet_l4_checksum_partial(packet)
> +            || dp_packet_inner_ip_checksum_partial(packet)
> +            || dp_packet_inner_l4_checksum_partial(packet)) {
>              dp_packet_ol_send_prepare(packet, flags);
>          }

The additional conditions for inner checksums look correct.

> diff --git a/tests/dpif-netdev.at b/tests/dpif-netdev.at
> index bbce1ccee4..43e844c1ed 100644
> --- a/tests/dpif-netdev.at
> +++ b/tests/dpif-netdev.at

[ ... ]

The test additions span over 2,000 lines and cover multiple scenarios
for IPv4/IPv6 VXLAN tunnels with different offload configurations.
While comprehensive, this represents a significant test suite expansion.

Would it be beneficial to organize these tests into separate files or
use helper functions to reduce duplication between similar test cases?

The tests follow a consistent pattern but there's substantial repetition
in the Python packet generation and expected output validation.
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to