Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/225/?format=api
https://patches.dpdk.org/api/patches/225/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1409038294-21693-6-git-send-email-jijiang.liu@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": "<1409038294-21693-6-git-send-email-jijiang.liu@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1409038294-21693-6-git-send-email-jijiang.liu@intel.com", "date": "2014-08-26T07:31:32", "name": "[dpdk-dev,v2,5/7] ]app/testpmd:test VxLAN packet filter API", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "34ea0a9e0661d4321f8d4870bd6f530cca79a2fb", "submitter": { "id": 52, "url": "https://patches.dpdk.org/api/people/52/?format=api", "name": "Jijiang Liu", "email": "jijiang.liu@intel.com" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dpdk/patch/1409038294-21693-6-git-send-email-jijiang.liu@intel.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/225/comments/", "check": "pending", "checks": "https://patches.dpdk.org/api/patches/225/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<jijiangl@shecgisg004.sh.intel.com>", "Received": [ "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby dpdk.org (Postfix) with ESMTP id C449AB37E\n\tfor <dev@dpdk.org>; Tue, 26 Aug 2014 09:28:07 +0200 (CEST)", "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby orsmga101.jf.intel.com with ESMTP; 26 Aug 2014 00:31:54 -0700", "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby orsmga002.jf.intel.com with ESMTP; 26 Aug 2014 00:31:53 -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 s7Q7VpMQ027270;\n\tTue, 26 Aug 2014 15:31:51 +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 s7Q7VliV021841; Tue, 26 Aug 2014 15:31:49 +0800", "(from jijiangl@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id s7Q7Vlgq021837; \n\tTue, 26 Aug 2014 15:31:47 +0800" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.04,402,1406617200\"; d=\"scan'208\";a=\"593328812\"", "From": "Jijiang Liu <jijiang.liu@intel.com>", "To": "dev@dpdk.org", "Date": "Tue, 26 Aug 2014 15:31:32 +0800", "Message-Id": "<1409038294-21693-6-git-send-email-jijiang.liu@intel.com>", "X-Mailer": "git-send-email 1.7.0.7", "In-Reply-To": "<1409038294-21693-1-git-send-email-jijiang.liu@intel.com>", "References": "<1409038294-21693-1-git-send-email-jijiang.liu@intel.com>", "Subject": "[dpdk-dev] [PATCH v2 5/7]]app/testpmd:test VxLAN packet filter API", "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>", "X-List-Received-Date": "Tue, 26 Aug 2014 07:28:08 -0000" }, "content": "Add tunnel_filter command in testpmd to test VxLAN packet 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---\n app/test-pmd/cmdline.c | 149 +++++++++++++++++++++++++++++++++++++++++++++++-\n 1 files changed, 148 insertions(+), 1 deletions(-)", "diff": "diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c\nindex de910db..c04de6b 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,144 @@ 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_tunnel_filter_set(res->port_id,\n+\t\t\t\t\t&tunnel_filter_conf, 1, 1);\n+\telse\n+\t\tret = rte_eth_dev_tunnel_filter_set(res->port_id,\n+\t\t\t\t\t&tunnel_filter_conf, 1, 0);\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 +6415,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 +7721,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", "v2", "5/7" ] }{ "id": 225, "url": "