get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 29453,
    "url": "http://patches.dpdk.org/api/patches/29453/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1506736748-50515-1-git-send-email-xiaoyun.li@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": "<1506736748-50515-1-git-send-email-xiaoyun.li@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1506736748-50515-1-git-send-email-xiaoyun.li@intel.com",
    "date": "2017-09-30T01:59:08",
    "name": "[dpdk-dev,v2] examples/l3fwd: pass flow arguments when start app",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "085139bbb915acae613c9b4a74ab9edb0c0bc6d5",
    "submitter": {
        "id": 798,
        "url": "http://patches.dpdk.org/api/people/798/?format=api",
        "name": "Li, Xiaoyun",
        "email": "xiaoyun.li@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1506736748-50515-1-git-send-email-xiaoyun.li@intel.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/29453/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/29453/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 9F9E5199B6;\n\tSat, 30 Sep 2017 04:01:18 +0200 (CEST)",
            "from mga06.intel.com (mga06.intel.com [134.134.136.31])\n\tby dpdk.org (Postfix) with ESMTP id 9DCA95592\n\tfor <dev@dpdk.org>; Sat, 30 Sep 2017 04:01:16 +0200 (CEST)",
            "from fmsmga002.fm.intel.com ([10.253.24.26])\n\tby orsmga104.jf.intel.com with ESMTP; 29 Sep 2017 19:01:14 -0700",
            "from dpdk-lixiaoyun.sh.intel.com ([10.67.111.93])\n\tby fmsmga002.fm.intel.com with ESMTP; 29 Sep 2017 19:00:56 -0700"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos; i=\"5.42,455,1500966000\"; d=\"scan'208\";\n\ta=\"1225392067\"",
        "From": "Xiaoyun Li <xiaoyun.li@intel.com>",
        "To": "jingjing.wu@intel.com",
        "Cc": "dev@dpdk.org,\n\tXiaoyun Li <xiaoyun.li@intel.com>",
        "Date": "Sat, 30 Sep 2017 09:59:08 +0800",
        "Message-Id": "<1506736748-50515-1-git-send-email-xiaoyun.li@intel.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1506565888-194214-1-git-send-email-xiaoyun.li@intel.com>",
        "References": "<1506565888-194214-1-git-send-email-xiaoyun.li@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v2] examples/l3fwd: pass flow arguments when\n\tstart app",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "To make the performance can be tuning on different NICs or platforms. We\nneed to make the number of descriptors and Rx/TX threshold as arguments\nwhen starting l3fwd application.\n\nSigned-off-by: Xiaoyun Li <xiaoyun.li@intel.com>\n---\nv2\n* Modify commit log.\n* Update the change in guides doc.\n\n doc/guides/sample_app_ug/l3_forward.rst |  15 +++\n examples/l3fwd/main.c                   | 191 +++++++++++++++++++++++++++++++-\n 2 files changed, 204 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/doc/guides/sample_app_ug/l3_forward.rst b/doc/guides/sample_app_ug/l3_forward.rst\nindex 6a6b8fb..668b7d0 100644\n--- a/doc/guides/sample_app_ug/l3_forward.rst\n+++ b/doc/guides/sample_app_ug/l3_forward.rst\n@@ -101,6 +101,11 @@ The application has a number of command line options::\n                              [--hash-entry-num]\n                              [--ipv6]\n                              [--parse-ptype]\n+                             [--nb-rxd]\n+                             [--nb-txd]\n+                             [--rx-free-thresh]\n+                             [--tx-free-thresh]\n+                             [--tx-rs-thresh]\n \n Where,\n \n@@ -129,6 +134,16 @@ Where,\n \n * ``--parse-ptype:`` Optional, set to use software to analyze packet type. Without this option, hardware will check the packet type.\n \n+* ``--nb-rxd:`` Optional, specifies the number of Rx queue discriptors in decimal.\n+\n+* ``--nb-txd:`` Optional, specifies the number of Tx queue discriptors in decimal.\n+\n+* ``--rx-free-thresh:`` Optional, specifies the number of Rx free threshold in decimal.\n+\n+* ``--tx-free-thresh:`` Optional, specifies the number of Tx free threshold in decimal.\n+\n+* ``--tx-rs-thresh:`` Optional, specifies the number of Tx RS bit threshold in decimal.\n+\n For example, consider a dual processor socket platform with 8 physical cores, where cores 0-7 and 16-23 appear on socket 0,\n while cores 8-15 and 24-31 appear on socket 1.\n \ndiff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c\nindex 81995fd..bafac29 100644\n--- a/examples/l3fwd/main.c\n+++ b/examples/l3fwd/main.c\n@@ -83,6 +83,7 @@\n  */\n #define RTE_TEST_RX_DESC_DEFAULT 128\n #define RTE_TEST_TX_DESC_DEFAULT 512\n+#define RTE_PMD_PARAM_UNSET -1\n \n #define MAX_TX_QUEUE_PER_PORT RTE_MAX_ETHPORTS\n #define MAX_RX_QUEUE_PER_PORT 128\n@@ -92,6 +93,9 @@\n /* Static global variables used within this file. */\n static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT;\n static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT;\n+static int16_t rx_free_thresh = RTE_PMD_PARAM_UNSET;\n+static int16_t tx_free_thresh = RTE_PMD_PARAM_UNSET;\n+static int16_t tx_rs_thresh = RTE_PMD_PARAM_UNSET;\n \n /**< Ports set in promiscuous mode off by default. */\n static int promiscuous_on;\n@@ -320,7 +324,12 @@ print_usage(const char *prgname)\n \t\t\" [--no-numa]\"\n \t\t\" [--hash-entry-num]\"\n \t\t\" [--ipv6]\"\n-\t\t\" [--parse-ptype]\\n\\n\"\n+\t\t\" [--parse-ptype]\"\n+\t\t\" [--nb-rxd]\"\n+\t\t\" [--nb-txd]\"\n+\t\t\" [--rx-free-thresh]\"\n+\t\t\" [--tx-free-thresh]\"\n+\t\t\" [--tx-rs-thresh]\\n\\n\"\n \n \t\t\"  -p PORTMASK: Hexadecimal bitmask of ports to configure\\n\"\n \t\t\"  -P : Enable promiscuous mode\\n\"\n@@ -334,7 +343,12 @@ print_usage(const char *prgname)\n \t\t\"  --no-numa: Disable numa awareness\\n\"\n \t\t\"  --hash-entry-num: Specify the hash entry number in hexadecimal to be setup\\n\"\n \t\t\"  --ipv6: Set if running ipv6 packets\\n\"\n-\t\t\"  --parse-ptype: Set to use software to analyze packet type\\n\\n\",\n+\t\t\"  --parse-ptype: Set to use software to analyze packet type\\n\\n\"\n+\t\t\"  --nb-rxd: Set number of descriptors of Rx queue\\n\"\n+\t\t\"  --nb-txd: Set number of descriptors of Tx queue\\n\"\n+\t\t\"  --rx-free-thresh: Set value of Rx free threshold\\n\"\n+\t\t\"  --tx-free-thresh: Set value of Tx free threshold\\n\"\n+\t\t\"  --tx-rs-thresh: Set value of Tx RS bit threshold\\n\\n\",\n \t\tprgname);\n }\n \n@@ -389,6 +403,91 @@ parse_hash_entry_number(const char *hash_entry_num)\n }\n \n static int\n+parse_nb_rxd(const char *nb_rxd_c)\n+{\n+\tchar *end = NULL;\n+\tunsigned int nb_rxd_t;\n+\n+\t/* parse hexadecimal string */\n+\tnb_rxd_t = strtoul(nb_rxd_c, &end, 10);\n+\tif ((nb_rxd_c[0] == '\\0') || (end == NULL) || (*end != '\\0'))\n+\t\treturn -1;\n+\n+\tif (nb_rxd_t == 0)\n+\t\treturn -1;\n+\n+\treturn nb_rxd_t;\n+}\n+\n+static int\n+parse_nb_txd(const char *nb_txd_c)\n+{\n+\tchar *end = NULL;\n+\tunsigned int nb_txd_t;\n+\n+\t/* parse hexadecimal string */\n+\tnb_txd_t = strtoul(nb_txd_c, &end, 10);\n+\tif ((nb_txd_c[0] == '\\0') || (end == NULL) || (*end != '\\0'))\n+\t\treturn -1;\n+\n+\tif (nb_txd_t == 0)\n+\t\treturn -1;\n+\n+\treturn nb_txd_t;\n+}\n+\n+static int\n+parse_rx_free_thresh(const char *rx_free_thresh_c)\n+{\n+\tchar *end = NULL;\n+\tunsigned int rx_free_thresh_t;\n+\n+\t/* parse hexadecimal string */\n+\trx_free_thresh_t = strtoul(rx_free_thresh_c, &end, 10);\n+\tif ((rx_free_thresh_c[0] == '\\0') || (end == NULL) || (*end != '\\0'))\n+\t\treturn -1;\n+\n+\tif (rx_free_thresh_t == 0)\n+\t\treturn -1;\n+\n+\treturn rx_free_thresh_t;\n+}\n+\n+static int\n+parse_tx_free_thresh(const char *tx_free_thresh_c)\n+{\n+\tchar *end = NULL;\n+\tunsigned int tx_free_thresh_t;\n+\n+\t/* parse hexadecimal string */\n+\ttx_free_thresh_t = strtoul(tx_free_thresh_c, &end, 10);\n+\tif ((tx_free_thresh_c[0] == '\\0') || (end == NULL) || (*end != '\\0'))\n+\t\treturn -1;\n+\n+\tif (tx_free_thresh_t == 0)\n+\t\treturn -1;\n+\n+\treturn tx_free_thresh_t;\n+}\n+\n+static int\n+parse_tx_rs_thresh(const char *tx_rs_thresh_c)\n+{\n+\tchar *end = NULL;\n+\tunsigned int tx_rs_thresh_t;\n+\n+\t/* parse hexadecimal string */\n+\ttx_rs_thresh_t = strtoul(tx_rs_thresh_c, &end, 10);\n+\tif ((tx_rs_thresh_c[0] == '\\0') || (end == NULL) || (*end != '\\0'))\n+\t\treturn -1;\n+\n+\tif (tx_rs_thresh_t == 0)\n+\t\treturn -1;\n+\n+\treturn tx_rs_thresh_t;\n+}\n+\n+static int\n parse_config(const char *q_arg)\n {\n \tchar s[256];\n@@ -487,6 +586,11 @@ static const char short_options[] =\n #define CMD_LINE_OPT_ENABLE_JUMBO \"enable-jumbo\"\n #define CMD_LINE_OPT_HASH_ENTRY_NUM \"hash-entry-num\"\n #define CMD_LINE_OPT_PARSE_PTYPE \"parse-ptype\"\n+#define CMD_LINE_OPT_NB_RXD \"nb-rxd\"\n+#define CMD_LINE_OPT_NB_TXD \"nb-txd\"\n+#define CMD_LINE_OPT_RX_FREE_THRESH \"rx-free-thresh\"\n+#define CMD_LINE_OPT_TX_FREE_THRESH \"tx-free-thresh\"\n+#define CMD_LINE_OPT_TX_RS_THRESH \"tx-rs-thresh\"\n enum {\n \t/* long options mapped to a short option */\n \n@@ -500,6 +604,11 @@ enum {\n \tCMD_LINE_OPT_ENABLE_JUMBO_NUM,\n \tCMD_LINE_OPT_HASH_ENTRY_NUM_NUM,\n \tCMD_LINE_OPT_PARSE_PTYPE_NUM,\n+\tCMD_LINE_OPT_NB_RXD_NUM,\n+\tCMD_LINE_OPT_NB_TXD_NUM,\n+\tCMD_LINE_OPT_RX_FREE_THRESH_NUM,\n+\tCMD_LINE_OPT_TX_FREE_THRESH_NUM,\n+\tCMD_LINE_OPT_TX_RS_THRESH_NUM,\n };\n \n static const struct option lgopts[] = {\n@@ -510,6 +619,11 @@ static const struct option lgopts[] = {\n \t{CMD_LINE_OPT_ENABLE_JUMBO, 0, 0, CMD_LINE_OPT_ENABLE_JUMBO_NUM},\n \t{CMD_LINE_OPT_HASH_ENTRY_NUM, 1, 0, CMD_LINE_OPT_HASH_ENTRY_NUM_NUM},\n \t{CMD_LINE_OPT_PARSE_PTYPE, 0, 0, CMD_LINE_OPT_PARSE_PTYPE_NUM},\n+\t{CMD_LINE_OPT_NB_RXD, 1, 0, CMD_LINE_OPT_NB_RXD_NUM},\n+\t{CMD_LINE_OPT_NB_TXD, 1, 0, CMD_LINE_OPT_NB_TXD_NUM},\n+\t{CMD_LINE_OPT_RX_FREE_THRESH, 1, 0, CMD_LINE_OPT_RX_FREE_THRESH_NUM},\n+\t{CMD_LINE_OPT_TX_FREE_THRESH, 1, 0, CMD_LINE_OPT_TX_FREE_THRESH_NUM},\n+\t{CMD_LINE_OPT_TX_RS_THRESH, 1, 0, CMD_LINE_OPT_TX_RS_THRESH_NUM},\n \t{NULL, 0, 0, 0}\n };\n \n@@ -554,6 +668,11 @@ parse_args(int argc, char **argv)\n \tconst char *str12 =\n \t\t\"L3FWD: LPM and EM are mutually exclusive, select only one\";\n \tconst char *str13 = \"L3FWD: LPM or EM none selected, default LPM on\";\n+\tconst char *str14 = \"L3FWD: Invalid Rx descriptors number\";\n+\tconst char *str15 = \"L3FWD: Invalid Tx descriptors number\";\n+\tconst char *str16 = \"L3FWD: Invalid Rx free threshold value\";\n+\tconst char *str17 = \"L3FWD: Invalid Tx free threshold value\";\n+\tconst char *str18 = \"L3FWD: Invalid Tx RS bit threshold value\";\n \n \twhile ((opt = getopt_long(argc, argvopt, short_options,\n \t\t\t\tlgopts, &option_index)) != EOF) {\n@@ -652,6 +771,61 @@ parse_args(int argc, char **argv)\n \t\t\tparse_ptype = 1;\n \t\t\tbreak;\n \n+\t\tcase CMD_LINE_OPT_NB_RXD_NUM:\n+\t\t\tret = parse_nb_rxd(optarg);\n+\t\t\tif (ret > 0)\n+\t\t\t\tnb_rxd = ret;\n+\t\t\telse{\n+\t\t\t\tprintf(\"%s\\n\", str14);\n+\t\t\t\tprint_usage(prgname);\n+\t\t\t\treturn -1;\n+\t\t\t}\n+\t\t\tbreak;\n+\n+\t\tcase CMD_LINE_OPT_NB_TXD_NUM:\n+\t\t\tret = parse_nb_txd(optarg);\n+\t\t\tif (ret > 0)\n+\t\t\t\tnb_txd = ret;\n+\t\t\telse{\n+\t\t\t\tprintf(\"%s\\n\", str15);\n+\t\t\t\tprint_usage(prgname);\n+\t\t\t\treturn -1;\n+\t\t\t}\n+\t\t\tbreak;\n+\n+\t\tcase CMD_LINE_OPT_RX_FREE_THRESH_NUM:\n+\t\t\tret = parse_rx_free_thresh(optarg);\n+\t\t\tif (ret > 0)\n+\t\t\t\trx_free_thresh = ret;\n+\t\t\telse{\n+\t\t\t\tprintf(\"%s\\n\", str16);\n+\t\t\t\tprint_usage(prgname);\n+\t\t\t\treturn -1;\n+\t\t\t}\n+\t\t\tbreak;\n+\n+\t\tcase CMD_LINE_OPT_TX_FREE_THRESH_NUM:\n+\t\t\tret = parse_tx_free_thresh(optarg);\n+\t\t\tif (ret > 0)\n+\t\t\t\ttx_free_thresh = ret;\n+\t\t\telse{\n+\t\t\t\tprintf(\"%s\\n\", str17);\n+\t\t\t\tprint_usage(prgname);\n+\t\t\t\treturn -1;\n+\t\t\t}\n+\t\t\tbreak;\n+\n+\t\tcase CMD_LINE_OPT_TX_RS_THRESH_NUM:\n+\t\t\tret = parse_tx_rs_thresh(optarg);\n+\t\t\tif (ret > 0)\n+\t\t\t\ttx_rs_thresh = ret;\n+\t\t\telse{\n+\t\t\t\tprintf(\"%s\\n\", str18);\n+\t\t\t\tprint_usage(prgname);\n+\t\t\t\treturn -1;\n+\t\t\t}\n+\t\t\tbreak;\n+\n \t\tdefault:\n \t\t\tprint_usage(prgname);\n \t\t\treturn -1;\n@@ -894,6 +1068,19 @@ main(int argc, char **argv)\n \n \t/* initialize all ports */\n \tfor (portid = 0; portid < nb_ports; portid++) {\n+\t\trte_eth_dev_info_get(portid, &dev_info);\n+\n+\t\tif (rx_free_thresh != RTE_PMD_PARAM_UNSET)\n+\t\t\tdev_info.default_rxconf.rx_free_thresh = rx_free_thresh;\n+\n+\t\tif (tx_free_thresh != RTE_PMD_PARAM_UNSET)\n+\t\t\tdev_info.default_txconf.tx_free_thresh = tx_free_thresh;\n+\n+\t\tif (tx_rs_thresh != RTE_PMD_PARAM_UNSET)\n+\t\t\tdev_info.default_txconf.tx_rs_thresh = tx_rs_thresh;\n+\t}\n+\n+\tfor (portid = 0; portid < nb_ports; portid++) {\n \t\t/* skip ports that are not enabled */\n \t\tif ((enabled_port_mask & (1 << portid)) == 0) {\n \t\t\tprintf(\"\\nSkipping disabled port %d\\n\", portid);\n",
    "prefixes": [
        "dpdk-dev",
        "v2"
    ]
}