On 6/2/23 20:59, Mike Pattrick wrote:
> The netdev receiving packets is supposed to provide the flags
> indicating if the IP checksum was verified and it is GOOD or BAD,
> otherwise the stack will check when appropriate by software.
>
> If the packet comes with good checksum, then postpone the
> checksum calculation to the egress device if needed.
>
> When encapsulate a packet with that flag, set the checksum
> of the inner IP header since that is not yet supported.
>
> Calculate the IP checksum when the packet is going to be sent over
> a device that doesn't support the feature.
>
> Linux devices don't support IP checksum offload alone, so the
> support is not enabled.
>
> Signed-off-by: Flavio Leitner <[email protected]>
> Co-authored-by: Flavio Leitner <[email protected]>
> Signed-off-by: Mike Pattrick <[email protected]>
> ---
> Since v9:
> - Removed duplicative field tx_ip_csum_offload from netdev-dpdk.c
> - Left rx_csum_offload field as it is not duplicative
> - Moved system-userspace-offload.at tests to dpif-netdev.at
> - Various visual changes
> - Extended miniflow_extract changes into avx512 code
> Since v10:
> - avx512 checksum length corrected
> Since v11:
> - If hw-offload and userspace-tso is enabled, don't allow dpdk to
> offload RAW_ENCAP
> Since v13:
> - Removed dpdk hw-offload related code
> ---
> lib/conntrack.c | 19 ++++----
> lib/dp-packet.c | 15 ++++++
> lib/dp-packet.h | 62 +++++++++++++++++++++++--
> lib/dpif-netdev-extract-avx512.c | 5 ++
> lib/dpif-netdev.c | 2 +
> lib/flow.c | 15 ++++--
> lib/ipf.c | 11 +++--
> lib/netdev-dpdk.c | 71 +++++++++++++++++++----------
> lib/netdev-dummy.c | 22 +++++++++
> lib/netdev-native-tnl.c | 21 ++++++---
> lib/netdev.c | 16 +++++++
> lib/odp-execute-avx512.c | 20 +++++---
> lib/odp-execute.c | 21 +++++++--
> lib/packets.c | 34 +++++++++++---
> tests/dpif-netdev.at | 78 ++++++++++++++++++++++++++++++++
> 15 files changed, 345 insertions(+), 67 deletions(-)
>
<snip>
> @@ -1174,6 +1190,12 @@ netdev_dummy_send(struct netdev *netdev, int qid,
> }
>
> ovs_mutex_lock(&dev->mutex);
> + if (dp_packet_hwol_tx_ip_csum(packet) &&
> + !dp_packet_ip_checksum_good(packet)) {
> + dp_packet_ip_set_header_csum(packet);
> + dp_packet_ol_set_ip_csum_good(packet);
> + }
> +
These do not need to be under a mutex.
Best regards, Ilya Maximets.
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev