get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/76734/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 76734,
    "url": "http://patches.dpdk.org/api/patches/76734/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200907163926.4878-3-konstantin.ananyev@intel.com/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20200907163926.4878-3-konstantin.ananyev@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200907163926.4878-3-konstantin.ananyev@intel.com",
    "date": "2020-09-07T16:39:26",
    "name": "[2/2] examples/l3fwd-acl: allow explicitly select classify method",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "08e057c53e89783ae3b47cbe53e84b2379616f2a",
    "submitter": {
        "id": 33,
        "url": "http://patches.dpdk.org/api/people/33/?format=api",
        "name": "Ananyev, Konstantin",
        "email": "konstantin.ananyev@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20200907163926.4878-3-konstantin.ananyev@intel.com/mbox/",
    "series": [
        {
            "id": 11996,
            "url": "http://patches.dpdk.org/api/series/11996/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=11996",
            "date": "2020-09-07T16:39:24",
            "name": "Few enhancements for l3fwd-acl",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/11996/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/76734/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/76734/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 101B0A04B1;\n\tMon,  7 Sep 2020 18:40:00 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 02CFA1C0D9;\n\tMon,  7 Sep 2020 18:39:54 +0200 (CEST)",
            "from mga17.intel.com (mga17.intel.com [192.55.52.151])\n by dpdk.org (Postfix) with ESMTP id 47E991C0D5\n for <dev@dpdk.org>; Mon,  7 Sep 2020 18:39:52 +0200 (CEST)",
            "from fmsmga006.fm.intel.com ([10.253.24.20])\n by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 07 Sep 2020 09:39:51 -0700",
            "from sivswdev08.ir.intel.com ([10.237.217.47])\n by fmsmga006.fm.intel.com with ESMTP; 07 Sep 2020 09:39:50 -0700"
        ],
        "IronPort-SDR": [
            "\n iaSvKvoV8WHIm9kJnq1EfOA2NXYXWNixESinSqRgktpIq1ANZBtPnFh2AajZ79Z1sunv+Qrlsb\n r/nXB1HuSntQ==",
            "\n o3kAt1jnMWHXC8cj5dKmnDpwWfQj+pC5x/BcJPWIKUw1bRCVnr6Hi+9s9UXKmPWkc+gpqOOkrI\n Io3YVoWo8KpQ=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9737\"; a=\"138072649\"",
            "E=Sophos;i=\"5.76,402,1592895600\"; d=\"scan'208\";a=\"138072649\"",
            "E=Sophos;i=\"5.76,402,1592895600\"; d=\"scan'208\";a=\"504082044\""
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "From": "Konstantin Ananyev <konstantin.ananyev@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "Konstantin Ananyev <konstantin.ananyev@intel.com>",
        "Date": "Mon,  7 Sep 2020 17:39:26 +0100",
        "Message-Id": "<20200907163926.4878-3-konstantin.ananyev@intel.com>",
        "X-Mailer": "git-send-email 2.18.0",
        "In-Reply-To": "<20200907163926.4878-1-konstantin.ananyev@intel.com>",
        "References": "<20200907163926.4878-1-konstantin.ananyev@intel.com>",
        "Subject": "[dpdk-dev] [PATCH 2/2] examples/l3fwd-acl: allow explicitly select\n\tclassify method",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Replace '--scalar' command-line option with new one: --alg=<algname>\nto allow user explicitly select desired classify method.\nThis is an optional parameter, if not specified default classify\nalgorithm will be used.\n\nSigned-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>\n---\n doc/guides/rel_notes/release_20_11.rst        |   5 +\n .../sample_app_ug/l3_forward_access_ctrl.rst  |   9 +-\n examples/l3fwd-acl/main.c                     | 103 ++++++++++++++++--\n 3 files changed, 103 insertions(+), 14 deletions(-)",
    "diff": "diff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/release_20_11.rst\nindex e9e1fba1c..01b1aae2e 100644\n--- a/doc/guides/rel_notes/release_20_11.rst\n+++ b/doc/guides/rel_notes/release_20_11.rst\n@@ -60,6 +60,11 @@ New Features\n   Added new optional parameter ``--eth-dest`` for the ``l3fwd-acl`` to allow\n   the user to specify the destination mac address for each ethernet port used.\n \n+* **Allow explicitly select classify method for l3fwd-acl sample application.**\n+\n+  Replace ``--scalar`` command-line option with ``--alg=<value>``, to\n+  to allow user explicitly select desired classify method.\n+\n \n Removed Items\n -------------\ndiff --git a/doc/guides/sample_app_ug/l3_forward_access_ctrl.rst b/doc/guides/sample_app_ug/l3_forward_access_ctrl.rst\nindex 91004356e..80dd8ba00 100644\n--- a/doc/guides/sample_app_ug/l3_forward_access_ctrl.rst\n+++ b/doc/guides/sample_app_ug/l3_forward_access_ctrl.rst\n@@ -236,7 +236,7 @@ The application has a number of command line options:\n \n ..  code-block:: console\n \n-    ./build/l3fwd-acl [EAL options] -- -p PORTMASK [-P] --config(port,queue,lcore)[,(port,queue,lcore)] --rule_ipv4 FILENAME rule_ipv6 FILENAME [--scalar] [--enable-jumbo [--max-pkt-len PKTLEN]] [--no-numa] [--eth-dest=X,MM:MM:MM:MM:MM:MM]\n+    ./build/l3fwd-acl [EAL options] -- -p PORTMASK [-P] --config(port,queue,lcore)[,(port,queue,lcore)] --rule_ipv4 FILENAME rule_ipv6 FILENAME [--alg=<val>] [--enable-jumbo [--max-pkt-len PKTLEN]] [--no-numa] [--eth-dest=X,MM:MM:MM:MM:MM:MM]\n \n \n where,\n@@ -252,7 +252,8 @@ where,\n \n *   --rule_ipv6 FILENAME: Specifies the IPv6 ACL and route rules file\n \n-*   --scalar: Use a scalar function to perform rule lookup\n+*   --alg=<val>: optional, ACL classify method to use, one of:\n+    ``scalar|sse|avx2|neon|altivec``\n \n *   --enable-jumbo: optional, enables jumbo frames\n \n@@ -270,7 +271,7 @@ To enable L3 forwarding between two ports, assuming that both ports are in the s\n \n ..  code-block:: console\n \n-    ./build/l3fwd-acl -l 1,2 -n 4 -- -p 0x3 --config=\"(0,0,1),(1,0,2)\" --rule_ipv4=\"./rule_ipv4.db\" -- rule_ipv6=\"./rule_ipv6.db\" --scalar\n+    ./build/l3fwd-acl -l 1,2 -n 4 -- -p 0x3 --config=\"(0,0,1),(1,0,2)\" --rule_ipv4=\"./rule_ipv4.db\" -- rule_ipv6=\"./rule_ipv6.db\" --alg=scalar\n \n In this command:\n \n@@ -296,7 +297,7 @@ In this command:\n \n *   The --rule_ipv6 option specifies the reading of IPv6 rules sets from the ./ rule_ipv6.db file.\n \n-*   The --scalar option specifies the performing of rule lookup with a scalar function.\n+*   The --alg=scalar option specifies the performing of rule lookup with a scalar function.\n \n Explanation\n -----------\ndiff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c\nindex 39175398e..e0f7701cd 100644\n--- a/examples/l3fwd-acl/main.c\n+++ b/examples/l3fwd-acl/main.c\n@@ -146,6 +146,32 @@ static struct rte_mempool *pktmbuf_pool[NB_SOCKETS];\n /* ethernet addresses of ports */\n static struct rte_ether_hdr port_l2hdr[RTE_MAX_ETHPORTS];\n \n+static const struct {\n+\tconst char *name;\n+\tenum rte_acl_classify_alg alg;\n+} acl_alg[] = {\n+\t{\n+\t\t.name = \"scalar\",\n+\t\t.alg = RTE_ACL_CLASSIFY_SCALAR,\n+\t},\n+\t{\n+\t\t.name = \"sse\",\n+\t\t.alg = RTE_ACL_CLASSIFY_SSE,\n+\t},\n+\t{\n+\t\t.name = \"avx2\",\n+\t\t.alg = RTE_ACL_CLASSIFY_AVX2,\n+\t},\n+\t{\n+\t\t.name = \"neon\",\n+\t\t.alg = RTE_ACL_CLASSIFY_NEON,\n+\t},\n+\t{\n+\t\t.name = \"altivec\",\n+\t\t.alg = RTE_ACL_CLASSIFY_ALTIVEC,\n+\t},\n+};\n+\n /***********************start of ACL part******************************/\n #ifdef DO_RFC_1812_CHECKS\n static inline int\n@@ -166,7 +192,7 @@ send_single_packet(struct rte_mbuf *m, uint16_t port);\n #define OPTION_ENBJMO\t\t\"enable-jumbo\"\n #define OPTION_RULE_IPV4\t\"rule_ipv4\"\n #define OPTION_RULE_IPV6\t\"rule_ipv6\"\n-#define OPTION_SCALAR\t\t\"scalar\"\n+#define OPTION_ALG\t\t\"alg\"\n #define OPTION_ETH_DEST\t\t\"eth-dest\"\n #define ACL_DENY_SIGNATURE\t0xf0000000\n #define RTE_LOGTYPE_L3FWDACL\tRTE_LOGTYPE_USER3\n@@ -441,7 +467,7 @@ static struct {\n static struct{\n \tconst char *rule_ipv4_name;\n \tconst char *rule_ipv6_name;\n-\tint scalar;\n+\tenum rte_acl_classify_alg alg;\n } parm_config;\n \n const char cb_port_delim[] = \":\";\n@@ -1094,13 +1120,58 @@ add_rules(const char *rule_path,\n \treturn 0;\n }\n \n+static int\n+usage_acl_alg(char *buf, size_t sz)\n+{\n+\tuint32_t i, n, rc, tn;\n+\n+\tn = 0;\n+\ttn = 0;\n+\tfor (i = 0; i < RTE_DIM(acl_alg); i++) {\n+\t\trc = snprintf(buf + n, sz - n,\n+\t\t\ti == RTE_DIM(acl_alg) - 1 ? \"%s\" : \"%s|\",\n+\t\t\tacl_alg[i].name);\n+\t\ttn += rc;\n+\t\tif (rc < sz - n)\n+\t\t\tn += rc;\n+\t}\n+\n+\treturn tn;\n+}\n+\n+static const char *\n+str_acl_alg(enum rte_acl_classify_alg alg)\n+{\n+\tuint32_t i;\n+\n+\tfor (i = 0; i != RTE_DIM(acl_alg); i++) {\n+\t\tif (alg == acl_alg[i].alg)\n+\t\t\treturn acl_alg[i].name;\n+\t}\n+\n+\treturn \"default\";\n+}\n+\n+static enum rte_acl_classify_alg\n+parse_acl_alg(const char *alg)\n+{\n+\tuint32_t i;\n+\n+\tfor (i = 0; i != RTE_DIM(acl_alg); i++) {\n+\t\tif (strcmp(alg, acl_alg[i].name) == 0)\n+\t\t\treturn acl_alg[i].alg;\n+\t}\n+\n+\treturn RTE_ACL_CLASSIFY_DEFAULT;\n+}\n+\n static void\n dump_acl_config(void)\n {\n \tprintf(\"ACL option are:\\n\");\n \tprintf(OPTION_RULE_IPV4\": %s\\n\", parm_config.rule_ipv4_name);\n \tprintf(OPTION_RULE_IPV6\": %s\\n\", parm_config.rule_ipv6_name);\n-\tprintf(OPTION_SCALAR\": %d\\n\", parm_config.scalar);\n+\tprintf(OPTION_ALG\": %s\\n\", str_acl_alg(parm_config.alg));\n }\n \n static int\n@@ -1141,8 +1212,8 @@ setup_acl(struct rte_acl_rule *route_base,\n \tif ((context = rte_acl_create(&acl_param)) == NULL)\n \t\trte_exit(EXIT_FAILURE, \"Failed to create ACL context\\n\");\n \n-\tif (parm_config.scalar && rte_acl_set_ctx_classify(context,\n-\t\t\tRTE_ACL_CLASSIFY_SCALAR) != 0)\n+\tif (parm_config.alg != RTE_ACL_CLASSIFY_DEFAULT &&\n+\t\t\trte_acl_set_ctx_classify(context, parm_config.alg) != 0)\n \t\trte_exit(EXIT_FAILURE,\n \t\t\t\"Failed to setup classify method for  ACL context\\n\");\n \n@@ -1525,6 +1596,9 @@ init_lcore_rx_queues(void)\n static void\n print_usage(const char *prgname)\n {\n+\tchar alg[PATH_MAX];\n+\n+\tusage_acl_alg(alg, sizeof(alg));\n \tprintf(\"%s [EAL options] -- -p PORTMASK -P\"\n \t\t\"--\"OPTION_RULE_IPV4\"=FILE\"\n \t\t\"--\"OPTION_RULE_IPV6\"=FILE\"\n@@ -1546,8 +1620,8 @@ print_usage(const char *prgname)\n \t\t\"character '%c'.\\n\"\n \t\t\"  --\"OPTION_RULE_IPV6\"=FILE: specify the ipv6 rules \"\n \t\t\"entries file.\\n\"\n-\t\t\"  --\"OPTION_SCALAR\": Use scalar function to do lookup\\n\",\n-\t\tprgname, ACL_LEAD_CHAR, ROUTE_LEAD_CHAR);\n+\t\t\"  --\"OPTION_ALG\": ACL classify method to use, one of: %s\\n\",\n+\t\tprgname, ACL_LEAD_CHAR, ROUTE_LEAD_CHAR, alg);\n }\n \n static int\n@@ -1656,6 +1730,7 @@ parse_eth_dest(const char *optarg)\n \treturn NULL;\n }\n \n+\n /* Parse the argument given in the command line of the application */\n static int\n parse_args(int argc, char **argv)\n@@ -1670,7 +1745,7 @@ parse_args(int argc, char **argv)\n \t\t{OPTION_ENBJMO, 0, 0, 0},\n \t\t{OPTION_RULE_IPV4, 1, 0, 0},\n \t\t{OPTION_RULE_IPV6, 1, 0, 0},\n-\t\t{OPTION_SCALAR, 0, 0, 0},\n+\t\t{OPTION_ALG, 1, 0, 0},\n \t\t{OPTION_ETH_DEST, 1, 0, 0},\n \t\t{NULL, 0, 0, 0}\n \t};\n@@ -1764,8 +1839,16 @@ parse_args(int argc, char **argv)\n \t\t\t}\n \n \t\t\tif (!strncmp(lgopts[option_index].name,\n-\t\t\t\t\tOPTION_SCALAR, sizeof(OPTION_SCALAR)))\n-\t\t\t\tparm_config.scalar = 1;\n+\t\t\t\t\tOPTION_ALG, sizeof(OPTION_ALG))) {\n+\t\t\t\tparm_config.alg = parse_acl_alg(optarg);\n+\t\t\t\tif (parm_config.alg ==\n+\t\t\t\t\t\tRTE_ACL_CLASSIFY_DEFAULT) {\n+\t\t\t\t\tprintf(\"unknown %s value:\\\"%s\\\"\\n\",\n+\t\t\t\t\t\tOPTION_ALG, optarg);\n+\t\t\t\t\tprint_usage(prgname);\n+\t\t\t\t\treturn -1;\n+\t\t\t\t}\n+\t\t\t}\n \n \t\t\tif (!strncmp(lgopts[option_index].name, OPTION_ETH_DEST,\n \t\t\t\t\tsizeof(OPTION_ETH_DEST))) {\n",
    "prefixes": [
        "2/2"
    ]
}