mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 14:25:26 +00:00
netdev-linux: Do not offload IP checksum.
Offloading checksum with a virtio_net_hdr header works only for L4.
Remove false claim that IP checksum offloading is supported.
As a consequence, L3 checksum can be assumed to be correct when
preparing a L4 offload request.
Fixes: 3337e6d91c
("userspace: Enable L4 checksum offloading by default.")
Acked-by: Mike Pattrick <mkp@redhat.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
This commit is contained in:
committed by
Ilya Maximets
parent
82ed9ef78c
commit
4ba65112dc
@@ -1061,8 +1061,7 @@ netdev_linux_construct_tap(struct netdev *netdev_)
|
||||
|
||||
if (tap_supports_vnet_hdr
|
||||
&& ioctl(netdev->tap_fd, TUNSETOFFLOAD, oflags) == 0) {
|
||||
netdev_->ol_flags |= (NETDEV_TX_OFFLOAD_IPV4_CKSUM
|
||||
| NETDEV_TX_OFFLOAD_TCP_CKSUM
|
||||
netdev_->ol_flags |= (NETDEV_TX_OFFLOAD_TCP_CKSUM
|
||||
| NETDEV_TX_OFFLOAD_UDP_CKSUM);
|
||||
|
||||
if (userspace_tso_enabled()) {
|
||||
@@ -2510,13 +2509,11 @@ netdev_linux_set_ol(struct netdev *netdev_)
|
||||
char *string;
|
||||
uint32_t value;
|
||||
} t_list[] = {
|
||||
{"tx-checksum-ipv4", NETDEV_TX_OFFLOAD_IPV4_CKSUM |
|
||||
NETDEV_TX_OFFLOAD_TCP_CKSUM |
|
||||
{"tx-checksum-ipv4", NETDEV_TX_OFFLOAD_TCP_CKSUM |
|
||||
NETDEV_TX_OFFLOAD_UDP_CKSUM},
|
||||
{"tx-checksum-ipv6", NETDEV_TX_OFFLOAD_TCP_CKSUM |
|
||||
NETDEV_TX_OFFLOAD_UDP_CKSUM},
|
||||
{"tx-checksum-ip-generic", NETDEV_TX_OFFLOAD_IPV4_CKSUM |
|
||||
NETDEV_TX_OFFLOAD_TCP_CKSUM |
|
||||
{"tx-checksum-ip-generic", NETDEV_TX_OFFLOAD_TCP_CKSUM |
|
||||
NETDEV_TX_OFFLOAD_UDP_CKSUM},
|
||||
{"tx-checksum-sctp", NETDEV_TX_OFFLOAD_SCTP_CKSUM},
|
||||
{"tx-tcp-segmentation", NETDEV_TX_OFFLOAD_TCP_TSO},
|
||||
@@ -7203,13 +7200,6 @@ netdev_linux_prepend_vnet_hdr(struct dp_packet *b, int mtu)
|
||||
/* The packet has good L4 checksum. No need to validate again. */
|
||||
vnet->csum_start = vnet->csum_offset = (OVS_FORCE __virtio16) 0;
|
||||
vnet->flags = VIRTIO_NET_HDR_F_DATA_VALID;
|
||||
|
||||
/* It is possible that L4 is good but the IPv4 checksum isn't
|
||||
* complete. For example in the case of UDP encapsulation of an ARP
|
||||
* packet where the UDP checksum is 0. */
|
||||
if (dp_packet_hwol_l3_csum_ipv4_ol(b)) {
|
||||
dp_packet_ip_set_header_csum(b, false);
|
||||
}
|
||||
} else if (dp_packet_hwol_tx_l4_checksum(b)) {
|
||||
/* The csum calculation is offloaded. */
|
||||
if (dp_packet_hwol_l4_is_tcp(b)) {
|
||||
|
Reference in New Issue
Block a user