Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 17955C2D0A3 for ; Thu, 12 Nov 2020 14:50:33 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 7AEEF20872 for ; Thu, 12 Nov 2020 14:50:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7AEEF20872 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5C2345928; Thu, 12 Nov 2020 15:50:30 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 9D8144CA6 for ; Thu, 12 Nov 2020 15:50:27 +0100 (CET) IronPort-SDR: a3KNdm8HsOOPw03P2kAIg6FBYjPBLZXMrjUTYiMKxM827kqDm6HB7UPgBbmzMZQKFN+JTDNRoQ UbXTa9aPzQZw== X-IronPort-AV: E=McAfee;i="6000,8403,9802"; a="158096310" X-IronPort-AV: E=Sophos;i="5.77,472,1596524400"; d="scan'208";a="158096310" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Nov 2020 06:50:15 -0800 IronPort-SDR: upVi3GzTm81gAD9R1/GaMZgSRQsjqJgcaMiOfrqERyDkriH9GiO2sW5Uj2iQLYrKJ7V+eePaA4 VbS7IQ6XzYAw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,472,1596524400"; d="scan'208";a="530690675" Received: from silpixa00400573.ir.intel.com (HELO silpixa00400573.ger.corp.intel.com) ([10.237.223.107]) by fmsmga006.fm.intel.com with ESMTP; 12 Nov 2020 06:50:14 -0800 From: Cristian Dumitrescu To: dev@dpdk.org Cc: david.marchand@redhat.com Date: Thu, 12 Nov 2020 14:50:13 +0000 Message-Id: <20201112145013.21778-1-cristian.dumitrescu@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH] pipeline: fix multiple emit pattern detection X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Fix the detection of instruction pattern with multiple emits followed by TX. Once detected, this is one of the instruction patterns that is internally replaced with a single optimized instruction, as long as none of the instructions to be replaced is referenced by a jump instruction. The fix enforces this check for the TX instruction of the pattern. Fixes: 31035e87b207 ("pipeline: add SWX instruction optimizer") Signed-off-by: Cristian Dumitrescu --- lib/librte_pipeline/rte_swx_pipeline.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/librte_pipeline/rte_swx_pipeline.c b/lib/librte_pipeline/rte_swx_pipeline.c index fe8bfc8b3..eaaed7a0a 100644 --- a/lib/librte_pipeline/rte_swx_pipeline.c +++ b/lib/librte_pipeline/rte_swx_pipeline.c @@ -5796,6 +5796,9 @@ instr_pattern_emit_many_tx_detect(struct instruction *instr, if (instr[i].type != INSTR_TX) return 0; + if (data[i].n_users) + return 0; + i++; *n_pattern_instr = i; -- 2.17.1