Show a patch.

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

{
    "id": 366,
    "url": "http://patches.dpdk.org/api/patches/366/",
    "web_url": "http://patches.dpdk.org/patch/366/",
    "project": {
        "id": 1,
        "url": "http://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": "<1410503639-10753-7-git-send-email-jijiang.liu@intel.com>",
    "date": "2014-09-12T06:33:57",
    "name": "[dpdk-dev,v3,6/8] app/testpmd:test VxLAN packet filter API",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "e4ae24df79d13c3bfa0188e117ea71143eea4e4d",
    "submitter": {
        "id": 52,
        "url": "http://patches.dpdk.org/api/people/52/",
        "name": "Jijiang Liu",
        "email": "jijiang.liu@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/patch/366/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/366/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/366/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "References": "<1410503639-10753-1-git-send-email-jijiang.liu@intel.com>",
        "X-Mailman-Version": "2.1.15",
        "X-IronPort-AV": "E=Sophos;i=\"4.97,862,1389772800\"; d=\"scan'208\";a=\"385121534\"",
        "Date": "Fri, 12 Sep 2014 14:33:57 +0800",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "X-BeenThere": "dev@dpdk.org",
        "Message-Id": "<1410503639-10753-7-git-send-email-jijiang.liu@intel.com>",
        "X-Original-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id B2280B399;\n\tFri, 12 Sep 2014 08:29:05 +0200 (CEST)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby dpdk.org (Postfix) with ESMTP id A8326B399\n\tfor <dev@dpdk.org>; Fri, 12 Sep 2014 08:29:03 +0200 (CEST)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby fmsmga103.fm.intel.com with ESMTP; 11 Sep 2014 23:25:40 -0700",
            "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby FMSMGA003.fm.intel.com with ESMTP; 11 Sep 2014 23:29:08 -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 s8C6YG2O005989;\n\tFri, 12 Sep 2014 14:34:16 +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 s8C6YE4n010830; Fri, 12 Sep 2014 14:34:16 +0800",
            "(from jijiangl@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id s8C6YElf010826; \n\tFri, 12 Sep 2014 14:34:14 +0800"
        ],
        "List-Post": "<mailto:dev@dpdk.org>",
        "Subject": "[dpdk-dev] [PATCH v3 6/8]app/testpmd:test VxLAN packet filter API",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "X-Mailer": "git-send-email 1.7.4.1",
        "Precedence": "list",
        "From": "Jijiang Liu <jijiang.liu@intel.com>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "X-ExtLoop1": "1",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "Delivered-To": "patchwork@dpdk.org",
        "In-Reply-To": "<1410503639-10753-1-git-send-email-jijiang.liu@intel.com>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "To": "dev@dpdk.org",
        "Errors-To": "dev-bounces@dpdk.org"
    },
    "content": "Add tunnel_filter command in testpmd to test VxLAN packet filter API.\n\nSigned-off-by: Jijiang Liu <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---\n app/test-pmd/cmdline.c |  153 +++++++++++++++++++++++++++++++++++++++++++++++-\n 1 files changed, 152 insertions(+), 1 deletions(-)",
    "diff": "diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c\nindex de910db..71671b7 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\"tunnel_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 tunnel filter of a port.\\n\\n\"\n+\n+\t\t\t\"tunnel_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 tunnel filter 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@@ -6222,6 +6230,148 @@ cmdline_parse_inst_t cmd_vf_rate_limit = {\n \t},\n };\n \n+/* *** ADD TUNNEL FILTER OF A PORT *** */\n+struct cmd_tunnel_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_tunnel_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_tunnel_filter_result *res = parsed_result;\n+\tstruct rte_eth_tunnel_filter_conf tunnel_filter_conf;\n+\tint ret = 0;\n+\n+\ttunnel_filter_conf.outer_mac = &res->outer_mac;\n+\ttunnel_filter_conf.inner_mac = &res->inner_mac;\n+\ttunnel_filter_conf.inner_vlan = res->inner_vlan;\n+\n+\tif (res->ip_value.family == AF_INET) {\n+\t\ttunnel_filter_conf.ip_addr.ipv4_addr =\n+\t\t\tres->ip_value.addr.ipv4.s_addr;\n+\t\ttunnel_filter_conf.ip_type = RTE_TUNNEL_IPTYPE_IPV4;\n+\t} else {\n+\t\tmemcpy(&(tunnel_filter_conf.ip_addr.ipv6_addr),\n+\t\t\t&(res->ip_value.addr.ipv6),\n+\t\t\tsizeof(struct in6_addr));\n+\t\ttunnel_filter_conf.ip_type = RTE_TUNNEL_IPTYPE_IPV6;\n+\t}\n+\n+\tif (!strcmp(res->filter_type, \"imac-ivlan\"))\n+\t\ttunnel_filter_conf.filter_type = RTE_TUNNEL_FILTER_IMAC_IVLAN;\n+\telse if (!strcmp(res->filter_type, \"imac-ivlan-tenid\"))\n+\t\ttunnel_filter_conf.filter_type =\n+\t\t\tRTE_TUNNEL_FILTER_IMAC_IVLAN_TENID;\n+\telse if (!strcmp(res->filter_type, \"imac-tenid\"))\n+\t\ttunnel_filter_conf.filter_type = RTE_TUNNEL_FILTER_IMAC_TENID;\n+\telse if (!strcmp(res->filter_type, \"imac\"))\n+\t\ttunnel_filter_conf.filter_type = RTE_TUNNEL_FILTER_IMAC;\n+\telse if (!strcmp(res->filter_type, \"omac-imac-tenid\"))\n+\t\ttunnel_filter_conf.filter_type =\n+\t\t\tRTE_TUNNEL_FILTER_OMAC_TENID_IMAC;\n+\telse {\n+\t\tprintf(\"The filter type is not supported\");\n+\t\treturn;\n+\t}\n+\n+\ttunnel_filter_conf.to_queue = RTE_TUNNEL_FLAGS_TO_QUEUE;\n+\n+\tif (!strcmp(res->tunnel_type, \"vxlan\"))\n+\t\ttunnel_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+\ttunnel_filter_conf.tenant_id = res->tenant_id;\n+\ttunnel_filter_conf.queue_id = res->queue_num;\n+\tif (!strcmp(res->what, \"add\"))\n+\t\tret = rte_eth_dev_filter_ctrl(res->port_id,\n+\t\t\t\t\tRTE_ETH_FILTER_TUNNEL,\n+\t\t\t\t\tRTE_ETH_FILTER_OP_ADD,\n+\t\t\t\t\t&tunnel_filter_conf);\n+\telse\n+\t\tret = rte_eth_dev_filter_ctrl(res->port_id,\n+\t\t\t\t\tRTE_ETH_FILTER_TUNNEL,\n+\t\t\t\t\tRTE_ETH_FILTER_OP_DELETE,\n+\t\t\t\t\t&tunnel_filter_conf);\n+\tif (ret < 0)\n+\t\tprintf(\"cmd_tunnel_filter_parsed error: (%s)\\n\",\n+\t\t\t\tstrerror(-ret));\n+\n+}\n+cmdline_parse_token_string_t cmd_tunnel_filter_cmd =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_tunnel_filter_result,\n+\tcmd, \"tunnel_filter\");\n+cmdline_parse_token_string_t cmd_tunnel_filter_what =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_tunnel_filter_result,\n+\twhat, \"add#rm\");\n+cmdline_parse_token_num_t cmd_tunnel_filter_port_id =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_tunnel_filter_result,\n+\tport_id, UINT8);\n+cmdline_parse_token_etheraddr_t cmd_tunnel_filter_outer_mac =\n+\tTOKEN_ETHERADDR_INITIALIZER(struct cmd_tunnel_filter_result,\n+\touter_mac);\n+cmdline_parse_token_etheraddr_t cmd_tunnel_filter_inner_mac =\n+\tTOKEN_ETHERADDR_INITIALIZER(struct cmd_tunnel_filter_result,\n+\tinner_mac);\n+cmdline_parse_token_num_t cmd_tunnel_filter_innner_vlan =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_tunnel_filter_result,\n+\tinner_vlan, UINT16);\n+cmdline_parse_token_ipaddr_t cmd_tunnel_filter_ip_value =\n+\tTOKEN_IPADDR_INITIALIZER(struct cmd_tunnel_filter_result,\n+\tip_value);\n+cmdline_parse_token_string_t cmd_tunnel_filter_tunnel_type =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_tunnel_filter_result,\n+\ttunnel_type, \"vxlan\");\n+\n+cmdline_parse_token_string_t cmd_tunnel_filter_filter_type =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_tunnel_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_tunnel_filter_tenant_id =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_tunnel_filter_result,\n+\ttenant_id, UINT32);\n+cmdline_parse_token_num_t cmd_tunnel_filter_queue_num =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_tunnel_filter_result,\n+\tqueue_num, UINT16);\n+\n+cmdline_parse_inst_t cmd_tunnel_filter = {\n+\t.f = cmd_tunnel_filter_parsed,\n+\t.data = (void *)0,\n+\t.help_str = \"add/rm tunnel filter of a port: \"\n+\t\t\t\"tunnel_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_tunnel_filter_cmd,\n+\t\t(void *)&cmd_tunnel_filter_what,\n+\t\t(void *)&cmd_tunnel_filter_port_id,\n+\t\t(void *)&cmd_tunnel_filter_outer_mac,\n+\t\t(void *)&cmd_tunnel_filter_inner_mac,\n+\t\t(void *)&cmd_tunnel_filter_ip_value,\n+\t\t(void *)&cmd_tunnel_filter_innner_vlan,\n+\t\t(void *)&cmd_tunnel_filter_tunnel_type,\n+\t\t(void *)&cmd_tunnel_filter_filter_type,\n+\t\t(void *)&cmd_tunnel_filter_tenant_id,\n+\t\t(void *)&cmd_tunnel_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@@ -6269,7 +6419,7 @@ cmdline_parse_token_num_t cmd_tunnel_udp_config_port_id =\n cmdline_parse_inst_t cmd_tunnel_udp_config = {\n \t.f = cmd_tunnel_udp_config_parsed,\n \t.data = (void *)0,\n-\t.help_str = \"add/rm an tunneling UDP port filter: \"\n+\t.help_str = \"add/rm an UDP tunneling port filter: \"\n \t\t\t\"rx_vxlan_port add udp_port port_id\",\n \t.tokens = {\n \t\t(void *)&cmd_tunnel_udp_config_cmd,\n@@ -7575,6 +7725,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_tunnel_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",
        "v3",
        "6/8"
    ]
}