get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 8504,
    "url": "https://patches.dpdk.org/api/patches/8504/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1446308653-2378-4-git-send-email-jingjing.wu@intel.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<1446308653-2378-4-git-send-email-jingjing.wu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1446308653-2378-4-git-send-email-jingjing.wu@intel.com",
    "date": "2015-10-31T16:24:13",
    "name": "[dpdk-dev,v3,3/3] testpmd: extend commands",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "1fd7a5d197c16066ae515256a2a8f91908ebde96",
    "submitter": {
        "id": 47,
        "url": "https://patches.dpdk.org/api/people/47/?format=api",
        "name": "Jingjing Wu",
        "email": "jingjing.wu@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1446308653-2378-4-git-send-email-jingjing.wu@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/8504/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/8504/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 [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 2ABCD8DB4;\n\tSat, 31 Oct 2015 17:24:31 +0100 (CET)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby dpdk.org (Postfix) with ESMTP id 02B61374D\n\tfor <dev@dpdk.org>; Sat, 31 Oct 2015 17:24:27 +0100 (CET)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby fmsmga101.fm.intel.com with ESMTP; 31 Oct 2015 09:24:27 -0700",
            "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby FMSMGA003.fm.intel.com with ESMTP; 31 Oct 2015 09:24:26 -0700",
            "from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com\n\t[10.239.29.89])\n\tby shvmail01.sh.intel.com with ESMTP id t9VGOOhJ022291;\n\tSun, 1 Nov 2015 00:24:24 +0800",
            "from shecgisg004.sh.intel.com (localhost [127.0.0.1])\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP\n\tid t9VGOL2Z002433; Sun, 1 Nov 2015 00:24:23 +0800",
            "(from wujingji@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t9VGOLL9002429; \n\tSun, 1 Nov 2015 00:24:21 +0800"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.20,224,1444719600\"; d=\"scan'208\";a=\"591631070\"",
        "From": "Jingjing Wu <jingjing.wu@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Sun,  1 Nov 2015 00:24:13 +0800",
        "Message-Id": "<1446308653-2378-4-git-send-email-jingjing.wu@intel.com>",
        "X-Mailer": "git-send-email 1.7.4.1",
        "In-Reply-To": "<1446308653-2378-1-git-send-email-jingjing.wu@intel.com>",
        "References": "<1446021688-17544-1-git-send-email-jingjing.wu@intel.com>\n\t<1446308653-2378-1-git-send-email-jingjing.wu@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v3 3/3] testpmd: extend commands",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <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": "This patch extends commands to support filtering in VFs of flow director.\n\nSigned-off-by: Jingjing Wu <jingjing.wu@intel.com>\n---\n app/test-pmd/cmdline.c                      | 41 ++++++++++++++++++++++++++---\n doc/guides/testpmd_app_ug/testpmd_funcs.rst | 15 ++++++-----\n 2 files changed, 46 insertions(+), 10 deletions(-)",
    "diff": "diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c\nindex b3c36f3..7824d5c 100644\n--- a/app/test-pmd/cmdline.c\n+++ b/app/test-pmd/cmdline.c\n@@ -631,7 +631,8 @@ static void cmd_help_long_parsed(void *parsed_result,\n \t\t\t\" flow (ipv4-other|ipv4-frag|ipv6-other|ipv6-frag)\"\n \t\t\t\" src (src_ip_address) dst (dst_ip_address)\"\n \t\t\t\" vlan (vlan_value) flexbytes (flexbytes_value)\"\n-\t\t\t\" (drop|fwd) queue (queue_id) fd_id (fd_id_value)\\n\"\n+\t\t\t\" (drop|fwd) pf|vf(vf_id) queue (queue_id)\"\n+\t\t\t\" fd_id (fd_id_value)\\n\"\n \t\t\t\"    Add/Del an IP type flow director filter.\\n\\n\"\n \n \t\t\t\"flow_director_filter (port_id) (add|del|update)\"\n@@ -639,7 +640,8 @@ static void cmd_help_long_parsed(void *parsed_result,\n \t\t\t\" src (src_ip_address) (src_port)\"\n \t\t\t\" dst (dst_ip_address) (dst_port)\"\n \t\t\t\" vlan (vlan_value) flexbytes (flexbytes_value)\"\n-\t\t\t\" (drop|fwd) queue (queue_id) fd_id (fd_id_value)\\n\"\n+\t\t\t\" (drop|fwd) pf|vf(vf_id) queue (queue_id)\"\n+\t\t\t\" fd_id (fd_id_value)\\n\"\n \t\t\t\"    Add/Del an UDP/TCP type flow director filter.\\n\\n\"\n \n \t\t\t\"flow_director_filter (port_id) (add|del|update)\"\n@@ -648,13 +650,13 @@ static void cmd_help_long_parsed(void *parsed_result,\n \t\t\t\" dst (dst_ip_address) (dst_port)\"\n \t\t\t\" tag (verification_tag) vlan (vlan_value)\"\n \t\t\t\" flexbytes (flexbytes_value) (drop|fwd)\"\n-\t\t\t\" queue (queue_id) fd_id (fd_id_value)\\n\"\n+\t\t\t\" pf|vf(vf_id) queue (queue_id) fd_id (fd_id_value)\\n\"\n \t\t\t\"    Add/Del a SCTP type flow director filter.\\n\\n\"\n \n \t\t\t\"flow_director_filter (port_id) (add|del|update)\"\n \t\t\t\" flow l2_payload ether (ethertype)\"\n \t\t\t\" flexbytes (flexbytes_value) (drop|fwd)\"\n-\t\t\t\" queue (queue_id) fd_id (fd_id_value)\\n\"\n+\t\t\t\" pf|vf(vf_id) queue (queue_id) fd_id (fd_id_value)\\n\"\n \t\t\t\"    Add/Del a l2 payload type flow director filter.\\n\\n\"\n \n \t\t\t\"flush_flow_director (port_id)\\n\"\n@@ -7744,6 +7746,7 @@ struct cmd_flow_director_result {\n \tuint16_t vlan_value;\n \tcmdline_fixed_string_t flexbytes;\n \tcmdline_fixed_string_t flexbytes_value;\n+\tcmdline_fixed_string_t pf_vf;\n \tcmdline_fixed_string_t drop;\n \tcmdline_fixed_string_t queue;\n \tuint16_t  queue_id;\n@@ -7876,6 +7879,8 @@ cmd_flow_director_filter_parsed(void *parsed_result,\n \tstruct cmd_flow_director_result *res = parsed_result;\n \tstruct rte_eth_fdir_filter entry;\n \tuint8_t flexbytes[RTE_ETH_FDIR_MAX_FLEXLEN];\n+\tchar *end;\n+\tunsigned long vf_id;\n \tint ret = 0;\n \n \tret = rte_eth_dev_filter_supported(res->port_id, RTE_ETH_FILTER_FDIR);\n@@ -8002,6 +8007,27 @@ cmd_flow_director_filter_parsed(void *parsed_result,\n \t\tentry.action.behavior = RTE_ETH_FDIR_REJECT;\n \telse\n \t\tentry.action.behavior = RTE_ETH_FDIR_ACCEPT;\n+\n+\tif (!strcmp(res->pf_vf, \"pf\"))\n+\t\tentry.input.flow_ext.is_vf = 0;\n+\telse if (!strncmp(res->pf_vf, \"vf\", 2)) {\n+\t\tstruct rte_eth_dev_info dev_info;\n+\n+\t\tmemset(&dev_info, 0, sizeof(dev_info));\n+\t\trte_eth_dev_info_get(res->port_id, &dev_info);\n+\t\terrno = 0;\n+\t\tvf_id = strtoul(res->pf_vf + 2, &end, 10);\n+\t\tif (errno != 0 || *end != '\\0' || vf_id >= dev_info.max_vfs) {\n+\t\t\tprintf(\"invalid parameter %s.\\n\", res->pf_vf);\n+\t\t\treturn;\n+\t\t}\n+\t\tentry.input.flow_ext.is_vf = 1;\n+\t\tentry.input.flow_ext.dst_id = (uint16_t)vf_id;\n+\t} else {\n+\t\tprintf(\"invalid parameter %s.\\n\", res->pf_vf);\n+\t\treturn;\n+\t}\n+\n \t/* set to report FD ID by default */\n \tentry.action.report_status = RTE_ETH_FDIR_REPORT_ID;\n \tentry.action.rx_queue = res->queue_id;\n@@ -8081,6 +8107,9 @@ cmdline_parse_token_string_t cmd_flow_director_flexbytes_value =\n cmdline_parse_token_string_t cmd_flow_director_drop =\n \tTOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,\n \t\t\t\t drop, \"drop#fwd\");\n+cmdline_parse_token_string_t cmd_flow_director_pf_vf =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,\n+\t\t\t      pf_vf, NULL);\n cmdline_parse_token_string_t cmd_flow_director_queue =\n \tTOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,\n \t\t\t\t queue, \"queue\");\n@@ -8146,6 +8175,7 @@ cmdline_parse_inst_t cmd_add_del_ip_flow_director = {\n \t\t(void *)&cmd_flow_director_flexbytes,\n \t\t(void *)&cmd_flow_director_flexbytes_value,\n \t\t(void *)&cmd_flow_director_drop,\n+\t\t(void *)&cmd_flow_director_pf_vf,\n \t\t(void *)&cmd_flow_director_queue,\n \t\t(void *)&cmd_flow_director_queue_id,\n \t\t(void *)&cmd_flow_director_fd_id,\n@@ -8177,6 +8207,7 @@ cmdline_parse_inst_t cmd_add_del_udp_flow_director = {\n \t\t(void *)&cmd_flow_director_flexbytes,\n \t\t(void *)&cmd_flow_director_flexbytes_value,\n \t\t(void *)&cmd_flow_director_drop,\n+\t\t(void *)&cmd_flow_director_pf_vf,\n \t\t(void *)&cmd_flow_director_queue,\n \t\t(void *)&cmd_flow_director_queue_id,\n \t\t(void *)&cmd_flow_director_fd_id,\n@@ -8210,6 +8241,7 @@ cmdline_parse_inst_t cmd_add_del_sctp_flow_director = {\n \t\t(void *)&cmd_flow_director_flexbytes,\n \t\t(void *)&cmd_flow_director_flexbytes_value,\n \t\t(void *)&cmd_flow_director_drop,\n+\t\t(void *)&cmd_flow_director_pf_vf,\n \t\t(void *)&cmd_flow_director_queue,\n \t\t(void *)&cmd_flow_director_queue_id,\n \t\t(void *)&cmd_flow_director_fd_id,\n@@ -8235,6 +8267,7 @@ cmdline_parse_inst_t cmd_add_del_l2_flow_director = {\n \t\t(void *)&cmd_flow_director_flexbytes,\n \t\t(void *)&cmd_flow_director_flexbytes_value,\n \t\t(void *)&cmd_flow_director_drop,\n+\t\t(void *)&cmd_flow_director_pf_vf,\n \t\t(void *)&cmd_flow_director_queue,\n \t\t(void *)&cmd_flow_director_queue_id,\n \t\t(void *)&cmd_flow_director_fd_id,\ndiff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst\nindex 71d831b..eae5249 100644\n--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst\n+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst\n@@ -1644,14 +1644,16 @@ Different NICs may have different capabilities, command show port fdir (port_id)\n                         flow (ipv4-other|ipv4-frag|ipv6-other|ipv6-frag)\n                         src (src_ip_address) dst (dst_ip_address) \\\n                         vlan (vlan_value) flexbytes (flexbytes_value) \\\n-                        (drop|fwd) queue (queue_id) fd_id (fd_id_value)\n+                        (drop|fwd) pf|vf(vf_id) queue (queue_id) \\\n+                        fd_id (fd_id_value)\n \n    flow_director_filter (port_id) (add|del|update) \\\n                         flow (ipv4-tcp|ipv4-udp|ipv6-tcp|ipv6-udp) \\\n                         src (src_ip_address) (src_port) \\\n                         dst (dst_ip_address) (dst_port) \\\n                         vlan (vlan_value) flexbytes (flexbytes_value) \\\n-                        (drop|fwd) queue (queue_id) fd_id (fd_id_value)\n+                        (drop|fwd) queue pf|vf(vf_id) (queue_id) \\\n+                        fd_id (fd_id_value)\n \n    flow_director_filter (port_id) (add|del|update) \\\n                         flow (ipv4-sctp|ipv6-sctp) \\\n@@ -1659,21 +1661,22 @@ Different NICs may have different capabilities, command show port fdir (port_id)\n                         dst (dst_ip_address) (dst_port)\n                         tag (verification_tag) vlan (vlan_value) \\\n                         flexbytes (flexbytes_value) (drop|fwd) \\\n-                        queue (queue_id) fd_id (fd_id_value)\n+                        pf|vf(vf_id) queue (queue_id) fd_id (fd_id_value)\n \n    flow_director_filter (port_id) (add|del|update) flow l2_payload \\\n                         ether (ethertype) flexbytes (flexbytes_value) \\\n-                        (drop|fwd) queue (queue_id) fd_id (fd_id_value)\n+                        (drop|fwd) pf|vf(vf_id) queue (queue_id)\n+                        fd_id (fd_id_value)\n \n For example, to add an ipv4-udp flow type filter::\n \n    testpmd> flow_director_filter 0 add flow ipv4-udp src 2.2.2.3 32 \\\n-            dst 2.2.2.5 33 vlan 0x1 flexbytes (0x88,0x48) fwd queue 1 fd_id 1\n+            dst 2.2.2.5 33 vlan 0x1 flexbytes (0x88,0x48) fwd pf queue 1 fd_id 1\n \n For example, add an ipv4-other flow type filter::\n \n    testpmd> flow_director_filter 0 add flow ipv4-other src 2.2.2.3 \\\n-             dst 2.2.2.5 vlan 0x1 flexbytes (0x88,0x48) fwd queue 1 fd_id 1\n+             dst 2.2.2.5 vlan 0x1 flexbytes (0x88,0x48) fwd pf queue 1 fd_id 1\n \n flush_flow_director\n ~~~~~~~~~~~~~~~~~~~\n",
    "prefixes": [
        "dpdk-dev",
        "v3",
        "3/3"
    ]
}