From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D46CF42D15; Wed, 21 Jun 2023 16:06:45 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 59AC44068E; Wed, 21 Jun 2023 16:06:45 +0200 (CEST) Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by mails.dpdk.org (Postfix) with ESMTP id A12124003C for ; Wed, 21 Jun 2023 16:06:43 +0200 (CEST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 207FE32005CA; Wed, 21 Jun 2023 10:06:42 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Wed, 21 Jun 2023 10:06:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to; s=fm2; t=1687356401; x=1687442801; bh=givQOCXpmF AlJxyTFkZ1XuiDRcpM+wqqtDAARNjWe2M=; b=E2hclaOLu7QF+s5lUayLLS8ql/ b7/MK9BGnJqxEoNlO29+HgOENnPbocXBgC3cXdUWIGCx5O4LLWnBfQ5eIBt1eoRZ NTOt/M2aLUlyOOTsORLEZGW3rCQsJ5Xktsm++fT3ijWA35gDmvYT1ydLCaQXvDyh 6E7SxQRfo1h0SpbRC98AmOcX6OlEgIpvSL3iexDMNAeFKy2xzSO68t+SL+NgmTmR U2TES3eMVeFXar6+lG9yefr/bsO/eTsu0pBLKjl6HfugoQKlIANX7heJA5Fyqwcd xvBlXEQWO1T3R2j5EqoTRRNGlV4g/3xekUlvYCF/qWjH/DW8VHg7NMqgF/Uw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1687356401; x=1687442801; bh=givQOCXpmFAlJ xyTFkZ1XuiDRcpM+wqqtDAARNjWe2M=; b=CfJhRgn1m5UHKmDITheM1MJixbihW g3fu3/yyd2aHCqlNHFFvUciJrz0kg4ljm4RmxofFIF4YT08Kog1knAQCQjwV9CtH VxhYHd7Q71aenRyzOGWbSSNZOfdpuc6j5xXcxO4gBSPNo60aIzDdUN4EGd4teJRK i2E4x3hVVCXYUIbk3bchfpL010ouEHcJfybDk9ciYKIge2xhzYpNwXaQU70DuCnk RssaVCduCsOzn3/e3Mnyxmpyig+LUZxCTF71b1x2g6LmWEecswHKUdYZN8/wcMk9 LYW1sJrayvcXBXjLgnlCu8Zc1Q7xSc82Z5FgH6R53yOwHw1lxNMUgUPFw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrgeefkedggeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpedvtefgffdvueeugeefheekteeflefhhfdtjeefteejtedttefgtdeh vdetteehueenucffohhmrghinhepughpughkrdhorhhgnecuvehluhhsthgvrhfuihiivg eptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhhonhdr nhgvth X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 21 Jun 2023 10:06:40 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: jerinj@marvell.com, Ori Kam , Liron Himi Subject: [PATCH] regex/cn9k: remove rule compiler Date: Wed, 21 Jun 2023 16:06:37 +0200 Message-ID: <20230621140637.657038-1-thomas@monjalon.net> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Nobody knows how to build the feature. When the dependency "rxp_compiler" is found, the header file is not available: drivers/regex/cn9k/cn9k_regexdev_compiler.c:12:10: fatal error: rxp-compiler.h: No such file or directory It seems that it depends on a proprietay library. According to what was discussed in the Technical Board: http://mails.dpdk.org/archives/dev/2019-June/135847.html the dependency must be "freely available". Bugzilla ID: 1232 Signed-off-by: Thomas Monjalon --- doc/guides/prog_guide/regexdev.rst | 3 +- drivers/regex/cn9k/cn9k_regexdev.c | 10 +- drivers/regex/cn9k/cn9k_regexdev_compiler.c | 228 -------------------- drivers/regex/cn9k/cn9k_regexdev_compiler.h | 11 - drivers/regex/cn9k/meson.build | 8 - 5 files changed, 2 insertions(+), 258 deletions(-) delete mode 100644 drivers/regex/cn9k/cn9k_regexdev_compiler.c delete mode 100644 drivers/regex/cn9k/cn9k_regexdev_compiler.h diff --git a/doc/guides/prog_guide/regexdev.rst b/doc/guides/prog_guide/regexdev.rst index 5ca7e0c769..93229fa743 100644 --- a/doc/guides/prog_guide/regexdev.rst +++ b/doc/guides/prog_guide/regexdev.rst @@ -124,8 +124,7 @@ The configuration mode is depended on the PMD capabilities. Online rule configuration is done using the following API functions: ``rte_regexdev_rule_db_update`` which add / remove rules from the rules -precompiled list, and ``rte_regexdev_rule_db_compile_activate`` -which compile the rules and loads them to the RegEx HW. +precompiled list. Offline rule configuration can be done by adding a pointer to the compiled rule database in the configuration step, or by using diff --git a/drivers/regex/cn9k/cn9k_regexdev.c b/drivers/regex/cn9k/cn9k_regexdev.c index 56c862c5a7..e96cbf4141 100644 --- a/drivers/regex/cn9k/cn9k_regexdev.c +++ b/drivers/regex/cn9k/cn9k_regexdev.c @@ -14,7 +14,6 @@ /* REE common headers */ #include "cn9k_regexdev.h" -#include "cn9k_regexdev_compiler.h" /* HW matches are at offset 0x80 from RES_PTR_ADDR @@ -697,12 +696,6 @@ cn9k_ree_queue_pair_setup(struct rte_regexdev *dev, uint16_t qp_id, return 0; } -static int -cn9k_ree_rule_db_compile_activate(struct rte_regexdev *dev) -{ - return cn9k_ree_rule_db_compile_prog(dev); -} - static int cn9k_ree_rule_db_update(struct rte_regexdev *dev, const struct rte_regexdev_rule *rules, uint16_t nb_rules) @@ -834,8 +827,7 @@ static struct rte_regexdev_ops cn9k_ree_ops = { .dev_attr_get = NULL, .dev_attr_set = NULL, .dev_rule_db_update = cn9k_ree_rule_db_update, - .dev_rule_db_compile_activate = - cn9k_ree_rule_db_compile_activate, + .dev_rule_db_compile_activate = NULL, .dev_db_import = cn9k_ree_rule_db_import, .dev_db_export = cn9k_ree_rule_db_export, .dev_xstats_names_get = NULL, diff --git a/drivers/regex/cn9k/cn9k_regexdev_compiler.c b/drivers/regex/cn9k/cn9k_regexdev_compiler.c deleted file mode 100644 index 60f1c1b4c4..0000000000 --- a/drivers/regex/cn9k/cn9k_regexdev_compiler.c +++ /dev/null @@ -1,228 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * Copyright (C) 2020 Marvell International Ltd. - */ - -#include -#include - -#include "cn9k_regexdev.h" -#include "cn9k_regexdev_compiler.h" - -#ifdef REE_COMPILER_SDK -#include - -static int -ree_rule_db_compile(const struct rte_regexdev_rule *rules, - uint16_t nb_rules, struct rxp_rof **rof, struct rxp_rof **rofi, - struct rxp_rof *rof_for_incremental_compile, - struct rxp_rof *rofi_for_incremental_compile) -{ - /*INPUT*/ - struct rxp_prefix_selection_control_list *prefix_selection_control_list - = NULL; - struct rxp_blacklist_data_sample *blacklist_sample_data = NULL; - struct rxp_rule_ids_to_remove *rule_ids_to_remove = NULL; - struct rxp_roff *roff_for_incremental_compile = NULL; - - /*OPTIONS - setting default values*/ - enum rxp_virtual_prefix_mode virtual_prefix_mode = - RXP_VIRTUAL_PREFIX_MODE_0; - enum rxp_prefix_capacity prefix_capacity = RXP_PREFIX_CAPACITY_32K; - /**< rxp_global_regex_options_flags*/ - enum rxp_compiler_objective objective = RXP_COMPILER_OBJECTIVE_5; - enum rxp_tpe_data_width tpe_data_width = RXP_TPE_DATA_WIDTH_4; - uint32_t compiler_options = RXP_COMPILER_OPTIONS_FORCE; - /**< rxp_compiler_options_flags*/ - enum rxp_verbose_level verbose = RXP_VERBOSE_LEVEL_3; - enum rxp_version set_rxp_version = RXP_VERSION_V5_8; - uint32_t compiler_output_flags = 0; - /**< rxp_compiler_output_flags*/ - uint32_t global_regex_options = 0; - /**< rxp_global_regex_options_flags*/ - float set_auto_blacklist = 0; - uint32_t max_rep_max = 65535; - uint32_t divide_ruleset = 1; - struct rxp_ruleset ruleset; - float ptpb_threshold = 0; - uint32_t set_max = 0; - uint32_t threads = 1; - - /*OUTPUT*/ - struct rxp_rule_direction_analysis *rule_direction_analysis = NULL; - struct rxp_compilation_statistics *compilation_statistics = NULL; - struct rxp_prefix_selection_control_list *generated_pscl = NULL; - struct rxp_uncompiled_rules_log *uncompiled_rules_log = NULL; - struct rxp_critical_rules_rank *critical_rules_rank = NULL; - struct rxp_compiled_rules_log *compiled_rules_log = NULL; - struct rxp_roff *roff = NULL; - - uint16_t i; - int ret; - - ruleset.number_of_entries = nb_rules; - ruleset.rules = rte_malloc("rxp_rule_entry", - nb_rules*sizeof(struct rxp_rule_entry), 0); - - if (ruleset.rules == NULL) { - cn9k_err("Could not allocate memory for rule compilation\n"); - return -EFAULT; - } - if (rof_for_incremental_compile) - compiler_options |= RXP_COMPILER_OPTIONS_INCREMENTAL; - if (rofi_for_incremental_compile) - compiler_options |= RXP_COMPILER_OPTIONS_CHECKSUM; - - for (i = 0; i < nb_rules; i++) { - ruleset.rules[i].number_of_prefix_entries = 0; - ruleset.rules[i].prefix = NULL; - ruleset.rules[i].rule = rules[i].pcre_rule; - ruleset.rules[i].rule_id = rules[i].rule_id; - ruleset.rules[i].subset_id = rules[i].group_id; - ruleset.rules[i].rule_direction_type = - RXP_RULE_DIRECTION_TYPE_NONE; - } - - ret = rxp_compile_advanced( - /*INPUT*/ - &ruleset, - prefix_selection_control_list, - rof_for_incremental_compile, - roff_for_incremental_compile, - rofi_for_incremental_compile, - rule_ids_to_remove, - blacklist_sample_data, - - /*OPTIONS*/ - compiler_options, - prefix_capacity, - global_regex_options, - set_auto_blacklist, - set_max, - objective, - ptpb_threshold, - max_rep_max, - threads, - set_rxp_version, - verbose, - tpe_data_width, - virtual_prefix_mode, - compiler_output_flags, - divide_ruleset, - - /*OUTPUT*/ - &compilation_statistics, - &compiled_rules_log, - &critical_rules_rank, - &rule_direction_analysis, - &uncompiled_rules_log, - rof, - &roff, - rofi, - &generated_pscl); - rte_free(ruleset.rules); - - return ret; -} - -int -cn9k_ree_rule_db_compile_prog(struct rte_regexdev *dev) -{ - struct cn9k_ree_data *data = dev->data->dev_private; - struct roc_ree_vf *vf = &data->vf; - char compiler_version[] = "20.5.2.eda0fa2"; - char timestamp[] = "19700101_000001"; - uint32_t rule_db_len, rule_dbi_len; - struct rxp_rof *rofi_inc_p = NULL; - struct rxp_rof_entry rule_dbi[6]; - char *rofi_rof_entries = NULL; - struct rxp_rof *rofi = NULL; - struct rxp_rof *rof = NULL; - struct rxp_rof rofi_inc; - struct rxp_rof rof_inc; - char *rule_db = NULL; - int ret; - - ree_func_trace(); - - ret = roc_ree_rule_db_len_get(vf, &rule_db_len, &rule_dbi_len); - if (ret != 0) { - cn9k_err("Could not get rule db length"); - return ret; - } - - if (rule_db_len > 0) { - cn9k_ree_dbg("Incremental compile, rule db len %d rule dbi len %d", - rule_db_len, rule_dbi_len); - rule_db = rte_malloc("ree_rule_db", rule_db_len, 0); - if (!rule_db) { - cn9k_err("Could not allocate memory for rule db"); - return -EFAULT; - } - - ret = roc_ree_rule_db_get(vf, rule_db, rule_db_len, - (char *)rule_dbi, rule_dbi_len); - if (ret) { - cn9k_err("Could not read rule db"); - rte_free(rule_db); - return -EFAULT; - } - rof_inc.rof_revision = 0; - rof_inc.rof_version = 2; - rof_inc.rof_entries = (struct rxp_rof_entry *)rule_db; - rof_inc.rxp_compiler_version = compiler_version; - rof_inc.timestamp = timestamp; - rof_inc.number_of_entries = - (rule_db_len/sizeof(struct rxp_rof_entry)); - - if (rule_dbi_len > 0) { - /* incremental compilation not the first time */ - rofi_inc.rof_revision = 0; - rofi_inc.rof_version = 2; - rofi_inc.rof_entries = rule_dbi; - rofi_inc.rxp_compiler_version = compiler_version; - rofi_inc.timestamp = timestamp; - rofi_inc.number_of_entries = - (rule_dbi_len/sizeof(struct rxp_rof_entry)); - rofi_inc_p = &rofi_inc; - } - ret = ree_rule_db_compile(data->rules, data->nb_rules, &rof, - &rofi, &rof_inc, rofi_inc_p); - if (rofi->number_of_entries == 0) { - cn9k_ree_dbg("No change to rule db"); - ret = 0; - goto free_structs; - } - rule_dbi_len = rofi->number_of_entries * - sizeof(struct rxp_rof_entry); - rofi_rof_entries = (char *)rofi->rof_entries; - } else { - /* full compilation */ - ret = ree_rule_db_compile(data->rules, data->nb_rules, &rof, - &rofi, NULL, NULL); - } - if (ret != 0) { - cn9k_err("Could not compile rule db"); - goto free_structs; - } - rule_db_len = rof->number_of_entries * sizeof(struct rxp_rof_entry); - ret = roc_ree_rule_db_prog(vf, (char *)rof->rof_entries, rule_db_len, - rofi_rof_entries, rule_dbi_len); - if (ret) - cn9k_err("Could not program rule db"); - -free_structs: - rxp_free_structs(NULL, NULL, NULL, NULL, NULL, &rof, NULL, &rofi, NULL, - 1); - - rte_free(rule_db); - - return ret; -} -#else -int -cn9k_ree_rule_db_compile_prog(struct rte_regexdev *dev) -{ - RTE_SET_USED(dev); - return -ENOTSUP; -} -#endif diff --git a/drivers/regex/cn9k/cn9k_regexdev_compiler.h b/drivers/regex/cn9k/cn9k_regexdev_compiler.h deleted file mode 100644 index 4c29a69ada..0000000000 --- a/drivers/regex/cn9k/cn9k_regexdev_compiler.h +++ /dev/null @@ -1,11 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * Copyright (C) 2020 Marvell International Ltd. - */ - -#ifndef _CN9K_REGEXDEV_COMPILER_H_ -#define _CN9K_REGEXDEV_COMPILER_H_ - -int -cn9k_ree_rule_db_compile_prog(struct rte_regexdev *dev); - -#endif /* _CN9K_REGEXDEV_COMPILER_H_ */ diff --git a/drivers/regex/cn9k/meson.build b/drivers/regex/cn9k/meson.build index 19b2e70111..44b12b9845 100644 --- a/drivers/regex/cn9k/meson.build +++ b/drivers/regex/cn9k/meson.build @@ -8,16 +8,8 @@ if not is_linux or not dpdk_conf.get('RTE_ARCH_64') subdir_done() endif -lib = cc.find_library('rxp_compiler', required: false) -if lib.found() - ext_deps += lib - ext_deps += cc.find_library('stdc++', required: true) - cflags += ['-DREE_COMPILER_SDK'] -endif - sources = files( 'cn9k_regexdev.c', - 'cn9k_regexdev_compiler.c', ) deps += ['bus_pci', 'regexdev'] -- 2.41.0