get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 8117,
    "url": "https://patches.dpdk.org/api/patches/8117/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1446021688-17544-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": "<1446021688-17544-4-git-send-email-jingjing.wu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1446021688-17544-4-git-send-email-jingjing.wu@intel.com",
    "date": "2015-10-28T08:41:27",
    "name": "[dpdk-dev,v2,3/4] testpmd: extend commands",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "8ab6bd4e8ae11dcc5d4a0cfe3bb144aad9a0d63d",
    "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/1446021688-17544-4-git-send-email-jingjing.wu@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/8117/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/8117/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 1885C8DAC;\n\tWed, 28 Oct 2015 09:41:45 +0100 (CET)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id 144EC8DAC\n\tfor <dev@dpdk.org>; Wed, 28 Oct 2015 09:41:42 +0100 (CET)",
            "from orsmga003.jf.intel.com ([10.7.209.27])\n\tby fmsmga102.fm.intel.com with ESMTP; 28 Oct 2015 01:41:42 -0700",
            "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby orsmga003.jf.intel.com with ESMTP; 28 Oct 2015 01:41:41 -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 t9S8fd5A003731;\n\tWed, 28 Oct 2015 16:41:39 +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 t9S8fZN5017934; Wed, 28 Oct 2015 16:41:37 +0800",
            "(from wujingji@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t9S8fZmq017930; \n\tWed, 28 Oct 2015 16:41:35 +0800"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.20,209,1444719600\"; d=\"scan'208\";a=\"673371168\"",
        "From": "Jingjing Wu <jingjing.wu@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Wed, 28 Oct 2015 16:41:27 +0800",
        "Message-Id": "<1446021688-17544-4-git-send-email-jingjing.wu@intel.com>",
        "X-Mailer": "git-send-email 1.7.4.1",
        "In-Reply-To": "<1446021688-17544-1-git-send-email-jingjing.wu@intel.com>",
        "References": "<1442893533-32546-1-git-send-email-jingjing.wu@intel.com>\n\t<1446021688-17544-1-git-send-email-jingjing.wu@intel.com>",
        "Cc": "yulong.pei@intel.com",
        "Subject": "[dpdk-dev] [PATCH v2 3/4] 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 1 file changed, 37 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c\nindex 0f8f48f..22476f5 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@@ -7742,6 +7744,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@@ -7848,6 +7851,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@@ -7941,6 +7946,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@@ -8020,6 +8046,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@@ -8052,6 +8081,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@@ -8081,6 +8111,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@@ -8112,6 +8143,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@@ -8135,6 +8167,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,\n",
    "prefixes": [
        "dpdk-dev",
        "v2",
        "3/4"
    ]
}