From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 242FAB475 for ; Wed, 18 Feb 2015 17:29:40 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP; 18 Feb 2015 08:24:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,602,1418112000"; d="scan'208";a="456324579" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by FMSMGA003.fm.intel.com with ESMTP; 18 Feb 2015 08:13:55 -0800 Received: from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com [10.237.217.46]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id t1IGSwqO030370; Wed, 18 Feb 2015 16:28:58 GMT Received: from sivswdev02.ir.intel.com (localhost [127.0.0.1]) by sivswdev02.ir.intel.com with ESMTP id t1IGSwLM016453; Wed, 18 Feb 2015 16:28:58 GMT Received: (from kananye1@localhost) by sivswdev02.ir.intel.com with id t1IGSw1Z016449; Wed, 18 Feb 2015 16:28:58 GMT From: Konstantin Ananyev To: dev@dpdk.org Date: Wed, 18 Feb 2015 16:28:51 +0000 Message-Id: <1424276931-16380-4-git-send-email-konstantin.ananyev@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1424276931-16380-1-git-send-email-konstantin.ananyev@intel.com> References: <1424276931-16380-1-git-send-email-konstantin.ananyev@intel.com> Subject: [dpdk-dev] [PATCH 3/3] doc: ACL - add description for max_size build parameter X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Feb 2015 16:29:42 -0000 Signed-off-by: Konstantin Ananyev --- .../prog_guide/packet_classif_access_ctrl.rst | 52 +++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/doc/guides/prog_guide/packet_classif_access_ctrl.rst b/doc/guides/prog_guide/packet_classif_access_ctrl.rst index d2adbff..210b020 100644 --- a/doc/guides/prog_guide/packet_classif_access_ctrl.rst +++ b/doc/guides/prog_guide/packet_classif_access_ctrl.rst @@ -269,10 +269,60 @@ When creating a set of rules, for each rule, additional information must be supp When adding new rules into an ACL context, all fields must be in host byte order (LSB). When the search is performed for an input tuple, all fields in that tuple must be in network byte order (MSB). +RT memory size limit +~~~~~~~~~~~~~~~~~~~~ + +Build phase (rte_acl_build()) creates for a given set of rules internal structure for further run-time traversal. +With current implementation it is a set of multi-bit tries (with stride == 8). +Depending on the rules set, that could consume significant amount of memory. +In attempt to conserve some space ACL build process tries to split the given +rule-set into several non-intersecting subsets and construct a separate trie +for each of them. +Depending on the rule-set, it might reduce RT memory requirements but might +increase classification time. +There is a possibility at build-time to specify maximum memory limit for internal RT structures for given AC context. +It could be done via **max_size** field of the **rte_acl_config** strucure. +Setting it to the value greater than zero, instructs rte_acl_build() to: + +* attempt to minimise number of tries in the RT table, but +* make sure that size of RT table wouldn't exceed given value. + +Setting it to zero makes rte_acl_build() to use the default behaviour: +try to minimise size of the RT structures, but doesn't expose any hard limit on it. + +That gives the user the ability to decisions about performance/space trade-off. +For example: + +.. code-block:: c + + struct rte_acl_ctx * acx; + struct rte_acl_config cfg; + int ret; + + /* + * assuming that acx points to already created and + * populated with rules AC context and cfg filled properly. + */ + + /* try to build AC context, with RT strcutures less then 8MB. */ + cfg.max_size = 0x800000; + ret = rte_acl_build(acx, &cfg); + + /* + * RT strcutures can't fit into 8MB for given context. + * Try to build without exposing any hard limit. + */ + if (ret == -ERANGE) { + cfg.max_size = 0; + ret = rte_acl_build(acx, &cfg); + } + + + Classification methods ~~~~~~~~~~~~~~~~~~~~~~ -After rte_acl_build() over given ACL context has finished successfully, it can be used to perform classification - search for a ACL rule with highest priority over the input data. +After rte_acl_build() over given AC context has finished successfully, it can be used to perform classification - search for a rule with highest priority over the input data. There are several implementations of classify algorithm: * **RTE_ACL_CLASSIFY_SCALAR**: generic implementation, doesn't require any specific HW support. -- 1.8.3.1