From patchwork Fri Jun 3 15:15:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Pattrick X-Patchwork-Id: 1638766 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=DdDecaPA; 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 4LF60h6Xsfz9s0r for ; Sat, 4 Jun 2022 01:16:20 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 1A07140BD3; Fri, 3 Jun 2022 15:16:15 +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 vm55lDSkpgir; Fri, 3 Jun 2022 15:16:13 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp2.osuosl.org (Postfix) with ESMTPS id 57E5040BB7; Fri, 3 Jun 2022 15:16:12 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 5BE50C0086; Fri, 3 Jun 2022 15:16:10 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 1CDB5C008B for ; Fri, 3 Jun 2022 15:16:07 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 09028409C8 for ; Fri, 3 Jun 2022 15:16:07 +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 8k9g6GizX_Tv for ; Fri, 3 Jun 2022 15:16:06 +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 smtp2.osuosl.org (Postfix) with ESMTPS id 2E43A40A77 for ; Fri, 3 Jun 2022 15:16:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1654269365; 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=UANQTjpVYZgP6vY1kiNGU4koKW5ykjku01sF05L1GN4=; b=DdDecaPAUxN7Z3D2gf8weSUuIK2hJg/6sQUtLLjI/xo0MEeo5jRvpNQ18XVbds040QYym/ xlMc4i/V3GsefV/5NZS3BbVAhAPaGPsIKeKfk2lDzEV7fJsXQckt5i8TiyfM+UR1TxSjC5 XFj2zBYFeYKcLHB481XrKL7OzL4WrrU= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-169-f9HpzDSsNju9A4v08LGrsQ-1; Fri, 03 Jun 2022 11:16:02 -0400 X-MC-Unique: f9HpzDSsNju9A4v08LGrsQ-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 B2391280C262; Fri, 3 Jun 2022 15:16:01 +0000 (UTC) Received: from mpattric.remote.csb (unknown [10.22.33.235]) by smtp.corp.redhat.com (Postfix) with ESMTP id 60D35C15E71; Fri, 3 Jun 2022 15:16:01 +0000 (UTC) From: Mike Pattrick To: dev@openvswitch.org Date: Fri, 3 Jun 2022 11:15:40 -0400 Message-Id: <20220603151542.897026-6-mkp@redhat.com> In-Reply-To: <20220603151542.897026-5-mkp@redhat.com> References: <20220603151542.897026-1-mkp@redhat.com> <20220603151542.897026-2-mkp@redhat.com> <20220603151542.897026-3-mkp@redhat.com> <20220603151542.897026-4-mkp@redhat.com> <20220603151542.897026-5-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 5/7] dp-packet: Rename dp_packet_ol_tcp_seg 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 Rename to dp_packet_ol_tcp_seg, because that is less redundant and allows other protocols. Signed-off-by: Flavio Leitner Co-authored-by: Mike Pattrick Signed-off-by: Mike Pattrick Acked-by: Maxime Coquelin --- lib/dp-packet.h | 2 +- lib/netdev-linux.c | 2 +- lib/netdev.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/dp-packet.h b/lib/dp-packet.h index 1b17ef263..fdc0882ab 100644 --- a/lib/dp-packet.h +++ b/lib/dp-packet.h @@ -974,7 +974,7 @@ dp_packet_ol_tx_l4_checksum(const struct dp_packet *a) /* Returns 'true' if packet 'a' is marked for TCP segmentation offloading. */ static inline bool -dp_packet_ol_is_tso(const struct dp_packet *a) +dp_packet_ol_tcp_seg(const struct dp_packet *a) { return !!(*dp_packet_ol_flags_ptr(a) & DP_PACKET_OL_TX_TCP_SEG); } diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c index 490c751b6..47765032c 100644 --- a/lib/netdev-linux.c +++ b/lib/netdev-linux.c @@ -6682,7 +6682,7 @@ netdev_linux_prepend_vnet_hdr(struct dp_packet *p, int mtu) { struct virtio_net_hdr *vnet = dp_packet_push_zeros(p, sizeof *vnet); - if (dp_packet_ol_is_tso(p)) { + if (dp_packet_ol_tcp_seg(p)) { uint16_t hdr_len = ((char *) dp_packet_l4(p) - (char *) dp_packet_eth(p)) + TCP_HEADER_LEN; diff --git a/lib/netdev.c b/lib/netdev.c index d087929e5..fb535ed7c 100644 --- a/lib/netdev.c +++ b/lib/netdev.c @@ -794,7 +794,7 @@ netdev_send_prepare_packet(const uint64_t netdev_flags, { uint64_t l4_mask; - if (dp_packet_ol_is_tso(packet) + if (dp_packet_ol_tcp_seg(packet) && !(netdev_flags & NETDEV_OFFLOAD_TX_TCP_TSO)) { /* Fall back to GSO in software. */ VLOG_ERR_BUF(errormsg, "No TSO support"); @@ -960,7 +960,7 @@ 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_ol_is_tso(packet) + if (OVS_UNLIKELY(dp_packet_ol_tcp_seg(packet) || dp_packet_ol_l4_mask(packet))) { COVERAGE_INC(netdev_push_header_drops); dp_packet_delete(packet);