Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/18070/?format=api
http://patches.dpdk.org/api/patches/18070/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20161216143919.4909-20-ferruh.yigit@intel.com/", "project": { "id": 1, "url": "http://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": "<20161216143919.4909-20-ferruh.yigit@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20161216143919.4909-20-ferruh.yigit@intel.com", "date": "2016-12-16T14:39:09", "name": "[dpdk-dev,v4,19/29] app/testpmd: use unicast promiscuous mode on i40e", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "78ba161abb17958c8bf23be79d8d6f46fd7acc8a", "submitter": { "id": 324, "url": "http://patches.dpdk.org/api/people/324/?format=api", "name": "Ferruh Yigit", "email": "ferruh.yigit@intel.com" }, "delegate": { "id": 319, "url": "http://patches.dpdk.org/api/users/319/?format=api", "username": "fyigit", "first_name": "Ferruh", "last_name": "Yigit", "email": "ferruh.yigit@amd.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20161216143919.4909-20-ferruh.yigit@intel.com/mbox/", "series": [], "comments": "http://patches.dpdk.org/api/patches/18070/comments/", "check": "fail", "checks": "http://patches.dpdk.org/api/patches/18070/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 2AB15FA63;\n\tFri, 16 Dec 2016 15:42:19 +0100 (CET)", "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby dpdk.org (Postfix) with ESMTP id 5BBE4FA62\n\tfor <dev@dpdk.org>; Fri, 16 Dec 2016 15:42:17 +0100 (CET)", "from fmsmga005.fm.intel.com ([10.253.24.32])\n\tby fmsmga103.fm.intel.com with ESMTP; 16 Dec 2016 06:42:16 -0800", "from sivswdev02.ir.intel.com ([10.237.217.46])\n\tby fmsmga005.fm.intel.com with ESMTP; 16 Dec 2016 06:42:16 -0800" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.33,358,1477983600\"; d=\"scan'208\";a=\"43277965\"", "From": "Ferruh Yigit <ferruh.yigit@intel.com>", "To": "dev@dpdk.org", "Cc": "Jingjing Wu <jingjing.wu@intel.com>; Helin Zhang <helin.zhang@intel.com>,\n\tWenzhuo Lu <wenzhuo.lu@intel.com>", "Date": "Fri, 16 Dec 2016 14:39:09 +0000", "Message-Id": "<20161216143919.4909-20-ferruh.yigit@intel.com>", "X-Mailer": "git-send-email 2.8.4", "In-Reply-To": "<20161216143919.4909-1-ferruh.yigit@intel.com>", "References": "<1481835919-36488-1-git-send-email-qi.z.zhang@intel.com>\n\t<20161216143919.4909-1-ferruh.yigit@intel.com>", "Subject": "[dpdk-dev] [PATCH v4 19/29] app/testpmd: use unicast promiscuous\n\tmode on i40e", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <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": "From: Wenzhuo Lu <wenzhuo.lu@intel.com>\n\nAdd testpmd CLI to set VF unicast promiscuous mode on i40e.\n\nSigned-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>\n---\n app/test-pmd/cmdline.c | 86 +++++++++++++++++++++++++++++\n doc/guides/testpmd_app_ug/testpmd_funcs.rst | 9 +++\n 2 files changed, 95 insertions(+)", "diff": "diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c\nindex 5d2cdc7..f45d55c 100644\n--- a/app/test-pmd/cmdline.c\n+++ b/app/test-pmd/cmdline.c\n@@ -395,6 +395,9 @@ static void cmd_help_long_parsed(void *parsed_result,\n \t\t\t\"set allmulti (port_id|all) (on|off)\\n\"\n \t\t\t\" Set the allmulti mode on port_id, or all.\\n\\n\"\n \n+\t\t\t\"set vf promisc (port_id) (vf_id) (on|off)\\n\"\n+\t\t\t\" Set unicast promiscuous mode for a VF from the PF.\\n\\n\"\n+\n \t\t\t\"set flow_ctrl rx (on|off) tx (on|off) (high_water)\"\n \t\t\t\" (low_water) (pause_time) (send_xon) mac_ctrl_frame_fwd\"\n \t\t\t\" (on|off) autoneg (on|off) (port_id)\\n\"\n@@ -11540,6 +11543,88 @@ cmdline_parse_inst_t cmd_set_vf_mac_addr = {\n \t},\n };\n \n+/* VF unicast promiscuous mode configuration */\n+\n+/* Common result structure for VF unicast promiscuous mode */\n+struct cmd_vf_promisc_result {\n+\tcmdline_fixed_string_t set;\n+\tcmdline_fixed_string_t vf;\n+\tcmdline_fixed_string_t promisc;\n+\tuint8_t port_id;\n+\tuint32_t vf_id;\n+\tcmdline_fixed_string_t on_off;\n+};\n+\n+/* Common CLI fields for VF unicast promiscuous mode enable disable */\n+cmdline_parse_token_string_t cmd_vf_promisc_set =\n+\tTOKEN_STRING_INITIALIZER\n+\t\t(struct cmd_vf_promisc_result,\n+\t\t set, \"set\");\n+cmdline_parse_token_string_t cmd_vf_promisc_vf =\n+\tTOKEN_STRING_INITIALIZER\n+\t\t(struct cmd_vf_promisc_result,\n+\t\t vf, \"vf\");\n+cmdline_parse_token_string_t cmd_vf_promisc_promisc =\n+\tTOKEN_STRING_INITIALIZER\n+\t\t(struct cmd_vf_promisc_result,\n+\t\t promisc, \"promisc\");\n+cmdline_parse_token_num_t cmd_vf_promisc_port_id =\n+\tTOKEN_NUM_INITIALIZER\n+\t\t(struct cmd_vf_promisc_result,\n+\t\t port_id, UINT8);\n+cmdline_parse_token_num_t cmd_vf_promisc_vf_id =\n+\tTOKEN_NUM_INITIALIZER\n+\t\t(struct cmd_vf_promisc_result,\n+\t\t vf_id, UINT32);\n+cmdline_parse_token_string_t cmd_vf_promisc_on_off =\n+\tTOKEN_STRING_INITIALIZER\n+\t\t(struct cmd_vf_promisc_result,\n+\t\t on_off, \"on#off\");\n+\n+static void\n+cmd_set_vf_promisc_parsed(\n+\tvoid *parsed_result,\n+\t__attribute__((unused)) struct cmdline *cl,\n+\t__attribute__((unused)) void *data)\n+{\n+\tstruct cmd_vf_promisc_result *res = parsed_result;\n+\tint ret = 0;\n+\tint is_on = (strcmp(res->on_off, \"on\") == 0) ? 1 : 0;\n+\n+\tif (port_id_is_invalid(res->port_id, ENABLED_WARN))\n+\t\treturn;\n+\n+\tret = rte_pmd_i40e_set_vf_unicast_promisc(res->port_id,\n+\t\t\t\t\t\t res->vf_id, is_on);\n+\tswitch (ret) {\n+\tcase 0:\n+\t\tbreak;\n+\tcase -EINVAL:\n+\t\tprintf(\"invalid vf_id %d\\n\", res->vf_id);\n+\t\tbreak;\n+\tcase -ENODEV:\n+\t\tprintf(\"invalid port_id %d\\n\", res->port_id);\n+\t\tbreak;\n+\tdefault:\n+\t\tprintf(\"programming error: (%s)\\n\", strerror(-ret));\n+\t}\n+}\n+\n+cmdline_parse_inst_t cmd_set_vf_promisc = {\n+\t.f = cmd_set_vf_promisc_parsed,\n+\t.data = NULL,\n+\t.help_str = \"set vf unicast promiscuous mode for a VF from PF\",\n+\t.tokens = {\n+\t\t(void *)&cmd_vf_promisc_set,\n+\t\t(void *)&cmd_vf_promisc_vf,\n+\t\t(void *)&cmd_vf_promisc_promisc,\n+\t\t(void *)&cmd_vf_promisc_port_id,\n+\t\t(void *)&cmd_vf_promisc_vf_id,\n+\t\t(void *)&cmd_vf_promisc_on_off,\n+\t\tNULL,\n+\t},\n+};\n+\n /* ******************************************************************************** */\n \n /* list of instructions */\n@@ -11704,6 +11789,7 @@ cmdline_parse_ctx_t main_ctx[] = {\n \t(cmdline_parse_inst_t *)&cmd_set_vf_traffic,\n \t(cmdline_parse_inst_t *)&cmd_vf_rxvlan_filter,\n \t(cmdline_parse_inst_t *)&cmd_vf_rate_limit,\n+\t(cmdline_parse_inst_t *)&cmd_set_vf_promisc,\n \tNULL,\n };\n \ndiff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst\nindex f1c269a..2b18c66 100644\n--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst\n+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst\n@@ -820,6 +820,15 @@ Set the allmulti mode for a port or for all ports::\n \n Same as the ifconfig (8) option. Controls how multicast packets are handled.\n \n+set promisc (for VF)\n+~~~~~~~~~~~~~~~~~~~~\n+\n+Set the unicast promiscuous mode for a VF from PF.\n+It's supported by Intel i40e NICs now.\n+In promiscuous mode packets are not dropped if they aren't for the specified MAC address::\n+\n+ testpmd> set vf promisc (port_id) (vf_id) (on|off)\n+\n set flow_ctrl rx\n ~~~~~~~~~~~~~~~~\n \n", "prefixes": [ "dpdk-dev", "v4", "19/29" ] }{ "id": 18070, "url": "