From patchwork Tue Dec 7 16:51:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Flavio Leitner X-Patchwork-Id: 1564783 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" (2048-bit key; unprotected) header.d=sysclose.org header.i=@sysclose.org header.a=rsa-sha256 header.s=201903 header.b=NBBQw5D5; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4J7mZy0Fh6z9s1l for ; Wed, 8 Dec 2021 03:53:29 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id B488160F2B; Tue, 7 Dec 2021 16:53:27 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org 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 GKC3ZjEVBxtj; Tue, 7 Dec 2021 16:53:26 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp3.osuosl.org (Postfix) with ESMTPS id DBB5A60F28; Tue, 7 Dec 2021 16:53:25 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id AA69FC002F; Tue, 7 Dec 2021 16:53:25 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 3E7B0C0012 for ; Tue, 7 Dec 2021 16:53:24 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 9AA0841D6D for ; Tue, 7 Dec 2021 16:52:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp4.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=sysclose.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pAz-GrR_V76l for ; Tue, 7 Dec 2021 16:52:43 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0 Received: from sysclose.org (smtp.sysclose.org [69.164.214.230]) by smtp4.osuosl.org (Postfix) with ESMTPS id A993F41D6A for ; Tue, 7 Dec 2021 16:52:43 +0000 (UTC) Received: from localhost (unknown [131.100.62.140]) by sysclose.org (Postfix) with ESMTPSA id C730A2AA9; Tue, 7 Dec 2021 16:53:13 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 sysclose.org C730A2AA9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sysclose.org; s=201903; t=1638895994; bh=y1+ZHeayuD69E1RHdBCjMvx4AiIuHF87BFPQNEB05V0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NBBQw5D5NfpXFhPD2autjQ9oERIqtVDVSWMpbdgLvbwI+J3yYhHCxrko73Yj8tP0X DAbzfBNYAVkB2/NMC5jXVI2BNjSwlUuyYxZPZWWap0a+r/8ysbKQZTx/H4WOmO3eLj aeCB24jfWeqPZLlf5o4SxeeQW5D0v9MEnoFbvuIsXVvnnoRthm+7ZNtixv3jVjs4ZV q3CXHNh7zKbmAuSeiiXceZyWH2zs2H9rOdmcKmtKQUcuUU8O86iCn10ETAbEiM+DMr JLffR8+cevK6buSWEjai/AqwGKvxQjlpbmzsR5REh8x6a5uBZvTgOI41bmnpPKgv2L kqlF7jKsVUung== From: Flavio Leitner To: dev@openvswitch.org Date: Tue, 7 Dec 2021 13:51:47 -0300 Message-Id: <20211207165156.705727-9-fbl@sysclose.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211207165156.705727-1-fbl@sysclose.org> References: <20211207165156.705727-1-fbl@sysclose.org> MIME-Version: 1.0 Cc: Flavio Leitner Subject: [ovs-dev] [[PATCH RFC] 08/17] dp-packet: Rename dp_packet_ol_is_ipv4. 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" Rename to dp_packet_ol_tx_ipv4 to align the flag. Signed-off-by: Flavio Leitner --- lib/conntrack.c | 4 ++-- lib/dp-packet.h | 2 +- lib/ipf.c | 6 +++--- lib/netdev-linux.c | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/conntrack.c b/lib/conntrack.c index 24234e672..2f9b17670 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_csum_good(pkt) - || dp_packet_ol_is_ipv4(pkt); + || dp_packet_ol_tx_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); @@ -3402,7 +3402,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_ol_is_ipv4(pkt)) { + if (!dp_packet_ol_tx_ipv4(pkt)) { l3_hdr->ip_csum = recalc_csum16(l3_hdr->ip_csum, l3_hdr->ip_tot_len, htons(ip_len)); diff --git a/lib/dp-packet.h b/lib/dp-packet.h index 614ebbb4d..dfa25e095 100644 --- a/lib/dp-packet.h +++ b/lib/dp-packet.h @@ -979,7 +979,7 @@ dp_packet_ol_tcp_seg(const struct dp_packet *p) /* Returns 'true' if packet 'p' is marked for IPv4 checksum offloading. */ static inline bool -dp_packet_ol_is_ipv4(const struct dp_packet *p) +dp_packet_ol_tx_ipv4(const struct dp_packet *p) { return !!(*dp_packet_ol_flags_ptr(p) & DP_PACKET_OL_TX_IPV4); } diff --git a/lib/ipf.c b/lib/ipf.c index f290d5d23..fd40e32c4 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_ol_is_ipv4(pkt)) { + if (!dp_packet_ol_tx_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_csum_good(pkt) - && !dp_packet_ol_is_ipv4(pkt) + && !dp_packet_ol_tx_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_ol_is_ipv4(frag_i->pkt)) { + if (!dp_packet_ol_tx_ipv4(frag_i->pkt)) { ovs_be32 reass_ip = get_16aligned_be32(&l3_reass->ip_src); ovs_be32 frag_ip = diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c index 5d0af5a40..696a86db2 100644 --- a/lib/netdev-linux.c +++ b/lib/netdev-linux.c @@ -6671,7 +6671,7 @@ netdev_linux_prepend_vnet_hdr(struct dp_packet *b, int mtu) vnet->hdr_len = (OVS_FORCE __virtio16)hdr_len; vnet->gso_size = (OVS_FORCE __virtio16)(mtu - hdr_len); - if (dp_packet_ol_is_ipv4(b)) { + if (dp_packet_ol_tx_ipv4(b)) { vnet->gso_type = VIRTIO_NET_HDR_GSO_TCPV4; } else { vnet->gso_type = VIRTIO_NET_HDR_GSO_TCPV6;