DPDK patches and discussions
 help / color / mirror / Atom feed
From: Konstantin Ananyev <konstantin.ananyev@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 3/3] doc: ACL - add description for max_size build parameter
Date: Wed, 18 Feb 2015 16:28:51 +0000	[thread overview]
Message-ID: <1424276931-16380-4-git-send-email-konstantin.ananyev@intel.com> (raw)
In-Reply-To: <1424276931-16380-1-git-send-email-konstantin.ananyev@intel.com>

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
---
 .../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

  parent reply	other threads:[~2015-02-18 16:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-18 16:28 [dpdk-dev] [PATCH 0/3] doc: ACL - add description for new features Konstantin Ananyev
2015-02-18 16:28 ` [dpdk-dev] [PATCH 1/3] doc: Add restrictions for ACL rule fields Konstantin Ananyev
2015-02-18 16:28 ` [dpdk-dev] [PATCH 2/3] doc: ACL - add description for different classification methods Konstantin Ananyev
2015-02-18 16:28 ` Konstantin Ananyev [this message]
2015-02-18 19:33 ` [dpdk-dev] [PATCH 0/3] doc: ACL - add description for new features Butler, Siobhan A
2015-02-24  3:08   ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1424276931-16380-4-git-send-email-konstantin.ananyev@intel.com \
    --to=konstantin.ananyev@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).