From patchwork Tue Jun 14 22:13:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Pattrick X-Patchwork-Id: 1643443 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=ISlOkN8e; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.137; helo=smtp4.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (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 4LN2lg5B7Sz9vGL for ; Wed, 15 Jun 2022 08:14:07 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 9A4C7418C9; Tue, 14 Jun 2022 22:14:03 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.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 NUd05qtxxQTU; Tue, 14 Jun 2022 22:14:01 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp4.osuosl.org (Postfix) with ESMTPS id 1F549418C1; Tue, 14 Jun 2022 22:13:58 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 36549C008E; Tue, 14 Jun 2022 22:13:55 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 53EDFC0081 for ; Tue, 14 Jun 2022 22:13:46 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 3D05F60AE3 for ; Tue, 14 Jun 2022 22:13:46 +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 LMCsApO4ou0e for ; Tue, 14 Jun 2022 22:13:45 +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.133.124]) by smtp3.osuosl.org (Postfix) with ESMTPS id 54CFF60B54 for ; Tue, 14 Jun 2022 22:13:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1655244819; 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=OsOnjOlEmtUL8dKaH0fy/xG7CyG+YWdtHrjmW9F+5k0=; b=ISlOkN8eGTakWGMeeOlEUuLK41GE6wTfruOmbGWxHEdVpR5vkr8yGKen5JK4h9TCnJ9WXN LyQeVJUMVtRb1HHSk7Z6J82csKH/2vVHAKVmWsiFJR7hVBbnBDHFT6fnlLjX3sGYBQ5l0r NjNvPedaywRxnHkz2xK4y09Fg2hJeJ4= 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-644-q9Ttl6ZVNZe65fKRlomvWw-1; Tue, 14 Jun 2022 18:13:36 -0400 X-MC-Unique: q9Ttl6ZVNZe65fKRlomvWw-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5FE1785A582; Tue, 14 Jun 2022 22:13:36 +0000 (UTC) Received: from mpattric.remote.csb (unknown [10.22.18.26]) by smtp.corp.redhat.com (Postfix) with ESMTP id EF9A0492C3B; Tue, 14 Jun 2022 22:13:35 +0000 (UTC) From: Mike Pattrick To: dev@openvswitch.org Date: Tue, 14 Jun 2022 18:13:09 -0400 Message-Id: <20220614221317.1028795-2-mkp@redhat.com> In-Reply-To: <20220614221317.1028795-1-mkp@redhat.com> References: <20220614221317.1028795-1-mkp@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 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 , maxime.coquelin@redhat.com, david.marchand@redhat.com Subject: [ovs-dev] [PATCH 02/10] netdev: Prefix offload flags with NETDEV_OFFLOAD_ 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 Use the 'NETDEV_OFFLOAD_' prefix in the flags to indicate we are talking about hardware offloading capabilities. Signed-off-by: Flavio Leitner Co-authored-by: Mike Pattrick Signed-off-by: Mike Pattrick Reviewed-by: David Marchand Acked-by: Maxime Coquelin --- v2: changed title per suggestion --- lib/netdev-dpdk.c | 20 ++++++++++---------- lib/netdev-linux.c | 10 +++++----- lib/netdev-provider.h | 10 +++++----- lib/netdev.c | 8 ++++---- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c index d7350636e..e9b539197 100644 --- a/lib/netdev-dpdk.c +++ b/lib/netdev-dpdk.c @@ -4937,12 +4937,12 @@ netdev_dpdk_reconfigure(struct netdev *netdev) err = dpdk_eth_dev_init(dev); if (dev->hw_ol_features & NETDEV_TX_TSO_OFFLOAD) { - netdev->ol_flags |= NETDEV_TX_OFFLOAD_TCP_TSO; - netdev->ol_flags |= NETDEV_TX_OFFLOAD_TCP_CSUM; - netdev->ol_flags |= NETDEV_TX_OFFLOAD_UDP_CSUM; - netdev->ol_flags |= NETDEV_TX_OFFLOAD_IPV4_CSUM; + netdev->ol_flags |= NETDEV_OFFLOAD_TX_TCP_TSO; + netdev->ol_flags |= NETDEV_OFFLOAD_TX_TCP_CSUM; + netdev->ol_flags |= NETDEV_OFFLOAD_TX_UDP_CSUM; + netdev->ol_flags |= NETDEV_OFFLOAD_TX_IPV4_CSUM; if (dev->hw_ol_features & NETDEV_TX_SCTP_CHECKSUM_OFFLOAD) { - netdev->ol_flags |= NETDEV_TX_OFFLOAD_SCTP_CSUM; + netdev->ol_flags |= NETDEV_OFFLOAD_TX_SCTP_CSUM; } } @@ -5084,11 +5084,11 @@ netdev_dpdk_vhost_client_reconfigure(struct netdev *netdev) } if (userspace_tso_enabled()) { - netdev->ol_flags |= NETDEV_TX_OFFLOAD_TCP_TSO; - netdev->ol_flags |= NETDEV_TX_OFFLOAD_TCP_CSUM; - netdev->ol_flags |= NETDEV_TX_OFFLOAD_UDP_CSUM; - netdev->ol_flags |= NETDEV_TX_OFFLOAD_SCTP_CSUM; - netdev->ol_flags |= NETDEV_TX_OFFLOAD_IPV4_CSUM; + netdev->ol_flags |= NETDEV_OFFLOAD_TX_TCP_TSO; + netdev->ol_flags |= NETDEV_OFFLOAD_TX_TCP_CSUM; + netdev->ol_flags |= NETDEV_OFFLOAD_TX_UDP_CSUM; + netdev->ol_flags |= NETDEV_OFFLOAD_TX_SCTP_CSUM; + netdev->ol_flags |= NETDEV_OFFLOAD_TX_IPV4_CSUM; vhost_unsup_flags = 1ULL << VIRTIO_NET_F_HOST_ECN | 1ULL << VIRTIO_NET_F_HOST_UFO; } else { diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c index 3cf02b76a..129043812 100644 --- a/lib/netdev-linux.c +++ b/lib/netdev-linux.c @@ -928,11 +928,11 @@ netdev_linux_common_construct(struct netdev *netdev_) ovs_mutex_init(&netdev->mutex); if (userspace_tso_enabled()) { - netdev_->ol_flags |= NETDEV_TX_OFFLOAD_TCP_TSO; - netdev_->ol_flags |= NETDEV_TX_OFFLOAD_TCP_CSUM; - netdev_->ol_flags |= NETDEV_TX_OFFLOAD_UDP_CSUM; - netdev_->ol_flags |= NETDEV_TX_OFFLOAD_SCTP_CSUM; - netdev_->ol_flags |= NETDEV_TX_OFFLOAD_IPV4_CSUM; + netdev_->ol_flags |= NETDEV_OFFLOAD_TX_TCP_TSO; + netdev_->ol_flags |= NETDEV_OFFLOAD_TX_TCP_CSUM; + netdev_->ol_flags |= NETDEV_OFFLOAD_TX_UDP_CSUM; + netdev_->ol_flags |= NETDEV_OFFLOAD_TX_SCTP_CSUM; + netdev_->ol_flags |= NETDEV_OFFLOAD_TX_IPV4_CSUM; } return 0; diff --git a/lib/netdev-provider.h b/lib/netdev-provider.h index 08bf8b871..0a8538615 100644 --- a/lib/netdev-provider.h +++ b/lib/netdev-provider.h @@ -38,11 +38,11 @@ struct netdev_tnl_build_header_params; #define NETDEV_NUMA_UNSPEC OVS_NUMA_UNSPEC enum netdev_ol_flags { - NETDEV_TX_OFFLOAD_IPV4_CSUM = 1 << 0, - NETDEV_TX_OFFLOAD_TCP_CSUM = 1 << 1, - NETDEV_TX_OFFLOAD_UDP_CSUM = 1 << 2, - NETDEV_TX_OFFLOAD_SCTP_CSUM = 1 << 3, - NETDEV_TX_OFFLOAD_TCP_TSO = 1 << 4, + NETDEV_OFFLOAD_TX_IPV4_CSUM = 1 << 0, + NETDEV_OFFLOAD_TX_TCP_CSUM = 1 << 1, + NETDEV_OFFLOAD_TX_UDP_CSUM = 1 << 2, + NETDEV_OFFLOAD_TX_SCTP_CSUM = 1 << 3, + NETDEV_OFFLOAD_TX_TCP_TSO = 1 << 4, }; /* A network device (e.g. an Ethernet device). diff --git a/lib/netdev.c b/lib/netdev.c index e9b2bbe83..a06138aca 100644 --- a/lib/netdev.c +++ b/lib/netdev.c @@ -795,7 +795,7 @@ netdev_send_prepare_packet(const uint64_t netdev_flags, uint64_t l4_mask; if (dp_packet_hwol_is_tso(packet) - && !(netdev_flags & NETDEV_TX_OFFLOAD_TCP_TSO)) { + && !(netdev_flags & NETDEV_OFFLOAD_TX_TCP_TSO)) { /* Fall back to GSO in software. */ VLOG_ERR_BUF(errormsg, "No TSO support"); return false; @@ -804,19 +804,19 @@ netdev_send_prepare_packet(const uint64_t netdev_flags, l4_mask = dp_packet_hwol_l4_mask(packet); if (l4_mask) { if (dp_packet_hwol_l4_is_tcp(packet)) { - if (!(netdev_flags & NETDEV_TX_OFFLOAD_TCP_CSUM)) { + 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)) { - if (!(netdev_flags & NETDEV_TX_OFFLOAD_UDP_CSUM)) { + 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)) { - if (!(netdev_flags & NETDEV_TX_OFFLOAD_SCTP_CSUM)) { + if (!(netdev_flags & NETDEV_OFFLOAD_TX_SCTP_CSUM)) { /* Fall back to SCTP csum in software. */ VLOG_ERR_BUF(errormsg, "No SCTP checksum support"); return false;