From patchwork Fri Jun 3 15:15:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Pattrick X-Patchwork-Id: 1638765 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=NYTIq7zp; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::133; helo=smtp2.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LF60d4gYjz9s0r for ; Sat, 4 Jun 2022 01:16:17 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id DFD8240BC0; Fri, 3 Jun 2022 15:16:12 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id O56ro_eGqh-V; Fri, 3 Jun 2022 15:16:10 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp2.osuosl.org (Postfix) with ESMTPS id CCD0340BA2; Fri, 3 Jun 2022 15:16:08 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 21B06C007E; Fri, 3 Jun 2022 15:16:08 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 9D249C0039 for ; Fri, 3 Jun 2022 15:16:06 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 986D960F0A for ; Fri, 3 Jun 2022 15:16:06 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp3.osuosl.org (amavisd-new); dkim=pass (1024-bit key) header.d=redhat.com Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id e3I7YWZU79R2 for ; Fri, 3 Jun 2022 15:16:05 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by smtp3.osuosl.org (Postfix) with ESMTPS id 3FDFE60C18 for ; Fri, 3 Jun 2022 15:16:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654269364; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6XV0aPXYanBLv35DxX+UhSGHSbARcvp5Kr6Q6EF5/u8=; b=NYTIq7zpmmJ2xXikPUbo89Bz1Jn3XXHdwrF/ckBjJl9/zwAJg2mNqSv1wm/ERrFVZ5jc9E ipC+8u6tL/rLvrvitPlO5grqV4yFKkYtNim1hRBUSIZjepZg6vrGwiP/JpBtgcVVQKFDW8 AwjeKcXXjbc+PHHEjbMvMMuyOkKaHXA= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-57-vnvRDaN8P9GI6nAmywnvRg-1; Fri, 03 Jun 2022 11:16:00 -0400 X-MC-Unique: vnvRDaN8P9GI6nAmywnvRg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7CB00811E75; Fri, 3 Jun 2022 15:16:00 +0000 (UTC) Received: from mpattric.remote.csb (unknown [10.22.33.235]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0C137C23DC1; Fri, 3 Jun 2022 15:15:59 +0000 (UTC) From: Mike Pattrick To: dev@openvswitch.org Date: Fri, 3 Jun 2022 11:15:38 -0400 Message-Id: <20220603151542.897026-4-mkp@redhat.com> In-Reply-To: <20220603151542.897026-3-mkp@redhat.com> References: <20220603151542.897026-1-mkp@redhat.com> <20220603151542.897026-2-mkp@redhat.com> <20220603151542.897026-3-mkp@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mkp@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Cc: Flavio Leitner Subject: [ovs-dev] [PATCH 3/7] Rename dp_packet_hwol to dp_packet_ol. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" From: Flavio Leitner The name correlates better with the flag names. Signed-off-by: Flavio Leitner Co-authored-by: Mike Pattrick Signed-off-by: Mike Pattrick Acked-by: Maxime Coquelin Reviewed-by: David Marchand --- lib/conntrack.c | 8 ++++---- lib/dp-packet.h | 28 ++++++++++++++-------------- lib/ipf.c | 6 +++--- lib/netdev-dpdk.c | 20 ++++++++++---------- lib/netdev-linux.c | 24 ++++++++++++------------ lib/netdev.c | 14 +++++++------- 6 files changed, 50 insertions(+), 50 deletions(-) diff --git a/lib/conntrack.c b/lib/conntrack.c index 08da4ddf7..f9222f7db 100644 --- a/lib/conntrack.c +++ b/lib/conntrack.c @@ -2095,7 +2095,7 @@ conn_key_extract(struct conntrack *ct, struct dp_packet *pkt, ovs_be16 dl_type, COVERAGE_INC(conntrack_l3csum_err); } else { bool hwol_good_l3_csum = dp_packet_ip_checksum_valid(pkt) - || dp_packet_hwol_is_ipv4(pkt); + || dp_packet_ol_is_ipv4(pkt); /* Validate the checksum only when hwol is not supported. */ ok = extract_l3_ipv4(&ctx->key, l3, dp_packet_l3_size(pkt), NULL, !hwol_good_l3_csum); @@ -2110,7 +2110,7 @@ conn_key_extract(struct conntrack *ct, struct dp_packet *pkt, ovs_be16 dl_type, bool hwol_bad_l4_csum = dp_packet_l4_checksum_bad(pkt); if (!hwol_bad_l4_csum) { bool hwol_good_l4_csum = dp_packet_l4_checksum_valid(pkt) - || dp_packet_hwol_tx_l4_checksum(pkt); + || dp_packet_ol_tx_l4_checksum(pkt); /* Validate the checksum only when hwol is not supported. */ if (extract_l4(&ctx->key, l4, dp_packet_l4_size(pkt), &ctx->icmp_related, l3, !hwol_good_l4_csum, @@ -3441,7 +3441,7 @@ handle_ftp_ctl(struct conntrack *ct, const struct conn_lookup_ctx *ctx, } if (seq_skew) { ip_len = ntohs(l3_hdr->ip_tot_len) + seq_skew; - if (!dp_packet_hwol_is_ipv4(pkt)) { + if (!dp_packet_ol_is_ipv4(pkt)) { l3_hdr->ip_csum = recalc_csum16(l3_hdr->ip_csum, l3_hdr->ip_tot_len, htons(ip_len)); @@ -3463,7 +3463,7 @@ handle_ftp_ctl(struct conntrack *ct, const struct conn_lookup_ctx *ctx, } th->tcp_csum = 0; - if (!dp_packet_hwol_tx_l4_checksum(pkt)) { + if (!dp_packet_ol_tx_l4_checksum(pkt)) { if (ctx->key.dl_type == htons(ETH_TYPE_IPV6)) { th->tcp_csum = packet_csum_upperlayer6(nh6, th, ctx->key.nw_proto, dp_packet_l4_size(pkt)); diff --git a/lib/dp-packet.h b/lib/dp-packet.h index 3ba5b0665..968ec7534 100644 --- a/lib/dp-packet.h +++ b/lib/dp-packet.h @@ -960,35 +960,35 @@ dp_packet_set_flow_mark(struct dp_packet *p, uint32_t mark) /* Returns the L4 cksum offload bitmask. */ static inline uint64_t -dp_packet_hwol_l4_mask(const struct dp_packet *b) +dp_packet_ol_l4_mask(const struct dp_packet *b) { return *dp_packet_ol_flags_ptr(b) & DP_PACKET_OL_TX_L4_MASK; } /* Return true if the packet 'b' requested L4 checksum offload. */ static inline bool -dp_packet_hwol_tx_l4_checksum(const struct dp_packet *b) +dp_packet_ol_tx_l4_checksum(const struct dp_packet *b) { - return !!dp_packet_hwol_l4_mask(b); + return !!dp_packet_ol_l4_mask(b); } /* Returns 'true' if packet 'b' is marked for TCP segmentation offloading. */ static inline bool -dp_packet_hwol_is_tso(const struct dp_packet *b) +dp_packet_ol_is_tso(const struct dp_packet *b) { return !!(*dp_packet_ol_flags_ptr(b) & DP_PACKET_OL_TX_TCP_SEG); } /* Returns 'true' if packet 'b' is marked for IPv4 checksum offloading. */ static inline bool -dp_packet_hwol_is_ipv4(const struct dp_packet *b) +dp_packet_ol_is_ipv4(const struct dp_packet *b) { return !!(*dp_packet_ol_flags_ptr(b) & DP_PACKET_OL_TX_IPV4); } /* Returns 'true' if packet 'b' is marked for TCP checksum offloading. */ static inline bool -dp_packet_hwol_l4_is_tcp(const struct dp_packet *b) +dp_packet_ol_l4_is_tcp(const struct dp_packet *b) { return (*dp_packet_ol_flags_ptr(b) & DP_PACKET_OL_TX_L4_MASK) == DP_PACKET_OL_TX_TCP_CSUM; @@ -996,7 +996,7 @@ dp_packet_hwol_l4_is_tcp(const struct dp_packet *b) /* Returns 'true' if packet 'b' is marked for UDP checksum offloading. */ static inline bool -dp_packet_hwol_l4_is_udp(struct dp_packet *b) +dp_packet_ol_l4_is_udp(struct dp_packet *b) { return (*dp_packet_ol_flags_ptr(b) & DP_PACKET_OL_TX_L4_MASK) == DP_PACKET_OL_TX_UDP_CSUM; @@ -1004,7 +1004,7 @@ dp_packet_hwol_l4_is_udp(struct dp_packet *b) /* Returns 'true' if packet 'b' is marked for SCTP checksum offloading. */ static inline bool -dp_packet_hwol_l4_is_sctp(struct dp_packet *b) +dp_packet_ol_l4_is_sctp(struct dp_packet *b) { return (*dp_packet_ol_flags_ptr(b) & DP_PACKET_OL_TX_L4_MASK) == DP_PACKET_OL_TX_SCTP_CSUM; @@ -1012,14 +1012,14 @@ dp_packet_hwol_l4_is_sctp(struct dp_packet *b) /* Mark packet 'b' for IPv4 checksum offloading. */ static inline void -dp_packet_hwol_set_tx_ipv4(struct dp_packet *b) +dp_packet_ol_set_tx_ipv4(struct dp_packet *b) { *dp_packet_ol_flags_ptr(b) |= DP_PACKET_OL_TX_IPV4; } /* Mark packet 'b' for IPv6 checksum offloading. */ static inline void -dp_packet_hwol_set_tx_ipv6(struct dp_packet *b) +dp_packet_ol_set_tx_ipv6(struct dp_packet *b) { *dp_packet_ol_flags_ptr(b) |= DP_PACKET_OL_TX_IPV6; } @@ -1027,7 +1027,7 @@ dp_packet_hwol_set_tx_ipv6(struct dp_packet *b) /* Mark packet 'b' for TCP checksum offloading. It implies that either * the packet 'b' is marked for IPv4 or IPv6 checksum offloading. */ static inline void -dp_packet_hwol_set_csum_tcp(struct dp_packet *b) +dp_packet_ol_set_csum_tcp(struct dp_packet *b) { *dp_packet_ol_flags_ptr(b) |= DP_PACKET_OL_TX_TCP_CSUM; } @@ -1035,7 +1035,7 @@ dp_packet_hwol_set_csum_tcp(struct dp_packet *b) /* Mark packet 'b' for UDP checksum offloading. It implies that either * the packet 'b' is marked for IPv4 or IPv6 checksum offloading. */ static inline void -dp_packet_hwol_set_csum_udp(struct dp_packet *b) +dp_packet_ol_set_csum_udp(struct dp_packet *b) { *dp_packet_ol_flags_ptr(b) |= DP_PACKET_OL_TX_UDP_CSUM; } @@ -1043,7 +1043,7 @@ dp_packet_hwol_set_csum_udp(struct dp_packet *b) /* Mark packet 'b' for SCTP checksum offloading. It implies that either * the packet 'b' is marked for IPv4 or IPv6 checksum offloading. */ static inline void -dp_packet_hwol_set_csum_sctp(struct dp_packet *b) +dp_packet_ol_set_csum_sctp(struct dp_packet *b) { *dp_packet_ol_flags_ptr(b) |= DP_PACKET_OL_TX_SCTP_CSUM; } @@ -1052,7 +1052,7 @@ dp_packet_hwol_set_csum_sctp(struct dp_packet *b) * either the packet 'b' is marked for IPv4 or IPv6 checksum offloading * and also for TCP checksum offloading. */ static inline void -dp_packet_hwol_set_tcp_seg(struct dp_packet *b) +dp_packet_ol_set_tcp_seg(struct dp_packet *b) { *dp_packet_ol_flags_ptr(b) |= DP_PACKET_OL_TX_TCP_SEG; } diff --git a/lib/ipf.c b/lib/ipf.c index d45266374..df9dd01dd 100644 --- a/lib/ipf.c +++ b/lib/ipf.c @@ -433,7 +433,7 @@ ipf_reassemble_v4_frags(struct ipf_list *ipf_list) len += rest_len; l3 = dp_packet_l3(pkt); ovs_be16 new_ip_frag_off = l3->ip_frag_off & ~htons(IP_MORE_FRAGMENTS); - if (!dp_packet_hwol_is_ipv4(pkt)) { + if (!dp_packet_ol_is_ipv4(pkt)) { l3->ip_csum = recalc_csum16(l3->ip_csum, l3->ip_frag_off, new_ip_frag_off); l3->ip_csum = recalc_csum16(l3->ip_csum, l3->ip_tot_len, htons(len)); @@ -609,7 +609,7 @@ ipf_is_valid_v4_frag(struct ipf *ipf, struct dp_packet *pkt) } if (OVS_UNLIKELY(!dp_packet_ip_checksum_valid(pkt) - && !dp_packet_hwol_is_ipv4(pkt) + && !dp_packet_ol_is_ipv4(pkt) && csum(l3, ip_hdr_len) != 0)) { COVERAGE_INC(ipf_l3csum_err); goto invalid_pkt; @@ -1185,7 +1185,7 @@ ipf_post_execute_reass_pkts(struct ipf *ipf, } else { struct ip_header *l3_frag = dp_packet_l3(frag_i->pkt); struct ip_header *l3_reass = dp_packet_l3(pkt); - if (!dp_packet_hwol_is_ipv4(frag_i->pkt)) { + if (!dp_packet_ol_is_ipv4(frag_i->pkt)) { ovs_be32 reass_ip = get_16aligned_be32(&l3_reass->ip_src); ovs_be32 frag_ip = diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c index e9b539197..3172c766b 100644 --- a/lib/netdev-dpdk.c +++ b/lib/netdev-dpdk.c @@ -206,7 +206,7 @@ struct netdev_dpdk_sw_stats { /* Packet drops in ingress policer processing. */ uint64_t rx_qos_drops; /* Packet drops in HWOL processing. */ - uint64_t tx_invalid_hwol_drops; + uint64_t tx_invalid_ol_drops; }; enum dpdk_dev_type { @@ -2141,7 +2141,7 @@ netdev_dpdk_rxq_dealloc(struct netdev_rxq *rxq) /* Prepare the packet for HWOL. * Return True if the packet is OK to continue. */ static bool -netdev_dpdk_prep_hwol_packet(struct netdev_dpdk *dev, struct rte_mbuf *mbuf) +netdev_dpdk_prep_ol_packet(struct netdev_dpdk *dev, struct rte_mbuf *mbuf) { struct dp_packet *pkt = CONTAINER_OF(mbuf, struct dp_packet, mbuf); @@ -2175,7 +2175,7 @@ netdev_dpdk_prep_hwol_packet(struct netdev_dpdk *dev, struct rte_mbuf *mbuf) /* Prepare a batch for HWOL. * Return the number of good packets in the batch. */ static int -netdev_dpdk_prep_hwol_batch(struct netdev_dpdk *dev, struct rte_mbuf **pkts, +netdev_dpdk_prep_ol_batch(struct netdev_dpdk *dev, struct rte_mbuf **pkts, int pkt_cnt) { int i = 0; @@ -2185,7 +2185,7 @@ netdev_dpdk_prep_hwol_batch(struct netdev_dpdk *dev, struct rte_mbuf **pkts, /* Prepare and filter bad HWOL packets. */ for (i = 0; i < pkt_cnt; i++) { pkt = pkts[i]; - if (!netdev_dpdk_prep_hwol_packet(dev, pkt)) { + if (!netdev_dpdk_prep_ol_packet(dev, pkt)) { rte_pktmbuf_free(pkt); continue; } @@ -2539,7 +2539,7 @@ netdev_dpdk_vhost_update_tx_counters(struct netdev_dpdk *dev, int dropped = sw_stats_add->tx_mtu_exceeded_drops + sw_stats_add->tx_qos_drops + sw_stats_add->tx_failure_drops + - sw_stats_add->tx_invalid_hwol_drops; + sw_stats_add->tx_invalid_ol_drops; struct netdev_stats *stats = &dev->stats; int sent = attempted - dropped; int i; @@ -2558,7 +2558,7 @@ netdev_dpdk_vhost_update_tx_counters(struct netdev_dpdk *dev, sw_stats->tx_failure_drops += sw_stats_add->tx_failure_drops; sw_stats->tx_mtu_exceeded_drops += sw_stats_add->tx_mtu_exceeded_drops; sw_stats->tx_qos_drops += sw_stats_add->tx_qos_drops; - sw_stats->tx_invalid_hwol_drops += sw_stats_add->tx_invalid_hwol_drops; + sw_stats->tx_invalid_ol_drops += sw_stats_add->tx_invalid_ol_drops; } } @@ -2719,8 +2719,8 @@ netdev_dpdk_common_send(struct netdev *netdev, struct dp_packet_batch *batch, /* Prepare each mbuf for hardware offloading. */ if (userspace_tso_enabled()) { - cnt = netdev_dpdk_prep_hwol_batch(dev, pkts, pkt_cnt); - stats->tx_invalid_hwol_drops += pkt_cnt - cnt; + cnt = netdev_dpdk_prep_ol_batch(dev, pkts, pkt_cnt); + stats->tx_invalid_ol_drops += pkt_cnt - cnt; pkt_cnt = cnt; } @@ -2842,7 +2842,7 @@ netdev_dpdk_eth_send(struct netdev *netdev, int qid, sw_stats->tx_failure_drops += stats.tx_failure_drops; sw_stats->tx_mtu_exceeded_drops += stats.tx_mtu_exceeded_drops; sw_stats->tx_qos_drops += stats.tx_qos_drops; - sw_stats->tx_invalid_hwol_drops += stats.tx_invalid_hwol_drops; + sw_stats->tx_invalid_ol_drops += stats.tx_invalid_ol_drops; rte_spinlock_unlock(&dev->stats_lock); } @@ -3173,7 +3173,7 @@ netdev_dpdk_get_sw_custom_stats(const struct netdev *netdev, SW_CSTAT(tx_mtu_exceeded_drops) \ SW_CSTAT(tx_qos_drops) \ SW_CSTAT(rx_qos_drops) \ - SW_CSTAT(tx_invalid_hwol_drops) + SW_CSTAT(tx_invalid_ol_drops) #define SW_CSTAT(NAME) + 1 custom_stats->size = SW_CSTATS; diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c index 129043812..8570195cd 100644 --- a/lib/netdev-linux.c +++ b/lib/netdev-linux.c @@ -6618,7 +6618,7 @@ netdev_linux_parse_l2(struct dp_packet *b, uint16_t *l4proto) } *l4proto = ip_hdr->ip_proto; - dp_packet_hwol_set_tx_ipv4(b); + dp_packet_ol_set_tx_ipv4(b); } else if (eth_type == htons(ETH_TYPE_IPV6)) { struct ovs_16aligned_ip6_hdr *nh6; @@ -6628,7 +6628,7 @@ netdev_linux_parse_l2(struct dp_packet *b, uint16_t *l4proto) } *l4proto = nh6->ip6_ctlun.ip6_un1.ip6_un1_nxt; - dp_packet_hwol_set_tx_ipv6(b); + dp_packet_ol_set_tx_ipv6(b); } return 0; @@ -6654,11 +6654,11 @@ netdev_linux_parse_vnet_hdr(struct dp_packet *b) if (vnet->flags == VIRTIO_NET_HDR_F_NEEDS_CSUM) { if (l4proto == IPPROTO_TCP) { - dp_packet_hwol_set_csum_tcp(b); + dp_packet_ol_set_csum_tcp(b); } else if (l4proto == IPPROTO_UDP) { - dp_packet_hwol_set_csum_udp(b); + dp_packet_ol_set_csum_udp(b); } else if (l4proto == IPPROTO_SCTP) { - dp_packet_hwol_set_csum_sctp(b); + dp_packet_ol_set_csum_sctp(b); } } @@ -6670,7 +6670,7 @@ netdev_linux_parse_vnet_hdr(struct dp_packet *b) if (type == VIRTIO_NET_HDR_GSO_TCPV4 || type == VIRTIO_NET_HDR_GSO_TCPV6) { - dp_packet_hwol_set_tcp_seg(b); + dp_packet_ol_set_tcp_seg(b); } } @@ -6682,13 +6682,13 @@ netdev_linux_prepend_vnet_hdr(struct dp_packet *b, int mtu) { struct virtio_net_hdr *vnet = dp_packet_push_zeros(b, sizeof *vnet); - if (dp_packet_hwol_is_tso(b)) { + if (dp_packet_ol_is_tso(b)) { uint16_t hdr_len = ((char *)dp_packet_l4(b) - (char *)dp_packet_eth(b)) + TCP_HEADER_LEN; vnet->hdr_len = (OVS_FORCE __virtio16)hdr_len; vnet->gso_size = (OVS_FORCE __virtio16)(mtu - hdr_len); - if (dp_packet_hwol_is_ipv4(b)) { + if (dp_packet_ol_is_ipv4(b)) { vnet->gso_type = VIRTIO_NET_HDR_GSO_TCPV4; } else { vnet->gso_type = VIRTIO_NET_HDR_GSO_TCPV6; @@ -6698,18 +6698,18 @@ netdev_linux_prepend_vnet_hdr(struct dp_packet *b, int mtu) vnet->flags = VIRTIO_NET_HDR_GSO_NONE; } - if (dp_packet_hwol_l4_mask(b)) { + if (dp_packet_ol_l4_mask(b)) { vnet->flags = VIRTIO_NET_HDR_F_NEEDS_CSUM; vnet->csum_start = (OVS_FORCE __virtio16)((char *)dp_packet_l4(b) - (char *)dp_packet_eth(b)); - if (dp_packet_hwol_l4_is_tcp(b)) { + if (dp_packet_ol_l4_is_tcp(b)) { vnet->csum_offset = (OVS_FORCE __virtio16) __builtin_offsetof( struct tcp_header, tcp_csum); - } else if (dp_packet_hwol_l4_is_udp(b)) { + } else if (dp_packet_ol_l4_is_udp(b)) { vnet->csum_offset = (OVS_FORCE __virtio16) __builtin_offsetof( struct udp_header, udp_csum); - } else if (dp_packet_hwol_l4_is_sctp(b)) { + } else if (dp_packet_ol_l4_is_sctp(b)) { vnet->csum_offset = (OVS_FORCE __virtio16) __builtin_offsetof( struct sctp_header, sctp_csum); } else { diff --git a/lib/netdev.c b/lib/netdev.c index a06138aca..d087929e5 100644 --- a/lib/netdev.c +++ b/lib/netdev.c @@ -794,28 +794,28 @@ netdev_send_prepare_packet(const uint64_t netdev_flags, { uint64_t l4_mask; - if (dp_packet_hwol_is_tso(packet) + if (dp_packet_ol_is_tso(packet) && !(netdev_flags & NETDEV_OFFLOAD_TX_TCP_TSO)) { /* Fall back to GSO in software. */ VLOG_ERR_BUF(errormsg, "No TSO support"); return false; } - l4_mask = dp_packet_hwol_l4_mask(packet); + l4_mask = dp_packet_ol_l4_mask(packet); if (l4_mask) { - if (dp_packet_hwol_l4_is_tcp(packet)) { + if (dp_packet_ol_l4_is_tcp(packet)) { if (!(netdev_flags & NETDEV_OFFLOAD_TX_TCP_CSUM)) { /* Fall back to TCP csum in software. */ VLOG_ERR_BUF(errormsg, "No TCP checksum support"); return false; } - } else if (dp_packet_hwol_l4_is_udp(packet)) { + } else if (dp_packet_ol_l4_is_udp(packet)) { if (!(netdev_flags & NETDEV_OFFLOAD_TX_UDP_CSUM)) { /* Fall back to UDP csum in software. */ VLOG_ERR_BUF(errormsg, "No UDP checksum support"); return false; } - } else if (dp_packet_hwol_l4_is_sctp(packet)) { + } else if (dp_packet_ol_l4_is_sctp(packet)) { if (!(netdev_flags & NETDEV_OFFLOAD_TX_SCTP_CSUM)) { /* Fall back to SCTP csum in software. */ VLOG_ERR_BUF(errormsg, "No SCTP checksum support"); @@ -960,8 +960,8 @@ netdev_push_header(const struct netdev *netdev, size_t i, size = dp_packet_batch_size(batch); DP_PACKET_BATCH_REFILL_FOR_EACH (i, size, packet, batch) { - if (OVS_UNLIKELY(dp_packet_hwol_is_tso(packet) - || dp_packet_hwol_l4_mask(packet))) { + if (OVS_UNLIKELY(dp_packet_ol_is_tso(packet) + || dp_packet_ol_l4_mask(packet))) { COVERAGE_INC(netdev_push_header_drops); dp_packet_delete(packet); VLOG_WARN_RL(&rl, "%s: Tunneling packets with HW offload flags is "