get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 29220,
    "url": "http://patches.dpdk.org/api/patches/29220/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1506565888-194214-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": "<1506565888-194214-1-git-send-email-xiaoyun.li@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1506565888-194214-1-git-send-email-xiaoyun.li@intel.com",
    "date": "2017-09-28T02:31:28",
    "name": "[dpdk-dev] examples/l3fwd: pass flow arguments when starting l3fwd",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "9b916ddb8379914f6d9902da6a685633ae13af59",
    "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/1506565888-194214-1-git-send-email-xiaoyun.li@intel.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/29220/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/29220/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 E457A2B99;\n\tThu, 28 Sep 2017 04:33:40 +0200 (CEST)",
            "from mga06.intel.com (mga06.intel.com [134.134.136.31])\n\tby dpdk.org (Postfix) with ESMTP id 259EDDD2\n\tfor <dev@dpdk.org>; Thu, 28 Sep 2017 04:33:38 +0200 (CEST)",
            "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby orsmga104.jf.intel.com with ESMTP; 27 Sep 2017 19:33:38 -0700",
            "from dpdk-lixiaoyun.sh.intel.com ([10.67.111.93])\n\tby orsmga001.jf.intel.com with ESMTP; 27 Sep 2017 19:33:36 -0700"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos; i=\"5.42,447,1500966000\"; d=\"scan'208\";\n\ta=\"1176522216\"",
        "From": "Xiaoyun Li <xiaoyun.li@intel.com>",
        "To": "jingjing.wu@intel.com",
        "Cc": "dev@dpdk.org,\n\tXiaoyun Li <xiaoyun.li@intel.com>",
        "Date": "Thu, 28 Sep 2017 10:31:28 +0800",
        "Message-Id": "<1506565888-194214-1-git-send-email-xiaoyun.li@intel.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "Subject": "[dpdk-dev] [PATCH] examples/l3fwd: pass flow arguments when\n\tstarting l3fwd",
        "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": "When the number of free descriptors goes below the LRXQTRESH, an immediate\ninterrupt is triggered. And lots of interrupts cause performance drop. This\npatch enables to pass flow arguments when starting l3fwd example.\n\nSigned-off-by: Xiaoyun Li <xiaoyun.li@intel.com>\n---\n examples/l3fwd/main.c | 191 +++++++++++++++++++++++++++++++++++++++++++++++++-\n 1 file changed, 189 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c\nindex 81995fd..1a265a8 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 Tx free threshold\\n\"\n+\t\t\"  --tx-free-thresh: Set value of Rx 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, 16);\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"
    ]
}