From patchwork Mon Jun 17 14:08:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Finn, Emma" X-Patchwork-Id: 1948640 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=lY22r9i1; dkim-atps=neutral Authentication-Results: legolas.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=patchwork.ozlabs.org) 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 ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W2sDz2bGkz20Ws for ; Tue, 18 Jun 2024 00:08:51 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 9CECC40513; Mon, 17 Jun 2024 14:08:49 +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 da1XsWu2jfT5; Mon, 17 Jun 2024 14:08:48 +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 smtp4.osuosl.org 4684B403D8 Authentication-Results: smtp4.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=lY22r9i1 Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp4.osuosl.org (Postfix) with ESMTPS id 4684B403D8; Mon, 17 Jun 2024 14:08:48 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id E9C5EC0012; Mon, 17 Jun 2024 14:08:47 +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 61EE5C0011 for ; Mon, 17 Jun 2024 14:08:46 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 4909240354 for ; Mon, 17 Jun 2024 14:08:46 +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 SgU8ErzIoER2 for ; Mon, 17 Jun 2024 14:08:45 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=192.198.163.11; helo=mgamail.intel.com; envelope-from=emma.finn@intel.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp4.osuosl.org 65627403D8 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 65627403D8 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) by smtp4.osuosl.org (Postfix) with ESMTPS id 65627403D8 for ; Mon, 17 Jun 2024 14:08:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718633325; x=1750169325; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=p0wI+2Xmw/vPyIz40fMvFLIRppgMOG7A+DdgmYRCfik=; b=lY22r9i1PGrinOoI7pLIX9ARzKeJ59nas4xwf4bv9TOT9JeVV6uczMSQ fwd1sney//Z7Jjqz+ivxWlVyxBc5RAnZJ/zpnRjcNVumNjbjm3SW6NJ7D ty4XzGTKWMe3FufclrGzgBRIjsk3LYYJqhTRj+MUvLZljud1Cd6rGAmKz dSAOtx3IcdMzpBnxeLWz1nfhXcDR0UVDNrn5w68J/bLtNtnWEFytLIeyW //x/SqXasz4iIJB0vo66GnOZxYoXMdouSikaRmIJa0ZWgtQwhZggDSlSY ++t+BwQNJUc93a/Iy2cpFwJL6fPX45W5pxARud6bF2n81d6swLaWMX7k6 g==; X-CSE-ConnectionGUID: nhAMmg8CQBeBvpdgCsCy5Q== X-CSE-MsgGUID: fM2oomcISXCIYjLLlcVECg== X-IronPort-AV: E=McAfee;i="6700,10204,11105"; a="26092012" X-IronPort-AV: E=Sophos;i="6.08,244,1712646000"; d="scan'208";a="26092012" Received: from orviesa006.jf.intel.com ([10.64.159.146]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jun 2024 07:08:44 -0700 X-CSE-ConnectionGUID: 491sGqmeQr6MnQAXLeWL0Q== X-CSE-MsgGUID: VWJlLWLQQy6auI9R6sec/Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,244,1712646000"; d="scan'208";a="41675653" Received: from silpixa00401384.ir.intel.com ([10.243.23.101]) by orviesa006.jf.intel.com with ESMTP; 17 Jun 2024 07:08:42 -0700 From: Emma Finn To: ovs-dev@openvswitch.org Date: Mon, 17 Jun 2024 14:08:37 +0000 Message-Id: <20240617140837.508342-1-emma.finn@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [ovs-dev] [v2] odp-execute: Check IPv4 checksum offload flag in AVX. 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 IPv4 action did not check whether the IPv4 checksum offload flag has been set and was incorrectly calculating checksums in software. Adding a check to skip AVX checksum calculation when offload flags are set. Signed-off-by: Emma Finn Reported-by: Eelco Chaudron Acked-by: Mike Pattrick --- lib/odp-execute-avx512.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/odp-execute-avx512.c b/lib/odp-execute-avx512.c index 569ea789e..54bd556e1 100644 --- a/lib/odp-execute-avx512.c +++ b/lib/odp-execute-avx512.c @@ -473,7 +473,7 @@ action_avx512_ipv4_set_addrs(struct dp_packet_batch *batch, * (v_pkt_masked). */ __m256i v_new_hdr = _mm256_or_si256(v_key_shuf, v_pkt_masked); - if (dp_packet_hwol_tx_ip_csum(packet)) { + if (dp_packet_hwol_l3_ipv4(packet)) { dp_packet_ol_reset_ip_csum_good(packet); } else { ovs_be16 old_csum = ~nh->ip_csum;