From patchwork Wed Jun 12 10:44:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Finn, Emma" X-Patchwork-Id: 1946776 X-Patchwork-Delegate: echaudro@redhat.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=aL3bgl0L; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::138; helo=smtp1.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=patchwork.ozlabs.org) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Vzhxk6Ffnz20Wd for ; Wed, 12 Jun 2024 20:44:42 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id E2A938134F; Wed, 12 Jun 2024 10:44:40 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 5Bk5ZT5x7oqp; Wed, 12 Jun 2024 10:44:40 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=2605:bc80:3010:104::8cd3:938; helo=lists.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org D473D81341 Authentication-Results: smtp1.osuosl.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=aL3bgl0L Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp1.osuosl.org (Postfix) with ESMTPS id D473D81341; Wed, 12 Jun 2024 10:44:39 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id A6AC5C0012; Wed, 12 Jun 2024 10:44:39 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id CFA36C0011 for ; Wed, 12 Jun 2024 10:44:38 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id B2800404AA for ; Wed, 12 Jun 2024 10:44:38 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 1ashV5dVN2od for ; Wed, 12 Jun 2024 10:44:37 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=192.198.163.16; helo=mgamail.intel.com; envelope-from=emma.finn@intel.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp4.osuosl.org BC47A404A8 Authentication-Results: smtp4.osuosl.org; dmarc=pass (p=none dis=none) header.from=intel.com DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org BC47A404A8 Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=aL3bgl0L Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) by smtp4.osuosl.org (Postfix) with ESMTPS id BC47A404A8 for ; Wed, 12 Jun 2024 10:44:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718189078; x=1749725078; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=YzCYGgK5m6L4i+7eo+HDJBgqT3icQ6TK5K5xuoUEMq4=; b=aL3bgl0LenWzD4XqDGqqEoX+oJIb3nTD+WO7uzlRzyi9ekYc0KOmuw5t QHwj+Wb08KcM2vUOeNOfki1yUcn5TfPDyCNxZB2iROyxB9y77pkNnc1ha nGC6MmiLUOOGqNLOVBM7NkkrV3OqCvvK4h5JxxsbvnAoiIEVtDvrLCD/x GBXXr6k95sSpG+bxcgy4HMfewgt6Xvl/Dok+s2HXwdPLZ8rtiyaD+EwjO tjC9e/WKwkxSvvWDZVr8GXs8i1J2RC6E4XL40cH1oPsIn8ly0Xrv4mvxz 4dy2RJ+9V3Jb7hNqqEHgMxQA5JvuxHXcV/rIdJ3Ai+ew/I+niWxRsFx9Z g==; X-CSE-ConnectionGUID: 2Yu9629CSfO4PZVE2tSQhw== X-CSE-MsgGUID: j/aFRKyjToGv4uMh9sx7NA== X-IronPort-AV: E=McAfee;i="6600,9927,11100"; a="12035942" X-IronPort-AV: E=Sophos;i="6.08,233,1712646000"; d="scan'208";a="12035942" Received: from orviesa008.jf.intel.com ([10.64.159.148]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jun 2024 03:44:37 -0700 X-CSE-ConnectionGUID: kxiJosJSTCOfy1Y5A8e7Nw== X-CSE-MsgGUID: ZE+ZMWvcQJ2fW/wM1siB5Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,233,1712646000"; d="scan'208";a="40382742" Received: from silpixa00401384.ir.intel.com ([10.243.23.101]) by orviesa008.jf.intel.com with ESMTP; 12 Jun 2024 03:44:36 -0700 From: Emma Finn To: ovs-dev@openvswitch.org Date: Wed, 12 Jun 2024 10:44:23 +0000 Message-Id: <20240612104423.3285377-1-emma.finn@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [ovs-dev] [PATCH] odp-execute: Set IPv6 traffic class in AVX implementation. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" The AVX implementation for the IPv6 action did not set traffic class field. Adding support for this field to the AVX implementation. Signed-off-by: Emma Finn Reported-by: Eelco Chaudron --- lib/odp-execute-avx512.c | 8 ++++++++ lib/packets.c | 2 +- lib/packets.h | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/odp-execute-avx512.c b/lib/odp-execute-avx512.c index a74a85dc1..569ea789e 100644 --- a/lib/odp-execute-avx512.c +++ b/lib/odp-execute-avx512.c @@ -741,6 +741,14 @@ action_avx512_set_ipv6(struct dp_packet_batch *batch, const struct nlattr *a) } /* Write back the modified IPv6 addresses. */ _mm512_mask_storeu_epi64((void *) nh, 0x1F, v_new_hdr); + + /* Scalar method for setting IPv6 tclass field. */ + if (key->ipv6_tclass) { + uint8_t old_tc = ntohl(get_16aligned_be32(&nh->ip6_flow)) >> 20; + uint8_t key_tc = (key->ipv6_tclass | + (old_tc & ~mask->ipv6_tclass)); + packet_set_ipv6_tc(&nh->ip6_flow, key_tc); + } } } #endif /* HAVE_AVX512VBMI */ diff --git a/lib/packets.c b/lib/packets.c index ebf516d67..91c28daf0 100644 --- a/lib/packets.c +++ b/lib/packets.c @@ -1299,7 +1299,7 @@ packet_set_ipv6_flow_label(ovs_16aligned_be32 *flow_label, ovs_be32 flow_key) put_16aligned_be32(flow_label, new_label); } -static void +void packet_set_ipv6_tc(ovs_16aligned_be32 *flow_label, uint8_t tc) { ovs_be32 old_label = get_16aligned_be32(flow_label); diff --git a/lib/packets.h b/lib/packets.h index 8b6994809..a102f8163 100644 --- a/lib/packets.h +++ b/lib/packets.h @@ -1635,6 +1635,7 @@ void packet_set_ipv6_addr(struct dp_packet *packet, uint8_t proto, bool recalculate_csum); void packet_set_ipv6_flow_label(ovs_16aligned_be32 *flow_label, ovs_be32 flow_key); +void packet_set_ipv6_tc(ovs_16aligned_be32 *flow_label, uint8_t tc); void packet_set_tcp_port(struct dp_packet *, ovs_be16 src, ovs_be16 dst); void packet_set_udp_port(struct dp_packet *, ovs_be16 src, ovs_be16 dst); void packet_set_sctp_port(struct dp_packet *, ovs_be16 src, ovs_be16 dst);