Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/44575/?format=api
http://patchwork.dpdk.org/api/patches/44575/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/1536675645-10105-8-git-send-email-reshma.pattan@intel.com/", "project": { "id": 1, "url": "http://patchwork.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": "<1536675645-10105-8-git-send-email-reshma.pattan@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1536675645-10105-8-git-send-email-reshma.pattan@intel.com", "date": "2018-09-11T14:20:37", "name": "[v2,07/15] net/softnic: implement flow validate API", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "3baf55a611b75231273de90780548f3a1d995f37", "submitter": { "id": 70, "url": "http://patchwork.dpdk.org/api/people/70/?format=api", "name": "Pattan, Reshma", "email": "reshma.pattan@intel.com" }, "delegate": { "id": 10018, "url": "http://patchwork.dpdk.org/api/users/10018/?format=api", "username": "cristian_dumitrescu", "first_name": "Cristian", "last_name": "Dumitrescu", "email": "cristian.dumitrescu@intel.com" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/1536675645-10105-8-git-send-email-reshma.pattan@intel.com/mbox/", "series": [ { "id": 1273, "url": "http://patchwork.dpdk.org/api/series/1273/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=1273", "date": "2018-09-11T14:20:37", "name": null, "version": 2, "mbox": "http://patchwork.dpdk.org/series/1273/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/44575/comments/", "check": "success", "checks": "http://patchwork.dpdk.org/api/patches/44575/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 [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id C10655B16;\n\tTue, 11 Sep 2018 16:21:03 +0200 (CEST)", "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby dpdk.org (Postfix) with ESMTP id D29505681\n\tfor <dev@dpdk.org>; Tue, 11 Sep 2018 16:20:56 +0200 (CEST)", "from fmsmga007.fm.intel.com ([10.253.24.52])\n\tby fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t11 Sep 2018 07:20:56 -0700", "from sivswdev02.ir.intel.com (HELO localhost.localdomain)\n\t([10.237.217.46])\n\tby fmsmga007.fm.intel.com with ESMTP; 11 Sep 2018 07:20:55 -0700" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.53,360,1531810800\"; d=\"scan'208\";a=\"69156879\"", "From": "Reshma Pattan <reshma.pattan@intel.com>", "To": "dev@dpdk.org", "Cc": "Cristian Dumitrescu <cristian.dumitrescu@intel.com>,\n\tReshma Pattan <reshma.pattan@intel.com>", "Date": "Tue, 11 Sep 2018 15:20:37 +0100", "Message-Id": "<1536675645-10105-8-git-send-email-reshma.pattan@intel.com>", "X-Mailer": "git-send-email 1.7.0.7", "In-Reply-To": "<1536251222-17275-1-git-send-email-reshma.pattan@intel.com>", "References": "<1536251222-17275-1-git-send-email-reshma.pattan@intel.com>", "Subject": "[dpdk-dev] [PATCH v2 07/15] net/softnic: implement flow validate API", "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\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "Start adding flow api operations.\n\nStarted with flow validate api support by adding\nbelow basic infrastructure.\n\nflow_pipeline_table_get()\npmd_flow_validate()\n\nAdditional flow validate changes will be\nadded in next patches.\n\nSigned-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>\nSigned-off-by: Reshma Pattan <reshma.pattan@intel.com>\n---\n drivers/net/softnic/rte_eth_softnic.c | 16 ++++\n drivers/net/softnic/rte_eth_softnic_flow.c | 112 ++++++++++++++++++++++++\n drivers/net/softnic/rte_eth_softnic_internals.h | 2 +\n 3 files changed, 130 insertions(+)", "diff": "diff --git a/drivers/net/softnic/rte_eth_softnic.c b/drivers/net/softnic/rte_eth_softnic.c\nindex 30fb3952a..ae2a4385b 100644\n--- a/drivers/net/softnic/rte_eth_softnic.c\n+++ b/drivers/net/softnic/rte_eth_softnic.c\n@@ -205,6 +205,21 @@ pmd_link_update(struct rte_eth_dev *dev __rte_unused,\n \treturn 0;\n }\n \n+static int\n+pmd_filter_ctrl(struct rte_eth_dev *dev __rte_unused,\n+\t\tenum rte_filter_type filter_type,\n+\t\tenum rte_filter_op filter_op,\n+\t\tvoid *arg)\n+{\n+\tif (filter_type == RTE_ETH_FILTER_GENERIC &&\n+\t\t\tfilter_op == RTE_ETH_FILTER_GET) {\n+\t\t*(const void **)arg = &pmd_flow_ops;\n+\t\treturn 0;\n+\t}\n+\n+\treturn -ENOTSUP;\n+}\n+\n static int\n pmd_tm_ops_get(struct rte_eth_dev *dev __rte_unused, void *arg)\n {\n@@ -222,6 +237,7 @@ static const struct eth_dev_ops pmd_ops = {\n \t.dev_infos_get = pmd_dev_infos_get,\n \t.rx_queue_setup = pmd_rx_queue_setup,\n \t.tx_queue_setup = pmd_tx_queue_setup,\n+\t.filter_ctrl = pmd_filter_ctrl,\n \t.tm_ops_get = pmd_tm_ops_get,\n };\n \ndiff --git a/drivers/net/softnic/rte_eth_softnic_flow.c b/drivers/net/softnic/rte_eth_softnic_flow.c\nindex 843db7590..f37890333 100644\n--- a/drivers/net/softnic/rte_eth_softnic_flow.c\n+++ b/drivers/net/softnic/rte_eth_softnic_flow.c\n@@ -44,3 +44,115 @@ flow_attr_map_get(struct pmd_internals *softnic,\n \treturn (ingress) ? &softnic->flow.ingress_map[group_id] :\n \t\t&softnic->flow.egress_map[group_id];\n }\n+\n+static int\n+flow_pipeline_table_get(struct pmd_internals *softnic,\n+\t\tconst struct rte_flow_attr *attr,\n+\t\tconst char **pipeline_name,\n+\t\tuint32_t *table_id,\n+\t\tstruct rte_flow_error *error)\n+{\n+\tstruct flow_attr_map *map;\n+\n+\tif (attr == NULL)\n+\t\treturn rte_flow_error_set(error,\n+\t\t\t\tEINVAL,\n+\t\t\t\tRTE_FLOW_ERROR_TYPE_ATTR,\n+\t\t\t\tNULL,\n+\t\t\t\t\"Null attr\");\n+\n+\tif (!attr->ingress && !attr->egress)\n+\t\treturn rte_flow_error_set(error,\n+\t\t\t\tEINVAL,\n+\t\t\t\tRTE_FLOW_ERROR_TYPE_ATTR_INGRESS,\n+\t\t\t\tattr,\n+\t\t\t\t\"Ingress/egress not specified\");\n+\n+\tif (attr->ingress && attr->egress)\n+\t\treturn rte_flow_error_set(error,\n+\t\t\t\tEINVAL,\n+\t\t\t\tRTE_FLOW_ERROR_TYPE_ATTR_INGRESS,\n+\t\t\t\tattr,\n+\t\t\t\t\"Setting both ingress and egress is not allowed\");\n+\n+\tmap = flow_attr_map_get(softnic,\n+\t\t\tattr->group,\n+\t\t\tattr->ingress);\n+\tif (map == NULL ||\n+\t\t\tmap->valid == 0)\n+\t\treturn rte_flow_error_set(error,\n+\t\t\t\tEINVAL,\n+\t\t\t\tRTE_FLOW_ERROR_TYPE_ATTR_GROUP,\n+\t\t\t\tattr,\n+\t\t\t\t\"Invalid group ID\");\n+\n+\tif (pipeline_name)\n+\t\t*pipeline_name = map->pipeline_name;\n+\n+\tif (table_id)\n+\t\t*table_id = map->table_id;\n+\n+\treturn 0;\n+}\n+\n+static int\n+pmd_flow_validate(struct rte_eth_dev *dev,\n+\t\tconst struct rte_flow_attr *attr,\n+\t\tconst struct rte_flow_item item[],\n+\t\tconst struct rte_flow_action action[],\n+\t\tstruct rte_flow_error *error)\n+{\n+\tstruct pmd_internals *softnic = dev->data->dev_private;\n+\tstruct pipeline *pipeline;\n+\tconst char *pipeline_name = NULL;\n+\tuint32_t table_id = 0;\n+\tint status;\n+\n+\t/* Check input parameters. */\n+\tif (attr == NULL)\n+\t\treturn rte_flow_error_set(error,\n+\t\t\t\tEINVAL,\n+\t\t\t\tRTE_FLOW_ERROR_TYPE_ATTR,\n+\t\t\t\tNULL, \"Null attr\");\n+\n+\tif (item == NULL)\n+\t\treturn rte_flow_error_set(error,\n+\t\t\t\tEINVAL,\n+\t\t\t\tRTE_FLOW_ERROR_TYPE_ITEM,\n+\t\t\t\tNULL,\n+\t\t\t\t\"Null item\");\n+\n+\tif (action == NULL)\n+\t\treturn rte_flow_error_set(error,\n+\t\t\t\tEINVAL,\n+\t\t\t\tRTE_FLOW_ERROR_TYPE_ACTION,\n+\t\t\t\tNULL,\n+\t\t\t\t\"Null action\");\n+\n+\t/* Identify the pipeline table to add this flow to. */\n+\tstatus = flow_pipeline_table_get(softnic, attr, &pipeline_name,\n+\t\t\t\t\t&table_id, error);\n+\tif (status)\n+\t\treturn status;\n+\n+\tpipeline = softnic_pipeline_find(softnic, pipeline_name);\n+\tif (pipeline == NULL)\n+\t\treturn rte_flow_error_set(error,\n+\t\t\t\tEINVAL,\n+\t\t\t\tRTE_FLOW_ERROR_TYPE_UNSPECIFIED,\n+\t\t\t\tNULL,\n+\t\t\t\t\"Invalid pipeline name\");\n+\n+\tif (table_id >= pipeline->n_tables)\n+\t\treturn rte_flow_error_set(error,\n+\t\t\t\tEINVAL,\n+\t\t\t\tRTE_FLOW_ERROR_TYPE_UNSPECIFIED,\n+\t\t\t\tNULL,\n+\t\t\t\t\"Invalid pipeline table ID\");\n+\n+\treturn 0;\n+}\n+\n+const struct rte_flow_ops pmd_flow_ops = {\n+\t.validate = pmd_flow_validate,\n+};\ndiff --git a/drivers/net/softnic/rte_eth_softnic_internals.h b/drivers/net/softnic/rte_eth_softnic_internals.h\nindex 1857ec50d..a1a2e1558 100644\n--- a/drivers/net/softnic/rte_eth_softnic_internals.h\n+++ b/drivers/net/softnic/rte_eth_softnic_internals.h\n@@ -569,6 +569,8 @@ flow_attr_map_get(struct pmd_internals *softnic,\n \t\tuint32_t group_id,\n \t\tint ingress);\n \n+extern const struct rte_flow_ops pmd_flow_ops;\n+\n /**\n * MEMPOOL\n */\n", "prefixes": [ "v2", "07/15" ] }{ "id": 44575, "url": "