get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/115510/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 115510,
    "url": "https://patches.dpdk.org/api/patches/115510/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20220826131737.1741743-4-cristian.dumitrescu@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": "<20220826131737.1741743-4-cristian.dumitrescu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220826131737.1741743-4-cristian.dumitrescu@intel.com",
    "date": "2022-08-26T13:17:19",
    "name": "[V2,03/21] net/softnic: remove the meter support",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "b43249a7434b73dde2f9b90d513a2b384cb759c1",
    "submitter": {
        "id": 19,
        "url": "https://patches.dpdk.org/api/people/19/?format=api",
        "name": "Cristian Dumitrescu",
        "email": "cristian.dumitrescu@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20220826131737.1741743-4-cristian.dumitrescu@intel.com/mbox/",
    "series": [
        {
            "id": 24429,
            "url": "https://patches.dpdk.org/api/series/24429/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=24429",
            "date": "2022-08-26T13:17:16",
            "name": "net/softnic: replace the legacy pipeline with SWX pipeline",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/24429/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/115510/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/115510/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 C575AA0550;\n\tFri, 26 Aug 2022 15:18:20 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id B292E40693;\n\tFri, 26 Aug 2022 15:18:03 +0200 (CEST)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n by mails.dpdk.org (Postfix) with ESMTP id 4208D40146\n for <dev@dpdk.org>; Fri, 26 Aug 2022 15:17:59 +0200 (CEST)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 26 Aug 2022 06:17:42 -0700",
            "from silpixa00400573.ir.intel.com (HELO\n silpixa00400573.ger.corp.intel.com.) ([10.237.223.157])\n by orsmga002.jf.intel.com with ESMTP; 26 Aug 2022 06:17:41 -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=1661519879; x=1693055879;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=0SHXydqNuJHPkP4rbNsDBy2cHD2oK9rRF0WI7AJ9OJQ=;\n b=Fc2rGOue46D55hcbZ23New3nGzLxzw5LLYMMlypXM328ZGml5xQ3t6Bm\n RQ5wfiIqW5KcDpJ+1/t+JfgBkx45WGbwrbdHT7KZUkVojXuikRDjw7Ryc\n QUNIqBZDTabeJxesSN6IjioSgzGwLKgVxyz9VUW87bugKIofkVAw2r8oe\n 5jUeypzaQVXyrY3hIl7q8Z6AA4kNomX/W1OHR5cwFQeqlDvapjOFehMSh\n z0N4eMY5EOqfQUeHc1uwjnwc2jL89zvm23LBJZtM/By3xZHBgUDEdvi5T\n nivGCU1N2K8SX9A5MPP6tOww6OPbvya42fZ84eGf84IJfluJfWXHfnEYB Q==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6500,9779,10450\"; a=\"320598549\"",
            "E=Sophos;i=\"5.93,265,1654585200\"; d=\"scan'208\";a=\"320598549\"",
            "E=Sophos;i=\"5.93,265,1654585200\"; d=\"scan'208\";a=\"610561579\""
        ],
        "X-ExtLoop1": "1",
        "From": "Cristian Dumitrescu <cristian.dumitrescu@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "Yogesh Jangra <yogesh.jangra@intel.com>",
        "Subject": "[PATCH V2 03/21] net/softnic: remove the meter support",
        "Date": "Fri, 26 Aug 2022 13:17:19 +0000",
        "Message-Id": "<20220826131737.1741743-4-cristian.dumitrescu@intel.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "In-Reply-To": "<20220826131737.1741743-1-cristian.dumitrescu@intel.com>",
        "References": "<20220804165839.1074817-1-cristian.dumitrescu@intel.com>\n <20220826131737.1741743-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": "Remove the Ethernet device meter API support.\n\nSigned-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>\nSigned-off-by: Yogesh Jangra <yogesh.jangra@intel.com>\n---\n drivers/net/softnic/meson.build               |   1 -\n drivers/net/softnic/rte_eth_softnic.c         |  16 -\n .../net/softnic/rte_eth_softnic_internals.h   | 117 ---\n drivers/net/softnic/rte_eth_softnic_meter.c   | 945 ------------------\n .../net/softnic/rte_eth_softnic_pipeline.c    |  12 -\n 5 files changed, 1091 deletions(-)\n delete mode 100644 drivers/net/softnic/rte_eth_softnic_meter.c",
    "diff": "diff --git a/drivers/net/softnic/meson.build b/drivers/net/softnic/meson.build\nindex 4ebe60921c..d466dc7700 100644\n--- a/drivers/net/softnic/meson.build\n+++ b/drivers/net/softnic/meson.build\n@@ -15,7 +15,6 @@ sources = files(\n         'rte_eth_softnic_cryptodev.c',\n         'rte_eth_softnic_link.c',\n         'rte_eth_softnic_mempool.c',\n-        'rte_eth_softnic_meter.c',\n         'rte_eth_softnic_pipeline.c',\n         'rte_eth_softnic_swq.c',\n         'rte_eth_softnic_tap.c',\ndiff --git a/drivers/net/softnic/rte_eth_softnic.c b/drivers/net/softnic/rte_eth_softnic.c\nindex 8e361adbad..a7136bb0c0 100644\n--- a/drivers/net/softnic/rte_eth_softnic.c\n+++ b/drivers/net/softnic/rte_eth_softnic.c\n@@ -13,7 +13,6 @@\n #include <rte_kvargs.h>\n #include <rte_errno.h>\n #include <rte_ring.h>\n-#include <rte_mtr_driver.h>\n \n #include \"rte_eth_softnic.h\"\n #include \"rte_eth_softnic_internals.h\"\n@@ -168,8 +167,6 @@ pmd_dev_stop(struct rte_eth_dev *dev)\n \tsoftnic_softnic_swq_free_keep_rxq_txq(p);\n \tsoftnic_mempool_free(p);\n \n-\tsoftnic_mtr_free(p);\n-\n \treturn 0;\n }\n \n@@ -191,8 +188,6 @@ pmd_free(struct pmd_internals *p)\n \tsoftnic_swq_free(p);\n \tsoftnic_mempool_free(p);\n \n-\tsoftnic_mtr_free(p);\n-\n \trte_free(p);\n }\n \n@@ -215,14 +210,6 @@ pmd_link_update(struct rte_eth_dev *dev __rte_unused,\n \treturn 0;\n }\n \n-static int\n-pmd_mtr_ops_get(struct rte_eth_dev *dev __rte_unused, void *arg)\n-{\n-\t*(const struct rte_mtr_ops **)arg = &pmd_mtr_ops;\n-\n-\treturn 0;\n-}\n-\n static const struct eth_dev_ops pmd_ops = {\n \t.dev_configure = pmd_dev_configure,\n \t.dev_start = pmd_dev_start,\n@@ -232,7 +219,6 @@ 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.mtr_ops_get = pmd_mtr_ops_get,\n };\n \n static uint16_t\n@@ -274,8 +260,6 @@ pmd_init(struct pmd_params *params)\n \tmemcpy(&p->params, params, sizeof(p->params));\n \n \t/* Resources */\n-\tsoftnic_mtr_init(p);\n-\n \tsoftnic_mempool_init(p);\n \tsoftnic_swq_init(p);\n \tsoftnic_link_init(p);\ndiff --git a/drivers/net/softnic/rte_eth_softnic_internals.h b/drivers/net/softnic/rte_eth_softnic_internals.h\nindex 4cc98b7aad..d578cb1f25 100644\n--- a/drivers/net/softnic/rte_eth_softnic_internals.h\n+++ b/drivers/net/softnic/rte_eth_softnic_internals.h\n@@ -19,8 +19,6 @@\n \n #include <rte_ethdev_core.h>\n #include <ethdev_driver.h>\n-#include <rte_flow_driver.h>\n-#include <rte_mtr_driver.h>\n \n #include \"rte_eth_softnic.h\"\n #include \"conn.h\"\n@@ -40,68 +38,6 @@ struct pmd_params {\n \tint sc; /**< Service cores. */\n };\n \n-/**\n- * Ethdev Flow API\n- */\n-struct rte_flow;\n-\n-TAILQ_HEAD(flow_list, rte_flow);\n-\n-struct flow_attr_map {\n-\tchar pipeline_name[NAME_SIZE];\n-\tuint32_t table_id;\n-\tint valid;\n-};\n-\n-#ifndef SOFTNIC_FLOW_MAX_GROUPS\n-#define SOFTNIC_FLOW_MAX_GROUPS                            64\n-#endif\n-\n-struct flow_internals {\n-\tstruct flow_attr_map ingress_map[SOFTNIC_FLOW_MAX_GROUPS];\n-\tstruct flow_attr_map egress_map[SOFTNIC_FLOW_MAX_GROUPS];\n-};\n-\n-/**\n- * Meter\n- */\n-\n-/* MTR meter profile */\n-struct softnic_mtr_meter_profile {\n-\tTAILQ_ENTRY(softnic_mtr_meter_profile) node;\n-\tuint32_t meter_profile_id;\n-\tstruct rte_mtr_meter_profile params;\n-\tuint32_t n_users;\n-};\n-\n-TAILQ_HEAD(softnic_mtr_meter_profile_list, softnic_mtr_meter_profile);\n-\n-/* MTR meter policy */\n-struct softnic_mtr_meter_policy {\n-\tTAILQ_ENTRY(softnic_mtr_meter_policy) node;\n-\tuint32_t meter_policy_id;\n-\tenum rte_table_action_policer policer[RTE_COLORS];\n-\tuint32_t n_users;\n-};\n-\n-TAILQ_HEAD(softnic_mtr_meter_policy_list, softnic_mtr_meter_policy);\n-\n-/* MTR meter object */\n-struct softnic_mtr {\n-\tTAILQ_ENTRY(softnic_mtr) node;\n-\tuint32_t mtr_id;\n-\tstruct rte_mtr_params params;\n-\tstruct rte_flow *flow;\n-};\n-\n-TAILQ_HEAD(softnic_mtr_list, softnic_mtr);\n-\n-struct mtr_internals {\n-\tstruct softnic_mtr_meter_profile_list meter_profiles;\n-\tstruct softnic_mtr_meter_policy_list meter_policies;\n-\tstruct softnic_mtr_list mtrs;\n-};\n-\n /**\n  * MEMPOOL\n  */\n@@ -383,7 +319,6 @@ struct softnic_table {\n \tstruct softnic_table_params params;\n \tstruct softnic_table_action_profile *ap;\n \tstruct rte_table_action *a;\n-\tstruct flow_list flows;\n \tstruct rte_table_action_dscp_table dscp_table;\n \tstruct softnic_table_meter_profile_list meter_profiles;\n };\n@@ -481,9 +416,6 @@ struct pmd_internals {\n \t/** Params */\n \tstruct pmd_params params;\n \n-\tstruct flow_internals flow;\n-\tstruct mtr_internals mtr;\n-\n \tstruct softnic_conn *conn;\n \tstruct softnic_mempool_list mempool_list;\n \tstruct softnic_swq_list swq_list;\n@@ -513,46 +445,6 @@ ETHDEV(struct pmd_internals *softnic)\n \treturn &rte_eth_devices[port_id];\n }\n \n-/**\n- * Ethdev Flow API\n- */\n-int\n-flow_attr_map_set(struct pmd_internals *softnic,\n-\t\tuint32_t group_id,\n-\t\tint ingress,\n-\t\tconst char *pipeline_name,\n-\t\tuint32_t table_id);\n-\n-struct flow_attr_map *\n-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- * Meter\n- */\n-int\n-softnic_mtr_init(struct pmd_internals *p);\n-\n-void\n-softnic_mtr_free(struct pmd_internals *p);\n-\n-struct softnic_mtr *\n-softnic_mtr_find(struct pmd_internals *p,\n-\tuint32_t mtr_id);\n-\n-struct softnic_mtr_meter_profile *\n-softnic_mtr_meter_profile_find(struct pmd_internals *p,\n-\tuint32_t meter_profile_id);\n-\n-struct softnic_mtr_meter_policy *\n-softnic_mtr_meter_policy_find(struct pmd_internals *p,\n-\tuint32_t meter_policy_id);\n-\n-extern const struct rte_mtr_ops pmd_mtr_ops;\n-\n /**\n  * MEMPOOL\n  */\n@@ -814,15 +706,6 @@ struct softnic_table_rule_action {\n \tuint8_t sym_crypto_key[SYM_CRYPTO_MAX_KEY_SIZE];\n };\n \n-struct rte_flow {\n-\tTAILQ_ENTRY(rte_flow) node;\n-\tstruct softnic_table_rule_match match;\n-\tstruct softnic_table_rule_action action;\n-\tvoid *data;\n-\tstruct pipeline *pipeline;\n-\tuint32_t table_id;\n-};\n-\n int\n softnic_pipeline_port_in_stats_read(struct pmd_internals *p,\n \tconst char *pipeline_name,\ndiff --git a/drivers/net/softnic/rte_eth_softnic_meter.c b/drivers/net/softnic/rte_eth_softnic_meter.c\ndeleted file mode 100644\nindex 6b02f43e31..0000000000\n--- a/drivers/net/softnic/rte_eth_softnic_meter.c\n+++ /dev/null\n@@ -1,945 +0,0 @@\n-/* SPDX-License-Identifier: BSD-3-Clause\n- * Copyright(c) 2018 Intel Corporation\n- */\n-\n-#include <stdint.h>\n-#include <stdlib.h>\n-#include <string.h>\n-\n-#include <rte_mtr.h>\n-#include <rte_mtr_driver.h>\n-\n-#include \"rte_eth_softnic_internals.h\"\n-\n-int\n-softnic_mtr_init(struct pmd_internals *p)\n-{\n-\t/* Initialize meter profiles list */\n-\tTAILQ_INIT(&p->mtr.meter_profiles);\n-\n-\t/* Initialize meter policies list */\n-\tTAILQ_INIT(&p->mtr.meter_policies);\n-\n-\t/* Initialize MTR objects list */\n-\tTAILQ_INIT(&p->mtr.mtrs);\n-\n-\treturn 0;\n-}\n-\n-void\n-softnic_mtr_free(struct pmd_internals *p)\n-{\n-\t/* Remove MTR objects */\n-\tfor ( ; ; ) {\n-\t\tstruct softnic_mtr *m;\n-\n-\t\tm = TAILQ_FIRST(&p->mtr.mtrs);\n-\t\tif (m == NULL)\n-\t\t\tbreak;\n-\n-\t\tTAILQ_REMOVE(&p->mtr.mtrs, m, node);\n-\t\tfree(m);\n-\t}\n-\n-\t/* Remove meter profiles */\n-\tfor ( ; ; ) {\n-\t\tstruct softnic_mtr_meter_profile *mp;\n-\n-\t\tmp = TAILQ_FIRST(&p->mtr.meter_profiles);\n-\t\tif (mp == NULL)\n-\t\t\tbreak;\n-\n-\t\tTAILQ_REMOVE(&p->mtr.meter_profiles, mp, node);\n-\t\tfree(mp);\n-\t}\n-\n-\t/* Remove meter policies */\n-\tfor ( ; ; ) {\n-\t\tstruct softnic_mtr_meter_policy *mp;\n-\n-\t\tmp = TAILQ_FIRST(&p->mtr.meter_policies);\n-\t\tif (mp == NULL)\n-\t\t\tbreak;\n-\n-\t\tTAILQ_REMOVE(&p->mtr.meter_policies, mp, node);\n-\t\tfree(mp);\n-\t}\n-}\n-\n-struct softnic_mtr_meter_profile *\n-softnic_mtr_meter_profile_find(struct pmd_internals *p,\n-\tuint32_t meter_profile_id)\n-{\n-\tstruct softnic_mtr_meter_profile_list *mpl = &p->mtr.meter_profiles;\n-\tstruct softnic_mtr_meter_profile *mp;\n-\n-\tTAILQ_FOREACH(mp, mpl, node)\n-\t\tif (meter_profile_id == mp->meter_profile_id)\n-\t\t\treturn mp;\n-\n-\treturn NULL;\n-}\n-\n-static int\n-meter_profile_check(struct rte_eth_dev *dev,\n-\tuint32_t meter_profile_id,\n-\tstruct rte_mtr_meter_profile *profile,\n-\tstruct rte_mtr_error *error)\n-{\n-\tstruct pmd_internals *p = dev->data->dev_private;\n-\tstruct softnic_mtr_meter_profile *mp;\n-\n-\t/* Meter profile ID must be valid. */\n-\tif (meter_profile_id == UINT32_MAX)\n-\t\treturn -rte_mtr_error_set(error,\n-\t\t\tEINVAL,\n-\t\t\tRTE_MTR_ERROR_TYPE_METER_PROFILE_ID,\n-\t\t\tNULL,\n-\t\t\t\"Meter profile id not valid\");\n-\n-\t/* Meter profile must not exist. */\n-\tmp = softnic_mtr_meter_profile_find(p, meter_profile_id);\n-\tif (mp)\n-\t\treturn -rte_mtr_error_set(error,\n-\t\t\tEEXIST,\n-\t\t\tRTE_MTR_ERROR_TYPE_METER_PROFILE_ID,\n-\t\t\tNULL,\n-\t\t\t\"Meter prfile already exists\");\n-\n-\t/* Profile must not be NULL. */\n-\tif (profile == NULL)\n-\t\treturn -rte_mtr_error_set(error,\n-\t\t\tEINVAL,\n-\t\t\tRTE_MTR_ERROR_TYPE_METER_PROFILE,\n-\t\t\tNULL,\n-\t\t\t\"profile null\");\n-\n-\t/* Traffic metering algorithm : TRTCM_RFC2698 */\n-\tif (profile->alg != RTE_MTR_TRTCM_RFC2698)\n-\t\treturn -rte_mtr_error_set(error,\n-\t\t\tEINVAL,\n-\t\t\tRTE_MTR_ERROR_TYPE_METER_PROFILE,\n-\t\t\tNULL,\n-\t\t\t\"Metering alg not supported\");\n-\n-\t/* Not support packet mode, just support byte mode. */\n-\tif (profile->packet_mode)\n-\t\treturn -rte_mtr_error_set(error,\n-\t\t\tEINVAL,\n-\t\t\tRTE_MTR_ERROR_TYPE_METER_PROFILE_PACKET_MODE,\n-\t\t\tNULL,\n-\t\t\t\"Meter packet mode not supported\");\n-\n-\treturn 0;\n-}\n-\n-/* MTR meter profile add */\n-static int\n-pmd_mtr_meter_profile_add(struct rte_eth_dev *dev,\n-\tuint32_t meter_profile_id,\n-\tstruct rte_mtr_meter_profile *profile,\n-\tstruct rte_mtr_error *error)\n-{\n-\tstruct pmd_internals *p = dev->data->dev_private;\n-\tstruct softnic_mtr_meter_profile_list *mpl = &p->mtr.meter_profiles;\n-\tstruct softnic_mtr_meter_profile *mp;\n-\tint status;\n-\n-\t/* Check input params */\n-\tstatus = meter_profile_check(dev, meter_profile_id, profile, error);\n-\tif (status)\n-\t\treturn status;\n-\n-\t/* Memory allocation */\n-\tmp = calloc(1, sizeof(struct softnic_mtr_meter_profile));\n-\tif (mp == NULL)\n-\t\treturn -rte_mtr_error_set(error,\n-\t\t\tENOMEM,\n-\t\t\tRTE_MTR_ERROR_TYPE_UNSPECIFIED,\n-\t\t\tNULL,\n-\t\t\t\"Memory alloc failed\");\n-\n-\t/* Fill in */\n-\tmp->meter_profile_id = meter_profile_id;\n-\tmemcpy(&mp->params, profile, sizeof(mp->params));\n-\n-\t/* Add to list */\n-\tTAILQ_INSERT_TAIL(mpl, mp, node);\n-\n-\treturn 0;\n-}\n-\n-/* MTR meter profile delete */\n-static int\n-pmd_mtr_meter_profile_delete(struct rte_eth_dev *dev,\n-\tuint32_t meter_profile_id,\n-\tstruct rte_mtr_error *error)\n-{\n-\tstruct pmd_internals *p = dev->data->dev_private;\n-\tstruct softnic_mtr_meter_profile *mp;\n-\n-\t/* Meter profile must exist */\n-\tmp = softnic_mtr_meter_profile_find(p, meter_profile_id);\n-\tif (mp == NULL)\n-\t\treturn -rte_mtr_error_set(error,\n-\t\t\tEINVAL,\n-\t\t\tRTE_MTR_ERROR_TYPE_METER_PROFILE_ID,\n-\t\t\tNULL,\n-\t\t\t\"Meter profile id invalid\");\n-\n-\t/* Check unused */\n-\tif (mp->n_users)\n-\t\treturn -rte_mtr_error_set(error,\n-\t\t\tEBUSY,\n-\t\t\tRTE_MTR_ERROR_TYPE_METER_PROFILE_ID,\n-\t\t\tNULL,\n-\t\t\t\"Meter profile in use\");\n-\n-\t/* Remove from list */\n-\tTAILQ_REMOVE(&p->mtr.meter_profiles, mp, node);\n-\tfree(mp);\n-\n-\treturn 0;\n-}\n-\n-struct softnic_mtr_meter_policy *\n-softnic_mtr_meter_policy_find(struct pmd_internals *p,\n-\tuint32_t meter_policy_id)\n-{\n-\tstruct softnic_mtr_meter_policy_list *mpl = &p->mtr.meter_policies;\n-\tstruct softnic_mtr_meter_policy *mp;\n-\n-\tTAILQ_FOREACH(mp, mpl, node)\n-\t\tif (meter_policy_id == mp->meter_policy_id)\n-\t\t\treturn mp;\n-\n-\treturn NULL;\n-}\n-\n-/* MTR meter policy add */\n-static int\n-pmd_mtr_meter_policy_add(struct rte_eth_dev *dev,\n-\tuint32_t meter_policy_id,\n-\tstruct rte_mtr_meter_policy_params *policy,\n-\tstruct rte_mtr_error *error)\n-{\n-\tstruct pmd_internals *p = dev->data->dev_private;\n-\tstruct softnic_mtr_meter_policy_list *mpl = &p->mtr.meter_policies;\n-\tstruct softnic_mtr_meter_policy *mp;\n-\tconst struct rte_flow_action *act;\n-\tconst struct rte_flow_action_meter_color *recolor;\n-\tuint32_t i;\n-\tbool valid_act_found;\n-\n-\tif (policy == NULL)\n-\t\treturn -rte_mtr_error_set(error,\n-\t\t\tEINVAL,\n-\t\t\tRTE_MTR_ERROR_TYPE_METER_POLICY,\n-\t\t\tNULL,\n-\t\t\t\"Null meter policy invalid\");\n-\n-\t/* Meter policy must not exist. */\n-\tmp = softnic_mtr_meter_policy_find(p, meter_policy_id);\n-\tif (mp != NULL)\n-\t\treturn -rte_mtr_error_set(error,\n-\t\t\tEINVAL,\n-\t\t\tRTE_MTR_ERROR_TYPE_METER_POLICY_ID,\n-\t\t\tNULL,\n-\t\t\t\"Meter policy already exists\");\n-\n-\tfor (i = 0; i < RTE_COLORS; i++) {\n-\t\tif (policy->actions[i] == NULL)\n-\t\t\treturn -rte_mtr_error_set(error,\n-\t\t\t\tEINVAL,\n-\t\t\t\tRTE_MTR_ERROR_TYPE_METER_POLICY,\n-\t\t\t\tNULL,\n-\t\t\t\t\"Null action list\");\n-\t\tfor (act = policy->actions[i], valid_act_found = false;\n-\t\t     act->type != RTE_FLOW_ACTION_TYPE_END; act++) {\n-\t\t\tif (act->type == RTE_FLOW_ACTION_TYPE_VOID)\n-\t\t\t\tcontinue;\n-\t\t\t/*\n-\t\t\t * Support one (and one only) of\n-\t\t\t * METER_COLOR or DROP action.\n-\t\t\t */\n-\t\t\tif ((act->type != RTE_FLOW_ACTION_TYPE_METER_COLOR &&\n-\t\t\t\tact->type != RTE_FLOW_ACTION_TYPE_DROP) ||\n-\t\t\t\tvalid_act_found)\n-\t\t\t\treturn -rte_mtr_error_set(error,\n-\t\t\t\t\tEINVAL,\n-\t\t\t\t\tRTE_MTR_ERROR_TYPE_METER_POLICY,\n-\t\t\t\t\tNULL,\n-\t\t\t\t\t\"Action invalid\");\n-\t\t\tvalid_act_found = true;\n-\t\t}\n-\t\tif (!valid_act_found)\n-\t\t\treturn -rte_mtr_error_set(error,\n-\t\t\t\tEINVAL,\n-\t\t\t\tRTE_MTR_ERROR_TYPE_METER_POLICY,\n-\t\t\t\tNULL,\n-\t\t\t\t\"No valid action found\");\n-\t}\n-\n-\t/* Memory allocation */\n-\tmp = calloc(1, sizeof(struct softnic_mtr_meter_policy));\n-\tif (mp == NULL)\n-\t\treturn -rte_mtr_error_set(error,\n-\t\t\tENOMEM,\n-\t\t\tRTE_MTR_ERROR_TYPE_UNSPECIFIED,\n-\t\t\tNULL,\n-\t\t\t\"Memory alloc failed\");\n-\n-\t/* Fill in */\n-\tmp->meter_policy_id = meter_policy_id;\n-\tfor (i = 0; i < RTE_COLORS; i++) {\n-\t\tmp->policer[i] = RTE_TABLE_ACTION_POLICER_DROP;\n-\t\tact = policy->actions[i];\n-\t\tif (!act)\n-\t\t\tcontinue;\n-\t\tif (act->type == RTE_FLOW_ACTION_TYPE_METER_COLOR) {\n-\t\t\trecolor = act->conf;\n-\t\t\tswitch (recolor->color) {\n-\t\t\tcase RTE_COLOR_GREEN:\n-\t\t\t\tmp->policer[i] =\n-\t\t\t\tRTE_TABLE_ACTION_POLICER_COLOR_GREEN;\n-\t\t\t\tbreak;\n-\t\t\tcase RTE_COLOR_YELLOW:\n-\t\t\t\tmp->policer[i] =\n-\t\t\t\tRTE_TABLE_ACTION_POLICER_COLOR_YELLOW;\n-\t\t\t\tbreak;\n-\t\t\tcase RTE_COLOR_RED:\n-\t\t\t\tmp->policer[i] =\n-\t\t\t\tRTE_TABLE_ACTION_POLICER_COLOR_RED;\n-\t\t\t\tbreak;\n-\t\t\tdefault:\n-\t\t\t\tbreak;\n-\t\t\t}\n-\t\t}\n-\t}\n-\n-\t/* Add to list */\n-\tTAILQ_INSERT_TAIL(mpl, mp, node);\n-\n-\treturn 0;\n-}\n-\n-/* MTR meter policy delete */\n-static int\n-pmd_mtr_meter_policy_delete(struct rte_eth_dev *dev,\n-\tuint32_t meter_policy_id,\n-\tstruct rte_mtr_error *error)\n-{\n-\tstruct pmd_internals *p = dev->data->dev_private;\n-\tstruct softnic_mtr_meter_policy *mp;\n-\n-\t/* Meter policy must exist */\n-\tmp = softnic_mtr_meter_policy_find(p, meter_policy_id);\n-\tif (mp == NULL)\n-\t\treturn -rte_mtr_error_set(error,\n-\t\t\tEINVAL,\n-\t\t\tRTE_MTR_ERROR_TYPE_METER_POLICY_ID,\n-\t\t\tNULL,\n-\t\t\t\"Meter policy id invalid\");\n-\n-\t/* Check unused */\n-\tif (mp->n_users)\n-\t\treturn -rte_mtr_error_set(error,\n-\t\t\tEBUSY,\n-\t\t\tRTE_MTR_ERROR_TYPE_METER_POLICY_ID,\n-\t\t\tNULL,\n-\t\t\t\"Meter policy in use\");\n-\n-\t/* Remove from list */\n-\tTAILQ_REMOVE(&p->mtr.meter_policies, mp, node);\n-\tfree(mp);\n-\n-\treturn 0;\n-}\n-\n-struct softnic_mtr *\n-softnic_mtr_find(struct pmd_internals *p, uint32_t mtr_id)\n-{\n-\tstruct softnic_mtr_list *ml = &p->mtr.mtrs;\n-\tstruct softnic_mtr *m;\n-\n-\tTAILQ_FOREACH(m, ml, node)\n-\t\tif (m->mtr_id == mtr_id)\n-\t\t\treturn m;\n-\n-\treturn NULL;\n-}\n-\n-\n-static int\n-mtr_check(struct pmd_internals *p,\n-\tuint32_t mtr_id,\n-\tstruct rte_mtr_params *params,\n-\tint shared,\n-\tstruct rte_mtr_error *error)\n-{\n-\t/* MTR id valid  */\n-\tif (softnic_mtr_find(p, mtr_id))\n-\t\treturn -rte_mtr_error_set(error,\n-\t\t\tEEXIST,\n-\t\t\tRTE_MTR_ERROR_TYPE_MTR_ID,\n-\t\t\tNULL,\n-\t\t\t\"MTR object already exists\");\n-\n-\t/* MTR params must not be NULL */\n-\tif (params == NULL)\n-\t\treturn -rte_mtr_error_set(error,\n-\t\t\tEINVAL,\n-\t\t\tRTE_MTR_ERROR_TYPE_MTR_PARAMS,\n-\t\t\tNULL,\n-\t\t\t\"MTR object params null\");\n-\n-\t/* Previous meter color not supported */\n-\tif (params->use_prev_mtr_color)\n-\t\treturn -rte_mtr_error_set(error,\n-\t\t\tEINVAL,\n-\t\t\tRTE_MTR_ERROR_TYPE_MTR_PARAMS,\n-\t\t\tNULL,\n-\t\t\t\"Previous meter color not supported\");\n-\n-\t/* Shared MTR object not supported */\n-\tif (shared)\n-\t\treturn -rte_mtr_error_set(error,\n-\t\t\tEINVAL,\n-\t\t\tRTE_MTR_ERROR_TYPE_SHARED,\n-\t\t\tNULL,\n-\t\t\t\"Shared MTR object not supported\");\n-\n-\treturn 0;\n-}\n-\n-/* MTR object create */\n-static int\n-pmd_mtr_create(struct rte_eth_dev *dev,\n-\tuint32_t mtr_id,\n-\tstruct rte_mtr_params *params,\n-\tint shared,\n-\tstruct rte_mtr_error *error)\n-{\n-\tstruct pmd_internals *p = dev->data->dev_private;\n-\tstruct softnic_mtr_list *ml = &p->mtr.mtrs;\n-\tstruct softnic_mtr_meter_profile *mp;\n-\tstruct softnic_mtr_meter_policy *policy;\n-\tstruct softnic_mtr *m;\n-\tint status;\n-\n-\t/* Check parameters */\n-\tstatus = mtr_check(p, mtr_id, params, shared, error);\n-\tif (status)\n-\t\treturn status;\n-\n-\t/* Meter profile must exist */\n-\tmp = softnic_mtr_meter_profile_find(p, params->meter_profile_id);\n-\tif (mp == NULL)\n-\t\treturn -rte_mtr_error_set(error,\n-\t\t\tEINVAL,\n-\t\t\tRTE_MTR_ERROR_TYPE_METER_PROFILE_ID,\n-\t\t\tNULL,\n-\t\t\t\"Meter profile id not valid\");\n-\n-\t/* Meter policy must exist */\n-\tpolicy = softnic_mtr_meter_policy_find(p, params->meter_policy_id);\n-\tif (policy == NULL) {\n-\t\treturn -rte_mtr_error_set(error,\n-\t\t\t\tEINVAL,\n-\t\t\t\tRTE_MTR_ERROR_TYPE_METER_POLICY_ID,\n-\t\t\t\tNULL,\n-\t\t\t\t\"Meter policy id invalid\");\n-\t}\n-\n-\t/* Memory allocation */\n-\tm = calloc(1, sizeof(struct softnic_mtr));\n-\tif (m == NULL)\n-\t\treturn -rte_mtr_error_set(error,\n-\t\t\tENOMEM,\n-\t\t\tRTE_MTR_ERROR_TYPE_UNSPECIFIED,\n-\t\t\tNULL,\n-\t\t\t\"Memory alloc failed\");\n-\n-\t/* Fill in */\n-\tm->mtr_id = mtr_id;\n-\tmemcpy(&m->params, params, sizeof(m->params));\n-\n-\t/* Add to list */\n-\tTAILQ_INSERT_TAIL(ml, m, node);\n-\n-\t/* Update dependencies */\n-\tmp->n_users++;\n-\tpolicy->n_users++;\n-\n-\treturn 0;\n-}\n-\n-/* MTR object destroy */\n-static int\n-pmd_mtr_destroy(struct rte_eth_dev *dev,\n-\tuint32_t mtr_id,\n-\tstruct rte_mtr_error *error)\n-{\n-\tstruct pmd_internals *p = dev->data->dev_private;\n-\tstruct softnic_mtr_list *ml = &p->mtr.mtrs;\n-\tstruct softnic_mtr_meter_profile *mp;\n-\tstruct softnic_mtr *m;\n-\tstruct softnic_mtr_meter_policy *policy;\n-\n-\t/* MTR object must exist */\n-\tm = softnic_mtr_find(p, mtr_id);\n-\tif (m == NULL)\n-\t\treturn -rte_mtr_error_set(error,\n-\t\t\tEEXIST,\n-\t\t\tRTE_MTR_ERROR_TYPE_MTR_ID,\n-\t\t\tNULL,\n-\t\t\t\"MTR object id not valid\");\n-\n-\t/* MTR object must not have any owner */\n-\tif (m->flow != NULL)\n-\t\treturn -rte_mtr_error_set(error,\n-\t\t\tEINVAL,\n-\t\t\tRTE_MTR_ERROR_TYPE_UNSPECIFIED,\n-\t\t\tNULL,\n-\t\t\t\"MTR object is being used\");\n-\n-\t/* Get meter profile */\n-\tmp = softnic_mtr_meter_profile_find(p, m->params.meter_profile_id);\n-\tif (mp == NULL)\n-\t\treturn -rte_mtr_error_set(error,\n-\t\t\tEINVAL,\n-\t\t\tRTE_MTR_ERROR_TYPE_METER_PROFILE_ID,\n-\t\t\tNULL,\n-\t\t\t\"MTR object meter profile invalid\");\n-\n-\t/* Meter policy must exist */\n-\tpolicy = softnic_mtr_meter_policy_find(p, m->params.meter_policy_id);\n-\tif (policy == NULL)\n-\t\treturn -rte_mtr_error_set(error,\n-\t\t\tEINVAL,\n-\t\t\tRTE_MTR_ERROR_TYPE_METER_POLICY_ID,\n-\t\t\tNULL,\n-\t\t\t\"MTR object meter policy invalid\");\n-\n-\t/* Update dependencies */\n-\tmp->n_users--;\n-\tpolicy->n_users--;\n-\n-\t/* Remove from list */\n-\tTAILQ_REMOVE(ml, m, node);\n-\tfree(m);\n-\n-\treturn 0;\n-}\n-\n-/* MTR object meter profile update */\n-static int\n-pmd_mtr_meter_profile_update(struct rte_eth_dev *dev,\n-\tuint32_t mtr_id,\n-\tuint32_t meter_profile_id,\n-\tstruct rte_mtr_error *error)\n-{\n-\tstruct pmd_internals *p = dev->data->dev_private;\n-\tstruct softnic_mtr_meter_profile *mp_new, *mp_old;\n-\tstruct softnic_mtr *m;\n-\tint status;\n-\n-\t/* MTR object id must be valid */\n-\tm = softnic_mtr_find(p, mtr_id);\n-\tif (m == NULL)\n-\t\treturn -rte_mtr_error_set(error,\n-\t\t\tEEXIST,\n-\t\t\tRTE_MTR_ERROR_TYPE_MTR_ID,\n-\t\t\tNULL,\n-\t\t\t\"MTR object id not valid\");\n-\n-\t/* Meter profile id must be valid */\n-\tmp_new = softnic_mtr_meter_profile_find(p, meter_profile_id);\n-\tif (mp_new == NULL)\n-\t\treturn -rte_mtr_error_set(error,\n-\t\t\tEINVAL,\n-\t\t\tRTE_MTR_ERROR_TYPE_METER_PROFILE_ID,\n-\t\t\tNULL,\n-\t\t\t\"Meter profile not valid\");\n-\n-\t/* MTR object already set to meter profile id */\n-\tif (m->params.meter_profile_id == meter_profile_id)\n-\t\treturn 0;\n-\n-\t/*  MTR object owner table update */\n-\tif (m->flow) {\n-\t\tuint32_t table_id = m->flow->table_id;\n-\t\tstruct softnic_table *table = &m->flow->pipeline->table[table_id];\n-\t\tstruct softnic_table_rule_action action;\n-\n-\t\tif (!softnic_pipeline_table_meter_profile_find(table,\n-\t\t\tmeter_profile_id)) {\n-\t\t\tstruct rte_table_action_meter_profile profile;\n-\n-\t\t\tmemset(&profile, 0, sizeof(profile));\n-\n-\t\t\tprofile.alg = RTE_TABLE_ACTION_METER_TRTCM;\n-\t\t\tprofile.trtcm.cir = mp_new->params.trtcm_rfc2698.cir;\n-\t\t\tprofile.trtcm.pir = mp_new->params.trtcm_rfc2698.pir;\n-\t\t\tprofile.trtcm.cbs = mp_new->params.trtcm_rfc2698.cbs;\n-\t\t\tprofile.trtcm.pbs = mp_new->params.trtcm_rfc2698.pbs;\n-\n-\t\t\t/* Add meter profile to pipeline table */\n-\t\t\tstatus = softnic_pipeline_table_mtr_profile_add(p,\n-\t\t\t\t\tm->flow->pipeline->name,\n-\t\t\t\t\ttable_id,\n-\t\t\t\t\tmeter_profile_id,\n-\t\t\t\t\t&profile);\n-\t\t\tif (status)\n-\t\t\t\treturn -rte_mtr_error_set(error,\n-\t\t\t\t\tEINVAL,\n-\t\t\t\t\tRTE_MTR_ERROR_TYPE_UNSPECIFIED,\n-\t\t\t\t\tNULL,\n-\t\t\t\t\t\"Table meter profile add failed\");\n-\t\t}\n-\n-\t\t/* Set meter action */\n-\t\tmemcpy(&action, &m->flow->action, sizeof(action));\n-\n-\t\taction.mtr.mtr[0].meter_profile_id = meter_profile_id;\n-\n-\t\t/* Re-add rule */\n-\t\tstatus = softnic_pipeline_table_rule_add(p,\n-\t\t\tm->flow->pipeline->name,\n-\t\t\ttable_id,\n-\t\t\t&m->flow->match,\n-\t\t\t&action,\n-\t\t\t&m->flow->data);\n-\t\tif (status)\n-\t\t\treturn -rte_mtr_error_set(error,\n-\t\t\t\tEINVAL,\n-\t\t\t\tRTE_MTR_ERROR_TYPE_UNSPECIFIED,\n-\t\t\t\tNULL,\n-\t\t\t\t\"Pipeline table rule add failed\");\n-\n-\t\t/* Flow: update meter action */\n-\t\tmemcpy(&m->flow->action, &action, sizeof(m->flow->action));\n-\t}\n-\n-\tmp_old = softnic_mtr_meter_profile_find(p, m->params.meter_profile_id);\n-\n-\t/* Meter: Set meter profile */\n-\tm->params.meter_profile_id = meter_profile_id;\n-\n-\t/* Update dependencies*/\n-\tmp_old->n_users--;\n-\tmp_new->n_users++;\n-\n-\treturn 0;\n-}\n-\n-/* MTR object meter DSCP table update */\n-static int\n-pmd_mtr_meter_dscp_table_update(struct rte_eth_dev *dev,\n-\tuint32_t mtr_id,\n-\tenum rte_color *dscp_table,\n-\tstruct rte_mtr_error *error)\n-{\n-\tstruct pmd_internals *p = dev->data->dev_private;\n-\tstruct rte_table_action_dscp_table dt;\n-\tstruct pipeline *pipeline;\n-\tstruct softnic_table *table;\n-\tstruct softnic_mtr *m;\n-\tuint32_t table_id, i;\n-\tint status;\n-\n-\t/* MTR object id must be valid */\n-\tm = softnic_mtr_find(p, mtr_id);\n-\tif (m == NULL)\n-\t\treturn -rte_mtr_error_set(error,\n-\t\t\tEEXIST,\n-\t\t\tRTE_MTR_ERROR_TYPE_MTR_ID,\n-\t\t\tNULL,\n-\t\t\t\"MTR object id not valid\");\n-\n-\t/* MTR object owner valid? */\n-\tif (m->flow == NULL)\n-\t\treturn 0;\n-\n-\tpipeline = m->flow->pipeline;\n-\ttable_id = m->flow->table_id;\n-\ttable = &pipeline->table[table_id];\n-\n-\tmemcpy(&dt, &table->dscp_table, sizeof(dt));\n-\tfor (i = 0; i < RTE_DIM(dt.entry); i++)\n-\t\tdt.entry[i].color = (enum rte_color)dscp_table[i];\n-\n-\t/* Update table */\n-\tstatus = softnic_pipeline_table_dscp_table_update(p,\n-\t\t\tpipeline->name,\n-\t\t\ttable_id,\n-\t\t\tUINT64_MAX,\n-\t\t\t&dt);\n-\tif (status)\n-\t\treturn -rte_mtr_error_set(error,\n-\t\t\tEINVAL,\n-\t\t\tRTE_MTR_ERROR_TYPE_UNSPECIFIED,\n-\t\t\tNULL,\n-\t\t\t\"Table action dscp table update failed\");\n-\n-\treturn 0;\n-}\n-\n-/* MTR object policy update */\n-static int\n-pmd_mtr_meter_policy_update(struct rte_eth_dev *dev,\n-\tuint32_t mtr_id,\n-\tuint32_t meter_policy_id,\n-\tstruct rte_mtr_error *error)\n-{\n-\tstruct pmd_internals *p = dev->data->dev_private;\n-\tstruct softnic_mtr *m;\n-\tuint32_t i;\n-\tint status;\n-\tstruct softnic_mtr_meter_policy *mp_new, *mp_old;\n-\n-\t/* MTR object id must be valid */\n-\tm = softnic_mtr_find(p, mtr_id);\n-\tif (m == NULL)\n-\t\treturn -rte_mtr_error_set(error,\n-\t\t\tEEXIST,\n-\t\t\tRTE_MTR_ERROR_TYPE_MTR_ID,\n-\t\t\tNULL,\n-\t\t\t\"MTR object id not valid\");\n-\n-\tif (m->params.meter_policy_id == meter_policy_id)\n-\t\treturn 0;\n-\n-\t/* Meter policy must exist */\n-\tmp_new = softnic_mtr_meter_policy_find(p, meter_policy_id);\n-\tif (mp_new == NULL)\n-\t\treturn -rte_mtr_error_set(error,\n-\t\t\tEINVAL,\n-\t\t\tRTE_MTR_ERROR_TYPE_METER_POLICY_ID,\n-\t\t\tNULL,\n-\t\t\t\"Meter policy id invalid\");\n-\n-\t/* MTR object owner valid? */\n-\tif (m->flow) {\n-\t\tstruct pipeline *pipeline = m->flow->pipeline;\n-\t\tstruct softnic_table *table = &pipeline->table[m->flow->table_id];\n-\t\tstruct softnic_table_rule_action action;\n-\n-\t\tmemcpy(&action, &m->flow->action, sizeof(action));\n-\n-\t\t/* Set action */\n-\t\tfor (i = 0; i < RTE_COLORS; i++)\n-\t\t\taction.mtr.mtr[0].policer[i] = mp_new->policer[i];\n-\n-\t\t/* Re-add the rule */\n-\t\tstatus = softnic_pipeline_table_rule_add(p,\n-\t\t\tpipeline->name,\n-\t\t\tm->flow->table_id,\n-\t\t\t&m->flow->match,\n-\t\t\t&action,\n-\t\t\t&m->flow->data);\n-\t\tif (status)\n-\t\t\treturn -rte_mtr_error_set(error,\n-\t\t\t\tEINVAL,\n-\t\t\t\tRTE_MTR_ERROR_TYPE_UNSPECIFIED,\n-\t\t\t\tNULL,\n-\t\t\t\t\"Pipeline table rule re-add failed\");\n-\n-\t\t/* Flow: Update meter action */\n-\t\tmemcpy(&m->flow->action, &action, sizeof(m->flow->action));\n-\n-\t\t/* Reset the meter stats */\n-\t\trte_table_action_meter_read(table->a, m->flow->data,\n-\t\t\t1, NULL, 1);\n-\t}\n-\n-\tmp_old = softnic_mtr_meter_policy_find(p, m->params.meter_policy_id);\n-\tif (mp_old == NULL)\n-\t\treturn -rte_mtr_error_set(error,\n-\t\t\tEINVAL,\n-\t\t\tRTE_MTR_ERROR_TYPE_METER_POLICY_ID,\n-\t\t\tNULL,\n-\t\t\t\"Old meter policy id invalid\");\n-\n-\t/* Meter: Set meter profile */\n-\tm->params.meter_policy_id = meter_policy_id;\n-\n-\t/* Update dependencies*/\n-\tmp_old->n_users--;\n-\tmp_new->n_users++;\n-\n-\treturn 0;\n-}\n-\n-#define MTR_STATS_PKTS_DEFAULT (RTE_MTR_STATS_N_PKTS_GREEN | \\\n-\t\t\t\tRTE_MTR_STATS_N_PKTS_YELLOW | \\\n-\t\t\t\tRTE_MTR_STATS_N_PKTS_RED | \\\n-\t\t\t\tRTE_MTR_STATS_N_PKTS_DROPPED)\n-\n-#define MTR_STATS_BYTES_DEFAULT (RTE_MTR_STATS_N_BYTES_GREEN | \\\n-\t\t\t\tRTE_MTR_STATS_N_BYTES_YELLOW | \\\n-\t\t\t\tRTE_MTR_STATS_N_BYTES_RED | \\\n-\t\t\t\tRTE_MTR_STATS_N_BYTES_DROPPED)\n-\n-/* MTR object stats read */\n-static void\n-mtr_stats_convert(struct pmd_internals *p,\n-\tstruct softnic_mtr *m,\n-\tstruct rte_table_action_mtr_counters_tc *in,\n-\tstruct rte_mtr_stats *out,\n-\tuint64_t *out_mask)\n-{\n-\tstruct softnic_mtr_meter_policy *mp;\n-\n-\tmemset(&out, 0, sizeof(out));\n-\t*out_mask = 0;\n-\n-\t/* Meter policy must exist */\n-\tmp = softnic_mtr_meter_policy_find(p, m->params.meter_policy_id);\n-\tif (mp == NULL)\n-\t\treturn;\n-\n-\tif (in->n_packets_valid) {\n-\t\tuint32_t i;\n-\n-\t\tfor (i = 0; i < RTE_COLORS; i++) {\n-\t\t\tif (mp->policer[i] ==\n-\t\t\t\tRTE_TABLE_ACTION_POLICER_COLOR_GREEN)\n-\t\t\t\tout->n_pkts[RTE_COLOR_GREEN] += in->n_packets[i];\n-\n-\t\t\tif (mp->policer[i] ==\n-\t\t\t\tRTE_TABLE_ACTION_POLICER_COLOR_YELLOW)\n-\t\t\t\tout->n_pkts[RTE_COLOR_YELLOW] += in->n_packets[i];\n-\n-\t\t\tif (mp->policer[i] ==\n-\t\t\t\tRTE_TABLE_ACTION_POLICER_COLOR_RED)\n-\t\t\t\tout->n_pkts[RTE_COLOR_RED] += in->n_packets[i];\n-\n-\t\t\tif (mp->policer[i] ==\n-\t\t\t\tRTE_TABLE_ACTION_POLICER_DROP)\n-\t\t\t\tout->n_pkts_dropped += in->n_packets[i];\n-\t\t}\n-\n-\t\t*out_mask |= MTR_STATS_PKTS_DEFAULT;\n-\t}\n-\n-\tif (in->n_bytes_valid) {\n-\t\tuint32_t i;\n-\n-\t\tfor (i = 0; i < RTE_COLORS; i++) {\n-\t\t\tif (mp->policer[i] ==\n-\t\t\t\tRTE_TABLE_ACTION_POLICER_COLOR_GREEN)\n-\t\t\t\tout->n_bytes[RTE_COLOR_GREEN] += in->n_bytes[i];\n-\n-\t\t\tif (mp->policer[i] ==\n-\t\t\t\tRTE_TABLE_ACTION_POLICER_COLOR_YELLOW)\n-\t\t\t\tout->n_bytes[RTE_COLOR_YELLOW] += in->n_bytes[i];\n-\n-\t\t\tif (mp->policer[i] ==\n-\t\t\t\tRTE_TABLE_ACTION_POLICER_COLOR_RED)\n-\t\t\t\tout->n_bytes[RTE_COLOR_RED] += in->n_bytes[i];\n-\n-\t\t\tif (mp->policer[i] ==\n-\t\t\t\tRTE_TABLE_ACTION_POLICER_DROP)\n-\t\t\t\tout->n_bytes_dropped += in->n_bytes[i];\n-\t\t}\n-\n-\t\t*out_mask |= MTR_STATS_BYTES_DEFAULT;\n-\t}\n-}\n-\n-/* MTR object stats read */\n-static int\n-pmd_mtr_stats_read(struct rte_eth_dev *dev,\n-\tuint32_t mtr_id,\n-\tstruct rte_mtr_stats *stats,\n-\tuint64_t *stats_mask,\n-\tint clear,\n-\tstruct rte_mtr_error *error)\n-{\n-\tstruct pmd_internals *p = dev->data->dev_private;\n-\tstruct rte_table_action_mtr_counters counters;\n-\tstruct pipeline *pipeline;\n-\tstruct softnic_table *table;\n-\tstruct softnic_mtr *m;\n-\tint status;\n-\n-\t/* MTR object id must be valid */\n-\tm = softnic_mtr_find(p, mtr_id);\n-\tif (m == NULL)\n-\t\treturn -rte_mtr_error_set(error,\n-\t\t\tEEXIST,\n-\t\t\tRTE_MTR_ERROR_TYPE_MTR_ID,\n-\t\t\tNULL,\n-\t\t\t\"MTR object id not valid\");\n-\n-\t/* MTR meter object owner valid? */\n-\tif (m->flow == NULL) {\n-\t\tif (stats != NULL)\n-\t\t\tmemset(stats, 0, sizeof(*stats));\n-\n-\t\tif (stats_mask)\n-\t\t\t*stats_mask = MTR_STATS_PKTS_DEFAULT |\n-\t\t\t\tMTR_STATS_BYTES_DEFAULT;\n-\n-\t\treturn 0;\n-\t}\n-\n-\tpipeline = m->flow->pipeline;\n-\ttable = &pipeline->table[m->flow->table_id];\n-\n-\t/* Meter stats read. */\n-\tstatus = rte_table_action_meter_read(table->a,\n-\t\tm->flow->data,\n-\t\t1,\n-\t\t&counters,\n-\t\tclear);\n-\tif (status)\n-\t\treturn -rte_mtr_error_set(error,\n-\t\t\tEINVAL,\n-\t\t\tRTE_MTR_ERROR_TYPE_UNSPECIFIED,\n-\t\t\tNULL,\n-\t\t\t\"Meter stats read failed\");\n-\n-\t/* Stats format conversion. */\n-\tif (stats || stats_mask) {\n-\t\tstruct rte_mtr_stats s;\n-\t\tuint64_t s_mask = 0;\n-\n-\t\tmtr_stats_convert(p,\n-\t\t\tm,\n-\t\t\t&counters.stats[0],\n-\t\t\t&s,\n-\t\t\t&s_mask);\n-\n-\t\tif (stats)\n-\t\t\tmemcpy(stats, &s, sizeof(*stats));\n-\n-\t\tif (stats_mask)\n-\t\t\t*stats_mask = s_mask;\n-\t}\n-\n-\treturn 0;\n-}\n-\n-const struct rte_mtr_ops pmd_mtr_ops = {\n-\t.capabilities_get = NULL,\n-\n-\t.meter_profile_add = pmd_mtr_meter_profile_add,\n-\t.meter_profile_delete = pmd_mtr_meter_profile_delete,\n-\n-\t.meter_policy_add = pmd_mtr_meter_policy_add,\n-\t.meter_policy_delete = pmd_mtr_meter_policy_delete,\n-\n-\t.create = pmd_mtr_create,\n-\t.destroy = pmd_mtr_destroy,\n-\t.meter_enable = NULL,\n-\t.meter_disable = NULL,\n-\n-\t.meter_profile_update = pmd_mtr_meter_profile_update,\n-\t.meter_dscp_table_update = pmd_mtr_meter_dscp_table_update,\n-\t.meter_policy_update = pmd_mtr_meter_policy_update,\n-\t.stats_update = NULL,\n-\n-\t.stats_read = pmd_mtr_stats_read,\n-};\ndiff --git a/drivers/net/softnic/rte_eth_softnic_pipeline.c b/drivers/net/softnic/rte_eth_softnic_pipeline.c\nindex c7d2a7de19..2cf7fa52d1 100644\n--- a/drivers/net/softnic/rte_eth_softnic_pipeline.c\n+++ b/drivers/net/softnic/rte_eth_softnic_pipeline.c\n@@ -46,17 +46,6 @@ softnic_pipeline_init(struct pmd_internals *p)\n static void\n softnic_pipeline_table_free(struct softnic_table *table)\n {\n-\tfor ( ; ; ) {\n-\t\tstruct rte_flow *flow;\n-\n-\t\tflow = TAILQ_FIRST(&table->flows);\n-\t\tif (flow == NULL)\n-\t\t\tbreak;\n-\n-\t\tTAILQ_REMOVE(&table->flows, flow, node);\n-\t\tfree(flow);\n-\t}\n-\n \tfor ( ; ; ) {\n \t\tstruct softnic_table_meter_profile *mp;\n \n@@ -1035,7 +1024,6 @@ softnic_pipeline_table_create(struct pmd_internals *softnic,\n \tmemcpy(&table->params, params, sizeof(*params));\n \ttable->ap = ap;\n \ttable->a = action;\n-\tTAILQ_INIT(&table->flows);\n \tTAILQ_INIT(&table->meter_profiles);\n \tmemset(&table->dscp_table, 0, sizeof(table->dscp_table));\n \tpipeline->n_tables++;\n",
    "prefixes": [
        "V2",
        "03/21"
    ]
}