From patchwork Tue Sep 21 10:23:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kumar Amber X-Patchwork-Id: 1530684 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (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 ozlabs.org (Postfix) with ESMTPS id 4HDHv32qRLz9sW5 for ; Tue, 21 Sep 2021 20:37:51 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 1676040621; Tue, 21 Sep 2021 10:37:49 +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 3sa4kaIbgiyh; Tue, 21 Sep 2021 10:37:47 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp4.osuosl.org (Postfix) with ESMTPS id B1C3140630; Tue, 21 Sep 2021 10:37:45 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 010ECC001E; Tue, 21 Sep 2021 10:37:45 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 1255AC001E for ; Tue, 21 Sep 2021 10:37:44 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 371A640163 for ; Tue, 21 Sep 2021 10:37:39 +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 Dv0WAib-pdeJ for ; Tue, 21 Sep 2021 10:37:38 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by smtp2.osuosl.org (Postfix) with ESMTPS id 3DAF3404FF for ; Tue, 21 Sep 2021 10:37:38 +0000 (UTC) X-IronPort-AV: E=McAfee;i="6200,9189,10113"; a="210561719" X-IronPort-AV: E=Sophos;i="5.85,311,1624345200"; d="scan'208";a="210561719" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Sep 2021 03:37:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,311,1624345200"; d="scan'208";a="612928624" Received: from bmca4bf01706bbf.iind.intel.com (HELO localhost.localdomain) ([10.190.213.111]) by fmsmga001.fm.intel.com with ESMTP; 21 Sep 2021 03:37:35 -0700 From: Kumar Amber To: ovs-dev@openvswitch.org Date: Tue, 21 Sep 2021 15:53:50 +0530 Message-Id: <20210921102353.1507458-4-kumar.amber@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210921102353.1507458-1-kumar.amber@intel.com> References: <20210921102353.1507458-1-kumar.amber@intel.com> MIME-Version: 1.0 Cc: i.maximets@ovn.org, fbl@sysclose.org, Kumar Amber Subject: [ovs-dev] [PATCH v3 3/6] dpif-netdev/mfex: Add packet hash check to autovalidator 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" This patch adds the per profile AVX512 opt hashing to autovalidator for validating the hash values against the scalar hash. Signed-off-by: Kumar Amber --- lib/dpif-netdev-private-extract.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/dpif-netdev-private-extract.c b/lib/dpif-netdev-private-extract.c index b3d96075c..263629903 100644 --- a/lib/dpif-netdev-private-extract.c +++ b/lib/dpif-netdev-private-extract.c @@ -303,6 +303,9 @@ dpif_miniflow_extract_autovalidator(struct dp_packet_batch *packets, DP_PACKET_BATCH_FOR_EACH (i, packet, packets) { pkt_metadata_init(&packet->md, in_port); miniflow_extract(packet, &keys[i].mf); + keys[i].len = netdev_flow_key_size(miniflow_n_values(&keys[i].mf)); + keys[i].hash = dpif_netdev_packet_get_rss_hash_orig_pkt(packet, + &keys[i].mf); /* Store known good metadata to compare with optimized metadata. */ good_l2_5_ofs[i] = packet->l2_5_ofs; @@ -352,6 +355,15 @@ dpif_miniflow_extract_autovalidator(struct dp_packet_batch *packets, failed = 1; } + /* Check hashes are equal. */ + if ((keys[i].hash != test_keys[i].hash) || + (keys[i].len != test_keys[i].len)) { + ds_put_format(&log_msg, "Good hash: %d len: %d\tTest hash:%d" + " len:%d\n", keys[i].hash, keys[i].len, + test_keys[i].hash, test_keys[i].len); + failed = 1; + } + if (!miniflow_equal(&keys[i].mf, &test_keys[i].mf)) { uint32_t block_cnt = miniflow_n_values(&keys[i].mf); ds_put_format(&log_msg, "Autovalidation blocks failed\n"