Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/114292/?format=api
http://patches.dpdk.org/api/patches/114292/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20220727223639.598932-14-cristian.dumitrescu@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": "<20220727223639.598932-14-cristian.dumitrescu@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20220727223639.598932-14-cristian.dumitrescu@intel.com", "date": "2022-07-27T22:36:36", "name": "[V3,14/17] examples/pipeline: use the pipeline name query API", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "04e583cf2710c0810df399180170605e3f253ff0", "submitter": { "id": 19, "url": "http://patches.dpdk.org/api/people/19/?format=api", "name": "Cristian Dumitrescu", "email": "cristian.dumitrescu@intel.com" }, "delegate": { "id": 1, "url": "http://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20220727223639.598932-14-cristian.dumitrescu@intel.com/mbox/", "series": [ { "id": 24106, "url": "http://patches.dpdk.org/api/series/24106/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=24106", "date": "2022-07-27T22:36:23", "name": "[V3,01/17] pipeline: add pipeline name", "version": 3, "mbox": "http://patches.dpdk.org/series/24106/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/114292/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/114292/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 mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id BE167A00C4;\n\tThu, 28 Jul 2022 00:38:03 +0200 (CEST)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 7242642B77;\n\tThu, 28 Jul 2022 00:37:04 +0200 (CEST)", "from mga06.intel.com (mga06b.intel.com [134.134.136.31])\n by mails.dpdk.org (Postfix) with ESMTP id E4EAA42B94\n for <dev@dpdk.org>; Thu, 28 Jul 2022 00:36:55 +0200 (CEST)", "from orsmga008.jf.intel.com ([10.7.209.65])\n by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 27 Jul 2022 15:36:55 -0700", "from silpixa00400573.ir.intel.com (HELO\n silpixa00400573.ger.corp.intel.com.) ([10.237.223.157])\n by orsmga008.jf.intel.com with ESMTP; 27 Jul 2022 15:36:53 -0700" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1658961416; x=1690497416;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=mdd7xobB3yYeOf0ALMuS8NLNlQj9cuZS1V80eTZviNw=;\n b=hWtT84sMaAK5O68TJPgWTaOKjJILWSgPvLN7txeRf3AEfHiX/6vuMQqG\n oFVwwzu2yrkInHBvkBaIUDqkCHMuV6H4s0K7QCm6ofxjWRhs+DXu48ZPU\n C345fNlfPMOHXjb+anVsvhDpIOpfeO2kGtnolwC7zf7BRNhfYBJTByrHU\n +7BzEzZ5gaFub97iJBbn74ujUor+9sFD18BEUmYg+SKSBfSCzAzglMTmi\n m6Vf4jzlqwjZUHgE+g2Wm3QIHy0seBBXY2yEpLJqI8c7/GY8Qs7xwno7i\n F5n4+Qf84j0npefVrJSEcBUW6X2wJt5YZB7dRYDyXZegNS+uw1Yw8UKI0 w==;", "X-IronPort-AV": [ "E=McAfee;i=\"6400,9594,10421\"; a=\"350068845\"", "E=Sophos;i=\"5.93,196,1654585200\"; d=\"scan'208\";a=\"350068845\"", "E=Sophos;i=\"5.93,196,1654585200\"; d=\"scan'208\";a=\"628567676\"" ], "X-ExtLoop1": "1", "From": "Cristian Dumitrescu <cristian.dumitrescu@intel.com>", "To": "dev@dpdk.org", "Cc": "\"Kamalakannan R .\" <kamalakannan.r@intel.com>", "Subject": "[PATCH V3 14/17] examples/pipeline: use the pipeline name query API", "Date": "Wed, 27 Jul 2022 22:36:36 +0000", "Message-Id": "<20220727223639.598932-14-cristian.dumitrescu@intel.com>", "X-Mailer": "git-send-email 2.34.1", "In-Reply-To": "<20220727223639.598932-1-cristian.dumitrescu@intel.com>", "References": "<20220718132603.339314-1-cristian.dumitrescu@intel.com>\n <20220727223639.598932-1-cristian.dumitrescu@intel.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.29", "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" }, "content": "Convert the CLI commands to use the pipeline name query API and remove\nthe linked list of pipeline objects previously maintained by the\napplication.\n\nSigned-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>\nSigned-off-by: Kamalakannan R. <kamalakannan.r@intel.com>\n---\n examples/pipeline/cli.c | 268 ++++++++++++++++++++-----------------\n examples/pipeline/obj.c | 67 ----------\n examples/pipeline/obj.h | 24 ----\n examples/pipeline/thread.c | 65 ++++-----\n examples/pipeline/thread.h | 9 +-\n 5 files changed, 175 insertions(+), 258 deletions(-)", "diff": "diff --git a/examples/pipeline/cli.c b/examples/pipeline/cli.c\nindex fa828c008b..f48ff326be 100644\n--- a/examples/pipeline/cli.c\n+++ b/examples/pipeline/cli.c\n@@ -858,9 +858,9 @@ cmd_pipeline_table_add(char **tokens,\n \t\t uint32_t n_tokens,\n \t\t char *out,\n \t\t size_t out_size,\n-\t\t void *obj)\n+\t\t void *obj __rte_unused)\n {\n-\tstruct pipeline *p;\n+\tstruct rte_swx_ctl_pipeline *ctl;\n \tchar *pipeline_name, *table_name, *file_name;\n \tFILE *file = NULL;\n \tuint32_t file_line_number = 0;\n@@ -872,8 +872,8 @@ cmd_pipeline_table_add(char **tokens,\n \t}\n \n \tpipeline_name = tokens[1];\n-\tp = pipeline_find(obj, pipeline_name);\n-\tif (!p || !p->ctl) {\n+\tctl = rte_swx_ctl_pipeline_find(pipeline_name);\n+\tif (!ctl) {\n \t\tsnprintf(out, out_size, MSG_ARG_INVALID, \"pipeline_name\");\n \t\treturn;\n \t}\n@@ -887,7 +887,7 @@ cmd_pipeline_table_add(char **tokens,\n \t\treturn;\n \t}\n \n-\tstatus = pipeline_table_entries_add(p->ctl,\n+\tstatus = pipeline_table_entries_add(ctl,\n \t\t\t\t\t table_name,\n \t\t\t\t\t file,\n \t\t\t\t\t &file_line_number);\n@@ -956,9 +956,9 @@ cmd_pipeline_table_delete(char **tokens,\n \t\t\t uint32_t n_tokens,\n \t\t\t char *out,\n \t\t\t size_t out_size,\n-\t\t\t void *obj)\n+\t\t\t void *obj __rte_unused)\n {\n-\tstruct pipeline *p;\n+\tstruct rte_swx_ctl_pipeline *ctl;\n \tchar *pipeline_name, *table_name, *file_name;\n \tFILE *file = NULL;\n \tuint32_t file_line_number = 0;\n@@ -970,8 +970,8 @@ cmd_pipeline_table_delete(char **tokens,\n \t}\n \n \tpipeline_name = tokens[1];\n-\tp = pipeline_find(obj, pipeline_name);\n-\tif (!p || !p->ctl) {\n+\tctl = rte_swx_ctl_pipeline_find(pipeline_name);\n+\tif (!ctl) {\n \t\tsnprintf(out, out_size, MSG_ARG_INVALID, \"pipeline_name\");\n \t\treturn;\n \t}\n@@ -985,7 +985,7 @@ cmd_pipeline_table_delete(char **tokens,\n \t\treturn;\n \t}\n \n-\tstatus = pipeline_table_entries_delete(p->ctl,\n+\tstatus = pipeline_table_entries_delete(ctl,\n \t\t\t\t\t table_name,\n \t\t\t\t\t file,\n \t\t\t\t\t &file_line_number);\n@@ -1054,9 +1054,9 @@ cmd_pipeline_table_default(char **tokens,\n \t\t\t uint32_t n_tokens,\n \t\t\t char *out,\n \t\t\t size_t out_size,\n-\t\t\t void *obj)\n+\t\t\t void *obj __rte_unused)\n {\n-\tstruct pipeline *p;\n+\tstruct rte_swx_ctl_pipeline *ctl;\n \tchar *pipeline_name, *table_name, *file_name;\n \tFILE *file = NULL;\n \tuint32_t file_line_number = 0;\n@@ -1068,8 +1068,8 @@ cmd_pipeline_table_default(char **tokens,\n \t}\n \n \tpipeline_name = tokens[1];\n-\tp = pipeline_find(obj, pipeline_name);\n-\tif (!p || !p->ctl) {\n+\tctl = rte_swx_ctl_pipeline_find(pipeline_name);\n+\tif (!ctl) {\n \t\tsnprintf(out, out_size, MSG_ARG_INVALID, \"pipeline_name\");\n \t\treturn;\n \t}\n@@ -1083,7 +1083,7 @@ cmd_pipeline_table_default(char **tokens,\n \t\treturn;\n \t}\n \n-\tstatus = pipeline_table_default_entry_add(p->ctl,\n+\tstatus = pipeline_table_default_entry_add(ctl,\n \t\t\t\t\t\t table_name,\n \t\t\t\t\t\t file,\n \t\t\t\t\t\t &file_line_number);\n@@ -1103,9 +1103,9 @@ cmd_pipeline_table_show(char **tokens,\n \tuint32_t n_tokens,\n \tchar *out,\n \tsize_t out_size,\n-\tvoid *obj)\n+\tvoid *obj __rte_unused)\n {\n-\tstruct pipeline *p;\n+\tstruct rte_swx_ctl_pipeline *ctl;\n \tchar *pipeline_name, *table_name;\n \tFILE *file = NULL;\n \tint status;\n@@ -1116,8 +1116,8 @@ cmd_pipeline_table_show(char **tokens,\n \t}\n \n \tpipeline_name = tokens[1];\n-\tp = pipeline_find(obj, pipeline_name);\n-\tif (!p || !p->ctl) {\n+\tctl = rte_swx_ctl_pipeline_find(pipeline_name);\n+\tif (!ctl) {\n \t\tsnprintf(out, out_size, MSG_ARG_INVALID, \"pipeline_name\");\n \t\treturn;\n \t}\n@@ -1129,7 +1129,7 @@ cmd_pipeline_table_show(char **tokens,\n \t\treturn;\n \t}\n \n-\tstatus = rte_swx_ctl_pipeline_table_fprintf(file, p->ctl, table_name);\n+\tstatus = rte_swx_ctl_pipeline_table_fprintf(file, ctl, table_name);\n \tif (status)\n \t\tsnprintf(out, out_size, MSG_ARG_INVALID, \"table_name\");\n \n@@ -1145,9 +1145,9 @@ cmd_pipeline_selector_group_add(char **tokens,\n \tuint32_t n_tokens,\n \tchar *out,\n \tsize_t out_size,\n-\tvoid *obj)\n+\tvoid *obj __rte_unused)\n {\n-\tstruct pipeline *p;\n+\tstruct rte_swx_ctl_pipeline *ctl;\n \tchar *pipeline_name, *selector_name;\n \tuint32_t group_id;\n \tint status;\n@@ -1158,8 +1158,8 @@ cmd_pipeline_selector_group_add(char **tokens,\n \t}\n \n \tpipeline_name = tokens[1];\n-\tp = pipeline_find(obj, pipeline_name);\n-\tif (!p || !p->ctl) {\n+\tctl = rte_swx_ctl_pipeline_find(pipeline_name);\n+\tif (!ctl) {\n \t\tsnprintf(out, out_size, MSG_ARG_INVALID, \"pipeline_name\");\n \t\treturn;\n \t}\n@@ -1177,7 +1177,7 @@ cmd_pipeline_selector_group_add(char **tokens,\n \t\treturn;\n \t}\n \n-\tstatus = rte_swx_ctl_pipeline_selector_group_add(p->ctl,\n+\tstatus = rte_swx_ctl_pipeline_selector_group_add(ctl,\n \t\tselector_name,\n \t\t&group_id);\n \tif (status)\n@@ -1194,9 +1194,9 @@ cmd_pipeline_selector_group_delete(char **tokens,\n \tuint32_t n_tokens,\n \tchar *out,\n \tsize_t out_size,\n-\tvoid *obj)\n+\tvoid *obj __rte_unused)\n {\n-\tstruct pipeline *p;\n+\tstruct rte_swx_ctl_pipeline *ctl;\n \tchar *pipeline_name, *selector_name;\n \tuint32_t group_id;\n \tint status;\n@@ -1207,8 +1207,8 @@ cmd_pipeline_selector_group_delete(char **tokens,\n \t}\n \n \tpipeline_name = tokens[1];\n-\tp = pipeline_find(obj, pipeline_name);\n-\tif (!p || !p->ctl) {\n+\tctl = rte_swx_ctl_pipeline_find(pipeline_name);\n+\tif (!ctl) {\n \t\tsnprintf(out, out_size, MSG_ARG_INVALID, \"pipeline_name\");\n \t\treturn;\n \t}\n@@ -1231,7 +1231,7 @@ cmd_pipeline_selector_group_delete(char **tokens,\n \t\treturn;\n \t}\n \n-\tstatus = rte_swx_ctl_pipeline_selector_group_delete(p->ctl,\n+\tstatus = rte_swx_ctl_pipeline_selector_group_delete(ctl,\n \t\tselector_name,\n \t\tgroup_id);\n \tif (status)\n@@ -1402,9 +1402,9 @@ cmd_pipeline_selector_group_member_add(char **tokens,\n \tuint32_t n_tokens,\n \tchar *out,\n \tsize_t out_size,\n-\tvoid *obj)\n+\tvoid *obj __rte_unused)\n {\n-\tstruct pipeline *p;\n+\tstruct rte_swx_ctl_pipeline *ctl;\n \tchar *pipeline_name, *selector_name, *file_name;\n \tFILE *file = NULL;\n \tuint32_t file_line_number = 0;\n@@ -1416,8 +1416,8 @@ cmd_pipeline_selector_group_member_add(char **tokens,\n \t}\n \n \tpipeline_name = tokens[1];\n-\tp = pipeline_find(obj, pipeline_name);\n-\tif (!p || !p->ctl) {\n+\tctl = rte_swx_ctl_pipeline_find(pipeline_name);\n+\tif (!ctl) {\n \t\tsnprintf(out, out_size, MSG_ARG_INVALID, \"pipeline_name\");\n \t\treturn;\n \t}\n@@ -1443,7 +1443,7 @@ cmd_pipeline_selector_group_member_add(char **tokens,\n \t\treturn;\n \t}\n \n-\tstatus = pipeline_selector_group_members_add(p->ctl,\n+\tstatus = pipeline_selector_group_members_add(ctl,\n \t\t\t\t\t selector_name,\n \t\t\t\t\t file,\n \t\t\t\t\t &file_line_number);\n@@ -1512,9 +1512,9 @@ cmd_pipeline_selector_group_member_delete(char **tokens,\n \tuint32_t n_tokens,\n \tchar *out,\n \tsize_t out_size,\n-\tvoid *obj)\n+\tvoid *obj __rte_unused)\n {\n-\tstruct pipeline *p;\n+\tstruct rte_swx_ctl_pipeline *ctl;\n \tchar *pipeline_name, *selector_name, *file_name;\n \tFILE *file = NULL;\n \tuint32_t file_line_number = 0;\n@@ -1526,8 +1526,8 @@ cmd_pipeline_selector_group_member_delete(char **tokens,\n \t}\n \n \tpipeline_name = tokens[1];\n-\tp = pipeline_find(obj, pipeline_name);\n-\tif (!p || !p->ctl) {\n+\tctl = rte_swx_ctl_pipeline_find(pipeline_name);\n+\tif (!ctl) {\n \t\tsnprintf(out, out_size, MSG_ARG_INVALID, \"pipeline_name\");\n \t\treturn;\n \t}\n@@ -1553,7 +1553,7 @@ cmd_pipeline_selector_group_member_delete(char **tokens,\n \t\treturn;\n \t}\n \n-\tstatus = pipeline_selector_group_members_delete(p->ctl,\n+\tstatus = pipeline_selector_group_members_delete(ctl,\n \t\t\t\t\t selector_name,\n \t\t\t\t\t file,\n \t\t\t\t\t &file_line_number);\n@@ -1573,9 +1573,9 @@ cmd_pipeline_selector_show(char **tokens,\n \tuint32_t n_tokens,\n \tchar *out,\n \tsize_t out_size,\n-\tvoid *obj)\n+\tvoid *obj __rte_unused)\n {\n-\tstruct pipeline *p;\n+\tstruct rte_swx_ctl_pipeline *ctl;\n \tchar *pipeline_name, *selector_name;\n \tFILE *file = NULL;\n \tint status;\n@@ -1586,8 +1586,8 @@ cmd_pipeline_selector_show(char **tokens,\n \t}\n \n \tpipeline_name = tokens[1];\n-\tp = pipeline_find(obj, pipeline_name);\n-\tif (!p || !p->ctl) {\n+\tctl = rte_swx_ctl_pipeline_find(pipeline_name);\n+\tif (!ctl) {\n \t\tsnprintf(out, out_size, MSG_ARG_INVALID, \"pipeline_name\");\n \t\treturn;\n \t}\n@@ -1600,7 +1600,7 @@ cmd_pipeline_selector_show(char **tokens,\n \t\treturn;\n \t}\n \n-\tstatus = rte_swx_ctl_pipeline_selector_fprintf(file, p->ctl, selector_name);\n+\tstatus = rte_swx_ctl_pipeline_selector_fprintf(file, ctl, selector_name);\n \tif (status)\n \t\tsnprintf(out, out_size, MSG_ARG_INVALID, \"selector_name\");\n \n@@ -1665,9 +1665,9 @@ cmd_pipeline_learner_default(char **tokens,\n \t\t\t uint32_t n_tokens,\n \t\t\t char *out,\n \t\t\t size_t out_size,\n-\t\t\t void *obj)\n+\t\t\t void *obj __rte_unused)\n {\n-\tstruct pipeline *p;\n+\tstruct rte_swx_ctl_pipeline *ctl;\n \tchar *pipeline_name, *learner_name, *file_name;\n \tFILE *file = NULL;\n \tuint32_t file_line_number = 0;\n@@ -1679,8 +1679,8 @@ cmd_pipeline_learner_default(char **tokens,\n \t}\n \n \tpipeline_name = tokens[1];\n-\tp = pipeline_find(obj, pipeline_name);\n-\tif (!p || !p->ctl) {\n+\tctl = rte_swx_ctl_pipeline_find(pipeline_name);\n+\tif (!ctl) {\n \t\tsnprintf(out, out_size, MSG_ARG_INVALID, \"pipeline_name\");\n \t\treturn;\n \t}\n@@ -1694,7 +1694,7 @@ cmd_pipeline_learner_default(char **tokens,\n \t\treturn;\n \t}\n \n-\tstatus = pipeline_learner_default_entry_add(p->ctl,\n+\tstatus = pipeline_learner_default_entry_add(ctl,\n \t\t\t\t\t\t learner_name,\n \t\t\t\t\t\t file,\n \t\t\t\t\t\t &file_line_number);\n@@ -1714,9 +1714,9 @@ cmd_pipeline_commit(char **tokens,\n \tuint32_t n_tokens,\n \tchar *out,\n \tsize_t out_size,\n-\tvoid *obj)\n+\tvoid *obj __rte_unused)\n {\n-\tstruct pipeline *p;\n+\tstruct rte_swx_ctl_pipeline *ctl;\n \tchar *pipeline_name;\n \tint status;\n \n@@ -1726,13 +1726,13 @@ cmd_pipeline_commit(char **tokens,\n \t}\n \n \tpipeline_name = tokens[1];\n-\tp = pipeline_find(obj, pipeline_name);\n-\tif (!p || !p->ctl) {\n+\tctl = rte_swx_ctl_pipeline_find(pipeline_name);\n+\tif (!ctl) {\n \t\tsnprintf(out, out_size, MSG_ARG_INVALID, \"pipeline_name\");\n \t\treturn;\n \t}\n \n-\tstatus = rte_swx_ctl_pipeline_commit(p->ctl, 1);\n+\tstatus = rte_swx_ctl_pipeline_commit(ctl, 1);\n \tif (status)\n \t\tsnprintf(out, out_size, \"Commit failed. \"\n \t\t\t\"Use \\\"commit\\\" to retry or \\\"abort\\\" to discard the pending work.\\n\");\n@@ -1746,9 +1746,9 @@ cmd_pipeline_abort(char **tokens,\n \tuint32_t n_tokens,\n \tchar *out,\n \tsize_t out_size,\n-\tvoid *obj)\n+\tvoid *obj __rte_unused)\n {\n-\tstruct pipeline *p;\n+\tstruct rte_swx_ctl_pipeline *ctl;\n \tchar *pipeline_name;\n \n \tif (n_tokens != 3) {\n@@ -1757,13 +1757,13 @@ cmd_pipeline_abort(char **tokens,\n \t}\n \n \tpipeline_name = tokens[1];\n-\tp = pipeline_find(obj, pipeline_name);\n-\tif (!p || !p->ctl) {\n+\tctl = rte_swx_ctl_pipeline_find(pipeline_name);\n+\tif (!ctl) {\n \t\tsnprintf(out, out_size, MSG_ARG_INVALID, \"pipeline_name\");\n \t\treturn;\n \t}\n \n-\trte_swx_ctl_pipeline_abort(p->ctl);\n+\trte_swx_ctl_pipeline_abort(ctl);\n }\n \n static const char cmd_pipeline_regrd_help[] =\n@@ -1774,9 +1774,9 @@ cmd_pipeline_regrd(char **tokens,\n \tuint32_t n_tokens,\n \tchar *out,\n \tsize_t out_size,\n-\tvoid *obj)\n+\tvoid *obj __rte_unused)\n {\n-\tstruct pipeline *p;\n+\tstruct rte_swx_pipeline *p;\n \tconst char *name;\n \tuint64_t value;\n \tuint32_t idx;\n@@ -1787,8 +1787,8 @@ cmd_pipeline_regrd(char **tokens,\n \t\treturn;\n \t}\n \n-\tp = pipeline_find(obj, tokens[1]);\n-\tif (!p || !p->ctl) {\n+\tp = rte_swx_pipeline_find(tokens[1]);\n+\tif (!p) {\n \t\tsnprintf(out, out_size, MSG_ARG_INVALID, \"pipeline_name\");\n \t\treturn;\n \t}\n@@ -1805,7 +1805,7 @@ cmd_pipeline_regrd(char **tokens,\n \t\treturn;\n \t}\n \n-\tstatus = rte_swx_ctl_pipeline_regarray_read(p->p, name, idx, &value);\n+\tstatus = rte_swx_ctl_pipeline_regarray_read(p, name, idx, &value);\n \tif (status) {\n \t\tsnprintf(out, out_size, \"Command failed.\\n\");\n \t\treturn;\n@@ -1822,9 +1822,9 @@ cmd_pipeline_regwr(char **tokens,\n \tuint32_t n_tokens,\n \tchar *out,\n \tsize_t out_size,\n-\tvoid *obj)\n+\tvoid *obj __rte_unused)\n {\n-\tstruct pipeline *p;\n+\tstruct rte_swx_pipeline *p;\n \tconst char *name;\n \tuint64_t value;\n \tuint32_t idx;\n@@ -1835,8 +1835,8 @@ cmd_pipeline_regwr(char **tokens,\n \t\treturn;\n \t}\n \n-\tp = pipeline_find(obj, tokens[1]);\n-\tif (!p || !p->ctl) {\n+\tp = rte_swx_pipeline_find(tokens[1]);\n+\tif (!p) {\n \t\tsnprintf(out, out_size, MSG_ARG_INVALID, \"pipeline_name\");\n \t\treturn;\n \t}\n@@ -1858,7 +1858,7 @@ cmd_pipeline_regwr(char **tokens,\n \t\treturn;\n \t}\n \n-\tstatus = rte_swx_ctl_pipeline_regarray_write(p->p, name, idx, value);\n+\tstatus = rte_swx_ctl_pipeline_regarray_write(p, name, idx, value);\n \tif (status) {\n \t\tsnprintf(out, out_size, \"Command failed.\\n\");\n \t\treturn;\n@@ -1874,10 +1874,10 @@ cmd_pipeline_meter_profile_add(char **tokens,\n \tuint32_t n_tokens,\n \tchar *out,\n \tsize_t out_size,\n-\tvoid *obj)\n+\tvoid *obj __rte_unused)\n {\n \tstruct rte_meter_trtcm_params params;\n-\tstruct pipeline *p;\n+\tstruct rte_swx_pipeline *p;\n \tconst char *profile_name;\n \tint status;\n \n@@ -1886,8 +1886,8 @@ cmd_pipeline_meter_profile_add(char **tokens,\n \t\treturn;\n \t}\n \n-\tp = pipeline_find(obj, tokens[1]);\n-\tif (!p || !p->ctl) {\n+\tp = rte_swx_pipeline_find(tokens[1]);\n+\tif (!p) {\n \t\tsnprintf(out, out_size, MSG_ARG_INVALID, \"pipeline_name\");\n \t\treturn;\n \t}\n@@ -1949,7 +1949,7 @@ cmd_pipeline_meter_profile_add(char **tokens,\n \t\treturn;\n \t}\n \n-\tstatus = rte_swx_ctl_meter_profile_add(p->p, profile_name, ¶ms);\n+\tstatus = rte_swx_ctl_meter_profile_add(p, profile_name, ¶ms);\n \tif (status) {\n \t\tsnprintf(out, out_size, \"Command failed.\\n\");\n \t\treturn;\n@@ -1964,9 +1964,9 @@ cmd_pipeline_meter_profile_delete(char **tokens,\n \tuint32_t n_tokens,\n \tchar *out,\n \tsize_t out_size,\n-\tvoid *obj)\n+\tvoid *obj __rte_unused)\n {\n-\tstruct pipeline *p;\n+\tstruct rte_swx_pipeline *p;\n \tconst char *profile_name;\n \tint status;\n \n@@ -1975,8 +1975,8 @@ cmd_pipeline_meter_profile_delete(char **tokens,\n \t\treturn;\n \t}\n \n-\tp = pipeline_find(obj, tokens[1]);\n-\tif (!p || !p->ctl) {\n+\tp = rte_swx_pipeline_find(tokens[1]);\n+\tif (!p) {\n \t\tsnprintf(out, out_size, MSG_ARG_INVALID, \"pipeline_name\");\n \t\treturn;\n \t}\n@@ -1998,7 +1998,7 @@ cmd_pipeline_meter_profile_delete(char **tokens,\n \t\treturn;\n \t}\n \n-\tstatus = rte_swx_ctl_meter_profile_delete(p->p, profile_name);\n+\tstatus = rte_swx_ctl_meter_profile_delete(p, profile_name);\n \tif (status) {\n \t\tsnprintf(out, out_size, \"Command failed.\\n\");\n \t\treturn;\n@@ -2014,9 +2014,9 @@ cmd_pipeline_meter_reset(char **tokens,\n \tuint32_t n_tokens,\n \tchar *out,\n \tsize_t out_size,\n-\tvoid *obj)\n+\tvoid *obj __rte_unused)\n {\n-\tstruct pipeline *p;\n+\tstruct rte_swx_pipeline *p;\n \tconst char *name;\n \tuint32_t idx0 = 0, idx1 = 0;\n \n@@ -2025,8 +2025,8 @@ cmd_pipeline_meter_reset(char **tokens,\n \t\treturn;\n \t}\n \n-\tp = pipeline_find(obj, tokens[1]);\n-\tif (!p || !p->ctl) {\n+\tp = rte_swx_pipeline_find(tokens[1]);\n+\tif (!p) {\n \t\tsnprintf(out, out_size, MSG_ARG_INVALID, \"pipeline_name\");\n \t\treturn;\n \t}\n@@ -2066,7 +2066,7 @@ cmd_pipeline_meter_reset(char **tokens,\n \tfor ( ; idx0 <= idx1; idx0++) {\n \t\tint status;\n \n-\t\tstatus = rte_swx_ctl_meter_reset(p->p, name, idx0);\n+\t\tstatus = rte_swx_ctl_meter_reset(p, name, idx0);\n \t\tif (status) {\n \t\t\tsnprintf(out, out_size, \"Command failed for index %u.\\n\", idx0);\n \t\t\treturn;\n@@ -2083,9 +2083,9 @@ cmd_pipeline_meter_set(char **tokens,\n \tuint32_t n_tokens,\n \tchar *out,\n \tsize_t out_size,\n-\tvoid *obj)\n+\tvoid *obj __rte_unused)\n {\n-\tstruct pipeline *p;\n+\tstruct rte_swx_pipeline *p;\n \tconst char *name, *profile_name;\n \tuint32_t idx0 = 0, idx1 = 0;\n \n@@ -2094,8 +2094,8 @@ cmd_pipeline_meter_set(char **tokens,\n \t\treturn;\n \t}\n \n-\tp = pipeline_find(obj, tokens[1]);\n-\tif (!p || !p->ctl) {\n+\tp = rte_swx_pipeline_find(tokens[1]);\n+\tif (!p) {\n \t\tsnprintf(out, out_size, MSG_ARG_INVALID, \"pipeline_name\");\n \t\treturn;\n \t}\n@@ -2142,7 +2142,7 @@ cmd_pipeline_meter_set(char **tokens,\n \tfor ( ; idx0 <= idx1; idx0++) {\n \t\tint status;\n \n-\t\tstatus = rte_swx_ctl_meter_set(p->p, name, idx0, profile_name);\n+\t\tstatus = rte_swx_ctl_meter_set(p, name, idx0, profile_name);\n \t\tif (status) {\n \t\t\tsnprintf(out, out_size, \"Command failed for index %u.\\n\", idx0);\n \t\t\treturn;\n@@ -2159,10 +2159,10 @@ cmd_pipeline_meter_stats(char **tokens,\n \tuint32_t n_tokens,\n \tchar *out,\n \tsize_t out_size,\n-\tvoid *obj)\n+\tvoid *obj __rte_unused)\n {\n \tstruct rte_swx_ctl_meter_stats stats;\n-\tstruct pipeline *p;\n+\tstruct rte_swx_pipeline *p;\n \tconst char *name;\n \tuint32_t idx0 = 0, idx1 = 0;\n \n@@ -2171,8 +2171,8 @@ cmd_pipeline_meter_stats(char **tokens,\n \t\treturn;\n \t}\n \n-\tp = pipeline_find(obj, tokens[1]);\n-\tif (!p || !p->ctl) {\n+\tp = rte_swx_pipeline_find(tokens[1]);\n+\tif (!p) {\n \t\tsnprintf(out, out_size, MSG_ARG_INVALID, \"pipeline_name\");\n \t\treturn;\n \t}\n@@ -2235,7 +2235,7 @@ cmd_pipeline_meter_stats(char **tokens,\n \tfor ( ; idx0 <= idx1; idx0++) {\n \t\tint status;\n \n-\t\tstatus = rte_swx_ctl_meter_stats_read(p->p, name, idx0, &stats);\n+\t\tstatus = rte_swx_ctl_meter_stats_read(p, name, idx0, &stats);\n \t\tif (status) {\n \t\t\tsnprintf(out, out_size, \"Pipeline meter stats error at index %u.\\n\", idx0);\n \t\t\tout_size -= strlen(out);\n@@ -2265,10 +2265,10 @@ cmd_pipeline_stats(char **tokens,\n \tuint32_t n_tokens,\n \tchar *out,\n \tsize_t out_size,\n-\tvoid *obj)\n+\tvoid *obj __rte_unused)\n {\n \tstruct rte_swx_ctl_pipeline_info info;\n-\tstruct pipeline *p;\n+\tstruct rte_swx_pipeline *p;\n \tuint32_t i;\n \tint status;\n \n@@ -2277,8 +2277,8 @@ cmd_pipeline_stats(char **tokens,\n \t\treturn;\n \t}\n \n-\tp = pipeline_find(obj, tokens[1]);\n-\tif (!p || !p->ctl) {\n+\tp = rte_swx_pipeline_find(tokens[1]);\n+\tif (!p) {\n \t\tsnprintf(out, out_size, MSG_ARG_INVALID, \"pipeline_name\");\n \t\treturn;\n \t}\n@@ -2288,7 +2288,7 @@ cmd_pipeline_stats(char **tokens,\n \t\treturn;\n \t}\n \n-\tstatus = rte_swx_ctl_pipeline_info_get(p->p, &info);\n+\tstatus = rte_swx_ctl_pipeline_info_get(p, &info);\n \tif (status) {\n \t\tsnprintf(out, out_size, \"Pipeline info get error.\");\n \t\treturn;\n@@ -2301,7 +2301,7 @@ cmd_pipeline_stats(char **tokens,\n \tfor (i = 0; i < info.n_ports_in; i++) {\n \t\tstruct rte_swx_port_in_stats stats;\n \n-\t\trte_swx_ctl_pipeline_port_in_stats_read(p->p, i, &stats);\n+\t\trte_swx_ctl_pipeline_port_in_stats_read(p, i, &stats);\n \n \t\tsnprintf(out, out_size, \"\\tPort %u:\"\n \t\t\t\" packets %\" PRIu64\n@@ -2319,7 +2319,7 @@ cmd_pipeline_stats(char **tokens,\n \tfor (i = 0; i < info.n_ports_out; i++) {\n \t\tstruct rte_swx_port_out_stats stats;\n \n-\t\trte_swx_ctl_pipeline_port_out_stats_read(p->p, i, &stats);\n+\t\trte_swx_ctl_pipeline_port_out_stats_read(p, i, &stats);\n \n \t\tif (i != info.n_ports_out - 1)\n \t\t\tsnprintf(out, out_size, \"\\tPort %u:\", i);\n@@ -2358,13 +2358,13 @@ cmd_pipeline_stats(char **tokens,\n \t\t};\n \t\tuint32_t j;\n \n-\t\tstatus = rte_swx_ctl_table_info_get(p->p, i, &table_info);\n+\t\tstatus = rte_swx_ctl_table_info_get(p, i, &table_info);\n \t\tif (status) {\n \t\t\tsnprintf(out, out_size, \"Table info get error.\");\n \t\t\treturn;\n \t\t}\n \n-\t\tstatus = rte_swx_ctl_pipeline_table_stats_read(p->p, table_info.name, &stats);\n+\t\tstatus = rte_swx_ctl_pipeline_table_stats_read(p, table_info.name, &stats);\n \t\tif (status) {\n \t\t\tsnprintf(out, out_size, \"Table stats read error.\");\n \t\t\treturn;\n@@ -2382,7 +2382,7 @@ cmd_pipeline_stats(char **tokens,\n \t\tfor (j = 0; j < info.n_actions; j++) {\n \t\t\tstruct rte_swx_ctl_action_info action_info;\n \n-\t\t\tstatus = rte_swx_ctl_action_info_get(p->p, j, &action_info);\n+\t\t\tstatus = rte_swx_ctl_action_info_get(p, j, &action_info);\n \t\t\tif (status) {\n \t\t\t\tsnprintf(out, out_size, \"Action info get error.\");\n \t\t\t\treturn;\n@@ -2410,13 +2410,13 @@ cmd_pipeline_stats(char **tokens,\n \t\t};\n \t\tuint32_t j;\n \n-\t\tstatus = rte_swx_ctl_learner_info_get(p->p, i, &learner_info);\n+\t\tstatus = rte_swx_ctl_learner_info_get(p, i, &learner_info);\n \t\tif (status) {\n \t\t\tsnprintf(out, out_size, \"Learner table info get error.\");\n \t\t\treturn;\n \t\t}\n \n-\t\tstatus = rte_swx_ctl_pipeline_learner_stats_read(p->p, learner_info.name, &stats);\n+\t\tstatus = rte_swx_ctl_pipeline_learner_stats_read(p, learner_info.name, &stats);\n \t\tif (status) {\n \t\t\tsnprintf(out, out_size, \"Learner table stats read error.\");\n \t\t\treturn;\n@@ -2442,7 +2442,7 @@ cmd_pipeline_stats(char **tokens,\n \t\tfor (j = 0; j < info.n_actions; j++) {\n \t\t\tstruct rte_swx_ctl_action_info action_info;\n \n-\t\t\tstatus = rte_swx_ctl_action_info_get(p->p, j, &action_info);\n+\t\t\tstatus = rte_swx_ctl_action_info_get(p, j, &action_info);\n \t\t\tif (status) {\n \t\t\t\tsnprintf(out, out_size, \"Action info get error.\");\n \t\t\t\treturn;\n@@ -2466,10 +2466,10 @@ cmd_pipeline_mirror_session(char **tokens,\n \tuint32_t n_tokens,\n \tchar *out,\n \tsize_t out_size,\n-\tvoid *obj)\n+\tvoid *obj __rte_unused)\n {\n \tstruct rte_swx_pipeline_mirroring_session_params params;\n-\tstruct pipeline *p;\n+\tstruct rte_swx_pipeline *p;\n \tuint32_t session_id = 0;\n \tint status;\n \n@@ -2483,8 +2483,8 @@ cmd_pipeline_mirror_session(char **tokens,\n \t\treturn;\n \t}\n \n-\tp = pipeline_find(obj, tokens[1]);\n-\tif (!p || !p->ctl) {\n+\tp = rte_swx_pipeline_find(tokens[1]);\n+\tif (!p) {\n \t\tsnprintf(out, out_size, MSG_ARG_INVALID, \"pipeline_name\");\n \t\treturn;\n \t}\n@@ -2538,7 +2538,7 @@ cmd_pipeline_mirror_session(char **tokens,\n \t\treturn;\n \t}\n \n-\tstatus = rte_swx_ctl_pipeline_mirroring_session_set(p->p, session_id, ¶ms);\n+\tstatus = rte_swx_ctl_pipeline_mirroring_session_set(p, session_id, ¶ms);\n \tif (status) {\n \t\tsnprintf(out, out_size, \"Command failed!\\n\");\n \t\treturn;\n@@ -2546,21 +2546,25 @@ cmd_pipeline_mirror_session(char **tokens,\n }\n \n static const char cmd_thread_pipeline_enable_help[] =\n-\"thread <thread_id> pipeline <pipeline_name> enable\\n\";\n+\"thread <thread_id> pipeline <pipeline_name> enable [ period <timer_period_ms> ]\\n\";\n+\n+#ifndef TIMER_PERIOD_MS_DEFAULT\n+#define TIMER_PERIOD_MS_DEFAULT 10\n+#endif\n \n static void\n cmd_thread_pipeline_enable(char **tokens,\n \tuint32_t n_tokens,\n \tchar *out,\n \tsize_t out_size,\n-\tvoid *obj)\n+\tvoid *obj __rte_unused)\n {\n \tchar *pipeline_name;\n-\tstruct pipeline *p;\n-\tuint32_t thread_id;\n+\tstruct rte_swx_pipeline *p;\n+\tuint32_t thread_id, timer_period_ms = TIMER_PERIOD_MS_DEFAULT;\n \tint status;\n \n-\tif (n_tokens != 5) {\n+\tif ((n_tokens != 5) && (n_tokens != 7)) {\n \t\tsnprintf(out, out_size, MSG_ARG_MISMATCH, tokens[0]);\n \t\treturn;\n \t}\n@@ -2576,8 +2580,8 @@ cmd_thread_pipeline_enable(char **tokens,\n \t}\n \n \tpipeline_name = tokens[3];\n-\tp = pipeline_find(obj, pipeline_name);\n-\tif (!p || !p->ctl) {\n+\tp = rte_swx_pipeline_find(pipeline_name);\n+\tif (!p) {\n \t\tsnprintf(out, out_size, MSG_ARG_INVALID, \"pipeline_name\");\n \t\treturn;\n \t}\n@@ -2587,7 +2591,19 @@ cmd_thread_pipeline_enable(char **tokens,\n \t\treturn;\n \t}\n \n-\tstatus = thread_pipeline_enable(thread_id, obj, pipeline_name);\n+\tif (n_tokens == 7) {\n+\t\tif (strcmp(tokens[5], \"period\") != 0) {\n+\t\t\tsnprintf(out, out_size, MSG_ARG_NOT_FOUND, \"period\");\n+\t\t\treturn;\n+\t\t}\n+\n+\t\tif (parser_read_uint32(&timer_period_ms, tokens[6]) != 0) {\n+\t\t\tsnprintf(out, out_size, MSG_ARG_INVALID, \"timer_period_ms\");\n+\t\t\treturn;\n+\t\t}\n+\t}\n+\n+\tstatus = thread_pipeline_enable(thread_id, p, timer_period_ms);\n \tif (status) {\n \t\tsnprintf(out, out_size, MSG_CMD_FAIL, \"thread pipeline enable\");\n \t\treturn;\n@@ -2602,9 +2618,9 @@ cmd_thread_pipeline_disable(char **tokens,\n \tuint32_t n_tokens,\n \tchar *out,\n \tsize_t out_size,\n-\tvoid *obj)\n+\tvoid *obj __rte_unused)\n {\n-\tstruct pipeline *p;\n+\tstruct rte_swx_pipeline *p;\n \tchar *pipeline_name;\n \tuint32_t thread_id;\n \tint status;\n@@ -2625,8 +2641,8 @@ cmd_thread_pipeline_disable(char **tokens,\n \t}\n \n \tpipeline_name = tokens[3];\n-\tp = pipeline_find(obj, pipeline_name);\n-\tif (!p || !p->ctl) {\n+\tp = rte_swx_pipeline_find(pipeline_name);\n+\tif (!p) {\n \t\tsnprintf(out, out_size, MSG_ARG_INVALID, \"pipeline_name\");\n \t\treturn;\n \t}\n@@ -2636,7 +2652,7 @@ cmd_thread_pipeline_disable(char **tokens,\n \t\treturn;\n \t}\n \n-\tstatus = thread_pipeline_disable(thread_id, obj, pipeline_name);\n+\tstatus = thread_pipeline_disable(thread_id, p);\n \tif (status) {\n \t\tsnprintf(out, out_size, MSG_CMD_FAIL,\n \t\t\t\"thread pipeline disable\");\ndiff --git a/examples/pipeline/obj.c b/examples/pipeline/obj.c\nindex 967342c580..d1f519180e 100644\n--- a/examples/pipeline/obj.c\n+++ b/examples/pipeline/obj.c\n@@ -16,7 +16,6 @@\n #include <rte_mempool.h>\n #include <rte_mbuf.h>\n #include <rte_ethdev.h>\n-#include <rte_swx_pipeline.h>\n #include <rte_swx_ctl.h>\n \n #include \"obj.h\"\n@@ -41,11 +40,6 @@ TAILQ_HEAD(ring_list, ring);\n */\n TAILQ_HEAD(tap_list, tap);\n \n-/*\n- * pipeline\n- */\n-TAILQ_HEAD(pipeline_list, pipeline);\n-\n /*\n * obj\n */\n@@ -53,7 +47,6 @@ struct obj {\n \tstruct mempool_list mempool_list;\n \tstruct link_list link_list;\n \tstruct ring_list ring_list;\n-\tstruct pipeline_list pipeline_list;\n \tstruct tap_list tap_list;\n };\n \n@@ -513,65 +506,6 @@ tap_create(struct obj *obj, const char *name)\n \n #endif\n \n-/*\n- * pipeline\n- */\n-#ifndef PIPELINE_MSGQ_SIZE\n-#define PIPELINE_MSGQ_SIZE 64\n-#endif\n-\n-struct pipeline *\n-pipeline_create(struct obj *obj, const char *name, int numa_node)\n-{\n-\tstruct pipeline *pipeline;\n-\tstruct rte_swx_pipeline *p = NULL;\n-\tint status;\n-\n-\t/* Check input params */\n-\tif ((name == NULL) ||\n-\t\tpipeline_find(obj, name))\n-\t\treturn NULL;\n-\n-\t/* Resource create */\n-\tstatus = rte_swx_pipeline_config(&p, name, numa_node);\n-\tif (status)\n-\t\tgoto error;\n-\n-\t/* Node allocation */\n-\tpipeline = calloc(1, sizeof(struct pipeline));\n-\tif (pipeline == NULL)\n-\t\tgoto error;\n-\n-\t/* Node fill in */\n-\tstrlcpy(pipeline->name, name, sizeof(pipeline->name));\n-\tpipeline->p = p;\n-\tpipeline->timer_period_ms = 10;\n-\n-\t/* Node add to list */\n-\tTAILQ_INSERT_TAIL(&obj->pipeline_list, pipeline, node);\n-\n-\treturn pipeline;\n-\n-error:\n-\trte_swx_pipeline_free(p);\n-\treturn NULL;\n-}\n-\n-struct pipeline *\n-pipeline_find(struct obj *obj, const char *name)\n-{\n-\tstruct pipeline *pipeline;\n-\n-\tif (!obj || !name)\n-\t\treturn NULL;\n-\n-\tTAILQ_FOREACH(pipeline, &obj->pipeline_list, node)\n-\t\tif (strcmp(name, pipeline->name) == 0)\n-\t\t\treturn pipeline;\n-\n-\treturn NULL;\n-}\n-\n /*\n * obj\n */\n@@ -587,7 +521,6 @@ obj_init(void)\n \tTAILQ_INIT(&obj->mempool_list);\n \tTAILQ_INIT(&obj->link_list);\n \tTAILQ_INIT(&obj->ring_list);\n-\tTAILQ_INIT(&obj->pipeline_list);\n \tTAILQ_INIT(&obj->tap_list);\n \n \treturn obj;\ndiff --git a/examples/pipeline/obj.h b/examples/pipeline/obj.h\nindex b921610554..e63a9c0e9a 100644\n--- a/examples/pipeline/obj.h\n+++ b/examples/pipeline/obj.h\n@@ -143,28 +143,4 @@ tap_next(struct obj *obj, struct tap *tap);\n struct tap *\n tap_create(struct obj *obj, const char *name);\n \n-/*\n- * pipeline\n- */\n-struct pipeline {\n-\tTAILQ_ENTRY(pipeline) node;\n-\tchar name[NAME_SIZE];\n-\n-\tstruct rte_swx_pipeline *p;\n-\tstruct rte_swx_ctl_pipeline *ctl;\n-\n-\tuint32_t timer_period_ms;\n-\tint enabled;\n-\tuint32_t thread_id;\n-\tuint32_t cpu_id;\n-};\n-\n-struct pipeline *\n-pipeline_create(struct obj *obj,\n-\t\tconst char *name,\n-\t\tint numa_node);\n-\n-struct pipeline *\n-pipeline_find(struct obj *obj, const char *name);\n-\n #endif /* _INCLUDE_OBJ_H_ */\ndiff --git a/examples/pipeline/thread.c b/examples/pipeline/thread.c\nindex 5fe7eae00e..6d15f51fb2 100644\n--- a/examples/pipeline/thread.c\n+++ b/examples/pipeline/thread.c\n@@ -228,20 +228,33 @@ thread_msg_send_recv(uint32_t thread_id,\n \treturn rsp;\n }\n \n+static int\n+thread_is_pipeline_enabled(uint32_t thread_id, struct rte_swx_pipeline *p)\n+{\n+\tstruct thread *t = &thread[thread_id];\n+\tstruct thread_data *td = &thread_data[thread_id];\n+\tuint32_t i;\n+\n+\tif (!t->enabled)\n+\t\treturn 0; /* Pipeline NOT enabled on this thread. */\n+\n+\tfor (i = 0; i < td->n_pipelines; i++)\n+\t\tif (td->p[i] == p)\n+\t\t\treturn 1; /* Pipeline enabled on this thread. */\n+\n+\treturn 0 /* Pipeline NOT enabled on this thread. */;\n+}\n+\n int\n-thread_pipeline_enable(uint32_t thread_id,\n-\tstruct obj *obj,\n-\tconst char *pipeline_name)\n+thread_pipeline_enable(uint32_t thread_id, struct rte_swx_pipeline *p, uint32_t timer_period_ms)\n {\n-\tstruct pipeline *p = pipeline_find(obj, pipeline_name);\n \tstruct thread *t;\n \tstruct thread_msg_req *req;\n \tstruct thread_msg_rsp *rsp;\n \tint status;\n \n \t/* Check input params */\n-\tif ((thread_id >= RTE_MAX_LCORE) ||\n-\t\t(p == NULL))\n+\tif ((thread_id >= RTE_MAX_LCORE) || !p || !timer_period_ms)\n \t\treturn -1;\n \n \tt = &thread[thread_id];\n@@ -256,19 +269,14 @@ thread_pipeline_enable(uint32_t thread_id,\n \t\t\treturn -1;\n \n \t\t/* Data plane thread */\n-\t\ttd->p[td->n_pipelines] = p->p;\n+\t\ttd->p[td->n_pipelines] = p;\n \n-\t\ttdp->p = p->p;\n-\t\ttdp->timer_period =\n-\t\t\t(rte_get_tsc_hz() * p->timer_period_ms) / 1000;\n+\t\ttdp->p = p;\n+\t\ttdp->timer_period = (rte_get_tsc_hz() * timer_period_ms) / 1000;\n \t\ttdp->time_next = rte_get_tsc_cycles() + tdp->timer_period;\n \n \t\ttd->n_pipelines++;\n \n-\t\t/* Pipeline */\n-\t\tp->thread_id = thread_id;\n-\t\tp->enabled = 1;\n-\n \t\treturn 0;\n \t}\n \n@@ -279,8 +287,8 @@ thread_pipeline_enable(uint32_t thread_id,\n \n \t/* Write request */\n \treq->type = THREAD_REQ_PIPELINE_ENABLE;\n-\treq->pipeline_enable.p = p->p;\n-\treq->pipeline_enable.timer_period_ms = p->timer_period_ms;\n+\treq->pipeline_enable.p = p;\n+\treq->pipeline_enable.timer_period_ms = timer_period_ms;\n \n \t/* Send request and wait for response */\n \trsp = thread_msg_send_recv(thread_id, req);\n@@ -295,38 +303,28 @@ thread_pipeline_enable(uint32_t thread_id,\n \tif (status)\n \t\treturn status;\n \n-\tp->thread_id = thread_id;\n-\tp->enabled = 1;\n-\n \treturn 0;\n }\n \n int\n-thread_pipeline_disable(uint32_t thread_id,\n-\tstruct obj *obj,\n-\tconst char *pipeline_name)\n+thread_pipeline_disable(uint32_t thread_id, struct rte_swx_pipeline *p)\n {\n-\tstruct pipeline *p = pipeline_find(obj, pipeline_name);\n \tstruct thread *t;\n \tstruct thread_msg_req *req;\n \tstruct thread_msg_rsp *rsp;\n \tint status;\n \n \t/* Check input params */\n-\tif ((thread_id >= RTE_MAX_LCORE) ||\n-\t\t(p == NULL))\n+\tif ((thread_id >= RTE_MAX_LCORE) || !p)\n \t\treturn -1;\n \n \tt = &thread[thread_id];\n \tif (t->enabled == 0)\n \t\treturn -1;\n \n-\tif (p->enabled == 0)\n+\tif (!thread_is_pipeline_enabled(thread_id, p))\n \t\treturn 0;\n \n-\tif (p->thread_id != thread_id)\n-\t\treturn -1;\n-\n \tif (!thread_is_running(thread_id)) {\n \t\tstruct thread_data *td = &thread_data[thread_id];\n \t\tuint32_t i;\n@@ -334,7 +332,7 @@ thread_pipeline_disable(uint32_t thread_id,\n \t\tfor (i = 0; i < td->n_pipelines; i++) {\n \t\t\tstruct pipeline_data *tdp = &td->pipeline_data[i];\n \n-\t\t\tif (tdp->p != p->p)\n+\t\t\tif (tdp->p != p)\n \t\t\t\tcontinue;\n \n \t\t\t/* Data plane thread */\n@@ -350,9 +348,6 @@ thread_pipeline_disable(uint32_t thread_id,\n \n \t\t\ttd->n_pipelines--;\n \n-\t\t\t/* Pipeline */\n-\t\t\tp->enabled = 0;\n-\n \t\t\tbreak;\n \t\t}\n \n@@ -366,7 +361,7 @@ thread_pipeline_disable(uint32_t thread_id,\n \n \t/* Write request */\n \treq->type = THREAD_REQ_PIPELINE_DISABLE;\n-\treq->pipeline_disable.p = p->p;\n+\treq->pipeline_disable.p = p;\n \n \t/* Send request and wait for response */\n \trsp = thread_msg_send_recv(thread_id, req);\n@@ -381,8 +376,6 @@ thread_pipeline_disable(uint32_t thread_id,\n \tif (status)\n \t\treturn status;\n \n-\tp->enabled = 0;\n-\n \treturn 0;\n }\n \ndiff --git a/examples/pipeline/thread.h b/examples/pipeline/thread.h\nindex d9d8645d4c..712cb25bbb 100644\n--- a/examples/pipeline/thread.h\n+++ b/examples/pipeline/thread.h\n@@ -7,17 +7,16 @@\n \n #include <stdint.h>\n \n-#include \"obj.h\"\n+#include <rte_swx_pipeline.h>\n \n int\n thread_pipeline_enable(uint32_t thread_id,\n-\tstruct obj *obj,\n-\tconst char *pipeline_name);\n+\t\t struct rte_swx_pipeline *p,\n+\t\t uint32_t timer_period_ms);\n \n int\n thread_pipeline_disable(uint32_t thread_id,\n-\tstruct obj *obj,\n-\tconst char *pipeline_name);\n+\t\t\tstruct rte_swx_pipeline *p);\n \n int\n thread_init(void);\n", "prefixes": [ "V3", "14/17" ] }{ "id": 114292, "url": "