Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/62841/?format=api
http://patches.dpdk.org/api/patches/62841/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20191111131914.16559-9-pbhagavatula@marvell.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": "<20191111131914.16559-9-pbhagavatula@marvell.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20191111131914.16559-9-pbhagavatula@marvell.com", "date": "2019-11-11T13:19:12", "name": "[v17,08/10] app/testpmd: add command to set supported ptype mask", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "9971b01d4e6bd191fd6e77cffab0355992df33b2", "submitter": { "id": 1183, "url": "http://patches.dpdk.org/api/people/1183/?format=api", "name": "Pavan Nikhilesh Bhagavatula", "email": "pbhagavatula@marvell.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/20191111131914.16559-9-pbhagavatula@marvell.com/mbox/", "series": [ { "id": 7386, "url": "http://patches.dpdk.org/api/series/7386/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=7386", "date": "2019-11-11T13:19:04", "name": "ethdev: add new Rx offload flags", "version": 17, "mbox": "http://patches.dpdk.org/series/7386/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/62841/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/62841/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id C8E76A04B9;\n\tMon, 11 Nov 2019 14:20:46 +0100 (CET)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id A35E62C2B;\n\tMon, 11 Nov 2019 14:20:05 +0100 (CET)", "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 0DFE42BF9\n for <dev@dpdk.org>; Mon, 11 Nov 2019 14:20:01 +0100 (CET)", "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id\n xABDHTmY026232; Mon, 11 Nov 2019 05:20:01 -0800", "from sc-exch02.marvell.com ([199.233.58.182])\n by mx0b-0016f401.pphosted.com with ESMTP id 2w5wurp90h-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Mon, 11 Nov 2019 05:20:01 -0800", "from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH02.marvell.com\n (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Mon, 11 Nov\n 2019 05:19:59 -0800", "from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com\n (10.93.176.83) with Microsoft SMTP Server id 15.0.1367.3 via Frontend\n Transport; Mon, 11 Nov 2019 05:19:59 -0800", "from BG-LT7430.marvell.com (unknown [10.28.17.38])\n by maili.marvell.com (Postfix) with ESMTP id E11703F703F;\n Mon, 11 Nov 2019 05:19:55 -0800 (PST)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n h=from : to : cc :\n subject : date : message-id : in-reply-to : references : mime-version :\n content-transfer-encoding : content-type; s=pfpt0818;\n bh=ppGIu8d0KNRE3XzkUqFKX4MhJsicKcTsRSXZveRfRys=;\n b=d7+AsJGV5/N8Bo3ConGnvA/kU0JAMRq02ph5NjRxS/mSOsJd2TZ74Ievi11bdrQIJ6bY\n VAaG+OdniTWl4szy142+k+4xPRNvC2E20UhhRMaUquCsxBJa9qAlSiHMru9ikNQgLg9t\n Sm8AvylsxwYw8E8jPOSF/ebRq/OSZQXdWLm3UFTsPBECkLucTrFyH7YiXyzGAUHJ2L6e\n K8h3San58qKh6Rq5nqNCrJrG/hO0nwPlJoNTk1DhuhA+A8eNxpIx224w8UyWh0ghYNza\n CvZZ/tR+ZeQ5voQ8ors8VSGzyuVhiU5242BTzyb2qBhH4mnpzne+vitQfvx3Kyu2v9Er eg==", "From": "<pbhagavatula@marvell.com>", "To": "<ferruh.yigit@intel.com>, <arybchenko@solarflare.com>,\n <jerinj@marvell.com>, <thomas@monjalon.net>, Wenzhuo Lu\n <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>, \"Bernard\n Iremonger\" <bernard.iremonger@intel.com>, John McNamara\n <john.mcnamara@intel.com>, Marko Kovacevic <marko.kovacevic@intel.com>", "CC": "<dev@dpdk.org>, Pavan Nikhilesh <pbhagavatula@marvell.com>", "Date": "Mon, 11 Nov 2019 18:49:12 +0530", "Message-ID": "<20191111131914.16559-9-pbhagavatula@marvell.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20191111131914.16559-1-pbhagavatula@marvell.com>", "References": "<20191106191803.15098-1-pbhagavatula@marvell.com>\n <20191111131914.16559-1-pbhagavatula@marvell.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Content-Type": "text/plain", "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10434:6.0.95,18.0.572\n definitions=2019-11-11_04:2019-11-11,2019-11-11 signatures=0", "Subject": "[dpdk-dev] [PATCH v17 08/10] app/testpmd: add command to set\n\tsupported ptype mask", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "From: Pavan Nikhilesh <pbhagavatula@marvell.com>\n\nAdd command to set supported ptype mask.\nUsage:\n\tset port <port_id> ptype_mask <ptype_mask>\n\nSigned-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>\n---\n app/test-pmd/cmdline.c | 84 +++++++++++++++++++++\n doc/guides/testpmd_app_ug/testpmd_funcs.rst | 7 ++\n 2 files changed, 91 insertions(+)", "diff": "diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c\nindex 48627c8aa..da556f91e 100644\n--- a/app/test-pmd/cmdline.c\n+++ b/app/test-pmd/cmdline.c\n@@ -671,6 +671,9 @@ static void cmd_help_long_parsed(void *parsed_result,\n \t\t\t\"ptype mapping update (port_id) (hw_ptype) (sw_ptype)\\n\"\n \t\t\t\" Update a ptype mapping item on a port\\n\\n\"\n \n+\t\t\t\"set port (port_id) ptype_mask (ptype_mask)\\n\"\n+\t\t\t\" set packet types classification for a specific port\\n\\n\"\n+\n \t\t\t\"set port (port_id) queue-region region_id (value) \"\n \t\t\t\"queue_start_index (value) queue_num (value)\\n\"\n \t\t\t\" Set a queue region on a port\\n\\n\"\n@@ -19015,6 +19018,86 @@ cmdline_parse_inst_t cmd_show_rx_tx_desc_status = {\n \t},\n };\n \n+/* Common result structure for set port ptypes */\n+struct cmd_set_port_ptypes_result {\n+\tcmdline_fixed_string_t set;\n+\tcmdline_fixed_string_t port;\n+\tportid_t port_id;\n+\tcmdline_fixed_string_t ptype_mask;\n+\tuint32_t mask;\n+};\n+\n+/* Common CLI fields for set port ptypes */\n+cmdline_parse_token_string_t cmd_set_port_ptypes_set =\n+\tTOKEN_STRING_INITIALIZER\n+\t\t(struct cmd_set_port_ptypes_result,\n+\t\t set, \"set\");\n+cmdline_parse_token_string_t cmd_set_port_ptypes_port =\n+\tTOKEN_STRING_INITIALIZER\n+\t\t(struct cmd_set_port_ptypes_result,\n+\t\t port, \"port\");\n+cmdline_parse_token_num_t cmd_set_port_ptypes_port_id =\n+\tTOKEN_NUM_INITIALIZER\n+\t\t(struct cmd_set_port_ptypes_result,\n+\t\t port_id, UINT16);\n+cmdline_parse_token_string_t cmd_set_port_ptypes_mask_str =\n+\tTOKEN_STRING_INITIALIZER\n+\t\t(struct cmd_set_port_ptypes_result,\n+\t\t ptype_mask, \"ptype_mask\");\n+cmdline_parse_token_num_t cmd_set_port_ptypes_mask_u32 =\n+\tTOKEN_NUM_INITIALIZER\n+\t\t(struct cmd_set_port_ptypes_result,\n+\t\t mask, UINT32);\n+\n+static void\n+cmd_set_port_ptypes_parsed(\n+\tvoid *parsed_result,\n+\t__attribute__((unused)) struct cmdline *cl,\n+\t__attribute__((unused)) void *data)\n+{\n+\tstruct cmd_set_port_ptypes_result *res = parsed_result;\n+#define PTYPE_NAMESIZE 256\n+\tchar ptype_name[PTYPE_NAMESIZE];\n+\tuint16_t port_id = res->port_id;\n+\tuint32_t ptype_mask = res->mask;\n+\tint ret, i;\n+\n+\tret = rte_eth_dev_get_supported_ptypes(port_id, RTE_PTYPE_ALL_MASK,\n+\t\t\t\t\t NULL, 0);\n+\tif (ret <= 0) {\n+\t\tprintf(\"Port %d doesn't support any ptypes.\\n\", port_id);\n+\t\treturn;\n+\t}\n+\n+\tuint32_t ptypes[ret];\n+\n+\tret = rte_eth_dev_set_ptypes(port_id, ptype_mask, ptypes, ret);\n+\tif (ret < 0) {\n+\t\tprintf(\"Unable to set requested ptypes for Port %d\\n\", port_id);\n+\t\treturn;\n+\t}\n+\n+\tprintf(\"Successfully set following ptypes for Port %d\\n\", port_id);\n+\tfor (i = 0; i < ret && ptypes[i] != RTE_PTYPE_UNKNOWN; i++) {\n+\t\trte_get_ptype_name(ptypes[i], ptype_name, sizeof(ptype_name));\n+\t\tprintf(\"%s\\n\", ptype_name);\n+\t}\n+}\n+\n+cmdline_parse_inst_t cmd_set_port_ptypes = {\n+\t.f = cmd_set_port_ptypes_parsed,\n+\t.data = NULL,\n+\t.help_str = \"set port <port_id> ptype_mask <mask>\",\n+\t.tokens = {\n+\t\t(void *)&cmd_set_port_ptypes_set,\n+\t\t(void *)&cmd_set_port_ptypes_port,\n+\t\t(void *)&cmd_set_port_ptypes_port_id,\n+\t\t(void *)&cmd_set_port_ptypes_mask_str,\n+\t\t(void *)&cmd_set_port_ptypes_mask_u32,\n+\t\tNULL,\n+\t},\n+};\n+\n /* ******************************************************************************** */\n \n /* list of instructions */\n@@ -19254,6 +19337,7 @@ cmdline_parse_ctx_t main_ctx[] = {\n \t(cmdline_parse_inst_t *)&cmd_show_vf_stats,\n \t(cmdline_parse_inst_t *)&cmd_clear_vf_stats,\n \t(cmdline_parse_inst_t *)&cmd_show_port_supported_ptypes,\n+\t(cmdline_parse_inst_t *)&cmd_set_port_ptypes,\n \t(cmdline_parse_inst_t *)&cmd_ptype_mapping_get,\n \t(cmdline_parse_inst_t *)&cmd_ptype_mapping_replace,\n \t(cmdline_parse_inst_t *)&cmd_ptype_mapping_reset,\ndiff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst\nindex 9a5e5cb05..c331b4d90 100644\n--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst\n+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst\n@@ -480,6 +480,13 @@ Show ptypes supported for a specific port::\n \n testpmd> show port (port_id) ptypes\n \n+set port supported ptypes\n+~~~~~~~~~~~~~~~~~~~~~~~~~\n+\n+set packet types classification for a specific port::\n+\n+ testpmd> set port (port_id) ptypes_mask (mask)\n+\n show device info\n ~~~~~~~~~~~~~~~~\n \n", "prefixes": [ "v17", "08/10" ] }{ "id": 62841, "url": "