Show a patch.

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

{
    "id": 147,
    "url": "https://patches.dpdk.org/api/patches/147/",
    "web_url": "https://patches.dpdk.org/patch/147/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/",
        "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"
    },
    "msgid": "<1407813127-10991-5-git-send-email-jijiang.liu@intel.com>",
    "date": "2014-08-12T03:12:05",
    "name": "[dpdk-dev,4/6] app/testpmd:test VxLAN cloud filter API",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "970c8d7a30de98873e48f85c9a70168ba996f8d6",
    "submitter": {
        "id": 52,
        "url": "https://patches.dpdk.org/api/people/52/",
        "name": "Jijiang Liu",
        "email": "jijiang.liu@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/patch/147/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/147/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/147/checks/",
    "tags": {},
    "headers": {
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Date": "Tue, 12 Aug 2014 11:12:05 +0800",
        "In-Reply-To": "<1407813127-10991-1-git-send-email-jijiang.liu@intel.com>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "X-BeenThere": "dev@dpdk.org",
        "References": "<1407813127-10991-1-git-send-email-jijiang.liu@intel.com>",
        "X-Mailer": "git-send-email 1.7.0.7",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "To": "dev@dpdk.org",
        "Received": [
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby dpdk.org (Postfix) with ESMTP id EC416B3A7\n\tfor <dev@dpdk.org>; Tue, 12 Aug 2014 05:09:36 +0200 (CEST)",
            "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby orsmga102.jf.intel.com with ESMTP; 11 Aug 2014 20:06:39 -0700",
            "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby orsmga001.jf.intel.com with ESMTP; 11 Aug 2014 20:12:29 -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 s7C3CRJB012573;\n\tTue, 12 Aug 2014 11:12:27 +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 s7C3CO21011131; Tue, 12 Aug 2014 11:12:26 +0800",
            "(from jijiangl@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id s7C3CO3t011127; \n\tTue, 12 Aug 2014 11:12:24 +0800"
        ],
        "From": "Jijiang Liu <jijiang.liu@intel.com>",
        "Precedence": "list",
        "X-ExtLoop1": "1",
        "Message-Id": "<1407813127-10991-5-git-send-email-jijiang.liu@intel.com>",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "Subject": "[dpdk-dev] [PATCH 4/6]app/testpmd:test VxLAN cloud filter API",
        "X-List-Received-Date": "Tue, 12 Aug 2014 03:09:37 -0000",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "Return-Path": "<jijiangl@shecgisg004.sh.intel.com>",
        "X-IronPort-AV": "E=Sophos;i=\"5.01,846,1400050800\"; d=\"scan'208\";a=\"557194128\"",
        "List-Post": "<mailto:dev@dpdk.org>",
        "X-Mailman-Version": "2.1.15"
    },
    "content": "Add commands to test VxLAN cloud filter API.\n\nSigned-off-by: jijiangl <jijiang.liu@intel.com>\nAcked-by: Helin Zhang <helin.zhang@intel.com>\nAcked-by: Jingjing Wu <jingjing.wu@intel.com>\nAcked-by: Jing Chen <jing.d.chen@intel.com>\n---\n app/test-pmd/cmdline.c |  142 ++++++++++++++++++++++++++++++++++++++++++++++++\n 1 files changed, 142 insertions(+), 0 deletions(-)",
    "diff": "diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c\nindex 67cf63e..a5adac0 100644\n--- a/app/test-pmd/cmdline.c\n+++ b/app/test-pmd/cmdline.c\n@@ -285,6 +285,14 @@ static void cmd_help_long_parsed(void *parsed_result,\n \t\t\t\"    Set the outer VLAN TPID for Packet Filtering on\"\n \t\t\t\" a port\\n\\n\"\n \n+\t\t\t\"cloud_filter add (port_id) (outer_mac) (inner_mac) (ip_addr) \"\n+\t\t\t\"(inner_vlan) (tunnel_type) (filter_type) (tenant_id) (queue_id)\\n\"\n+\t\t\t\"   add a cloud fiter of a port.\\n\\n\"\n+\n+\t\t\t\"cloud_filter rm (port_id) (outer_mac) (inner_mac) (ip_addr) \"\n+\t\t\t\"(inner_vlan) (tunnel_type) (filter_type) (tenant_id) (queue_id)\\n\"\n+\t\t\t\"   remove a cloud fiter of a port.\\n\\n\"\n+\n \t\t\t\"rx_vxlan_port add (udp_port) (port_id)\\n\"\n \t\t\t\"    Add an UDP port for VxLAN packet filter on a port\\n\\n\"\n \n@@ -6123,6 +6131,139 @@ cmdline_parse_inst_t cmd_vf_rate_limit = {\n \t},\n };\n \n+/* *** ADD CLOUD FILTER OF A PORT *** */\n+struct cmd_cloud_filter_result {\n+\tcmdline_fixed_string_t cmd;\n+\tcmdline_fixed_string_t what;\n+\tuint8_t port_id;\n+\tstruct ether_addr outer_mac;\n+\tstruct ether_addr inner_mac;\n+\tcmdline_ipaddr_t ip_value;\n+\tuint16_t inner_vlan;\n+\tcmdline_fixed_string_t tunnel_type;\n+\tcmdline_fixed_string_t filter_type;\n+\tuint32_t tenant_id;\n+\tuint16_t queue_num;\n+};\n+\n+static void\n+cmd_cloud_filter_parsed(void *parsed_result,\n+\t\t\t  __attribute__((unused)) struct cmdline *cl,\n+\t\t\t  __attribute__((unused)) void *data)\n+{\n+\tstruct cmd_cloud_filter_result *res = parsed_result;\n+\tstruct rte_eth_cloud_filter_conf cloud_filter_conf;\n+\n+\tcloud_filter_conf.outer_mac = &res->outer_mac;\n+\tcloud_filter_conf.inner_mac = &res->inner_mac;\n+\tcloud_filter_conf.inner_vlan = res->inner_vlan;\n+\n+\tif (res->ip_value.family == AF_INET) {\n+\t\tcloud_filter_conf.ip_addr.ipv4_addr =\n+\t\t\tres->ip_value.addr.ipv4.s_addr;\n+\t\tcloud_filter_conf.ip_type = RTE_CLOUD_IPTYPE_IPV4;\n+\t} else {\n+\t\tmemcpy(&(cloud_filter_conf.ip_addr.ipv6_addr),\n+\t\t\t&(res->ip_value.addr.ipv6),\n+\t\t\tsizeof(struct in6_addr));\n+\t\tcloud_filter_conf.ip_type = RTE_CLOUD_IPTYPE_IPV6;\n+\t}\n+\n+\tif (!strcmp(res->filter_type, \"imac-ivlan\"))\n+\t\tcloud_filter_conf.filter_type = RTE_CLOUD_FILTER_IMAC_IVLAN;\n+\telse if (!strcmp(res->filter_type, \"imac-ivlan-tenid\"))\n+\t\tcloud_filter_conf.filter_type =\n+\t\t\tRTE_CLOUD_FILTER_IMAC_IVLAN_TENID;\n+\telse if (!strcmp(res->filter_type, \"imac-tenid\"))\n+\t\tcloud_filter_conf.filter_type = RTE_CLOUD_FILTER_IMAC_TENID;\n+\telse if (!strcmp(res->filter_type, \"imac\"))\n+\t\tcloud_filter_conf.filter_type = RTE_CLOUD_FILTER_IMAC;\n+\telse if (!strcmp(res->filter_type, \"omac-imac-tenid\"))\n+\t\tcloud_filter_conf.filter_type =\n+\t\t\tRTE_CLOUD_FILTER_OMAC_TENID_IMAC;\n+\telse {\n+\t\tprintf(\"The filter type is not supported\");\n+\t\treturn;\n+\t}\n+\n+\tcloud_filter_conf.to_queue = RTE_CLOUD_FLAGS_TO_QUEUE;\n+\n+\tif (!strcmp(res->tunnel_type, \"vxlan\"))\n+\t\tcloud_filter_conf.tunnel_type = RTE_TUNNEL_TYPE_VXLAN;\n+\telse {\n+\t\tprintf(\"Only VxLAN is supported now.\\n\");\n+\t\treturn;\n+\t}\n+\n+\tcloud_filter_conf.tenant_id = res->tenant_id;\n+\tcloud_filter_conf.queue_id = res->queue_num;\n+\tif (!strcmp(res->what, \"add\"))\n+\t\trte_eth_dev_cloud_filter_set(res->port_id,\n+\t\t\t\t\t&cloud_filter_conf, 1, 1);\n+\telse\n+\t\trte_eth_dev_cloud_filter_set(res->port_id,\n+\t\t\t\t\t&cloud_filter_conf, 1, 0);\n+}\n+cmdline_parse_token_string_t cmd_cloud_filter_cmd =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_cloud_filter_result,\n+\tcmd, \"cloud_filter\");\n+cmdline_parse_token_string_t cmd_cloud_filter_what =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_cloud_filter_result,\n+\twhat, \"add#rm\");\n+cmdline_parse_token_num_t cmd_cloud_filter_port_id =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_cloud_filter_result,\n+\tport_id, UINT8);\n+cmdline_parse_token_etheraddr_t cmd_cloud_filter_outer_mac =\n+\tTOKEN_ETHERADDR_INITIALIZER(struct cmd_cloud_filter_result,\n+\touter_mac);\n+cmdline_parse_token_etheraddr_t cmd_cloud_filter_inner_mac =\n+\tTOKEN_ETHERADDR_INITIALIZER(struct cmd_cloud_filter_result,\n+\tinner_mac);\n+cmdline_parse_token_num_t cmd_cloud_filter_innner_vlan =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_cloud_filter_result,\n+\tinner_vlan, UINT16);\n+cmdline_parse_token_ipaddr_t cmd_cloud_filter_ip_value =\n+\tTOKEN_IPADDR_INITIALIZER(struct cmd_cloud_filter_result,\n+\tip_value);\n+cmdline_parse_token_string_t cmd_cloud_filter_tunnel_type =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_cloud_filter_result,\n+\ttunnel_type, \"vxlan\");\n+\n+cmdline_parse_token_string_t cmd_cloud_filter_filter_type =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_cloud_filter_result,\n+\tfilter_type, \"imac-ivlan#imac-ivlan-tenid#imac-tenid#\"\n+\t\t\"imac#omac-imac-tenid\");\n+cmdline_parse_token_num_t cmd_cloud_filter_tenant_id =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_cloud_filter_result,\n+\ttenant_id, UINT32);\n+cmdline_parse_token_num_t cmd_cloud_filter_queue_num =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_cloud_filter_result,\n+\tqueue_num, UINT16);\n+\n+cmdline_parse_inst_t cmd_cloud_filter = {\n+\t.f = cmd_cloud_filter_parsed,\n+\t.data = (void *)0,\n+\t.help_str = \"add/rm cloud filter of a port: \"\n+\t\t\t\"cloud_filter add port_id outer_mac inner_mac ip \"\n+\t\t\t\"inner_vlan tunnel_type(vxlan) filter_type \"\n+\t\t\t\"(imac-ivlan|imac-ivlan-tenid|imac-tenid|imac|omac-imac-tenid) \"\n+\t\t\t\"tenant_id queue_num\",\n+\t.tokens = {\n+\t\t(void *)&cmd_cloud_filter_cmd,\n+\t\t(void *)&cmd_cloud_filter_what,\n+\t\t(void *)&cmd_cloud_filter_port_id,\n+\t\t(void *)&cmd_cloud_filter_outer_mac,\n+\t\t(void *)&cmd_cloud_filter_inner_mac,\n+\t\t(void *)&cmd_cloud_filter_ip_value,\n+\t\t(void *)&cmd_cloud_filter_innner_vlan,\n+\t\t(void *)&cmd_cloud_filter_tunnel_type,\n+\t\t(void *)&cmd_cloud_filter_filter_type,\n+\t\t(void *)&cmd_cloud_filter_tenant_id,\n+\t\t(void *)&cmd_cloud_filter_queue_num,\n+\t\tNULL,\n+\t},\n+};\n+\n /* *** CONFIGURE TUNNEL UDP PORT *** */\n struct cmd_tunnel_udp_config {\n \tcmdline_fixed_string_t cmd;\n@@ -7475,6 +7616,7 @@ cmdline_parse_ctx_t main_ctx[] = {\n \t(cmdline_parse_inst_t *)&cmd_vf_rxvlan_filter,\n \t(cmdline_parse_inst_t *)&cmd_queue_rate_limit,\n \t(cmdline_parse_inst_t *)&cmd_vf_rate_limit,\n+\t(cmdline_parse_inst_t *)&cmd_cloud_filter,\n \t(cmdline_parse_inst_t *)&cmd_tunnel_udp_config,\n \t(cmdline_parse_inst_t *)&cmd_set_mirror_mask,\n \t(cmdline_parse_inst_t *)&cmd_set_mirror_link,\n",
    "prefixes": [
        "dpdk-dev",
        "4/6"
    ]
}