get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 45292,
    "url": "http://patches.dpdk.org/api/patches/45292/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1537859109-25659-5-git-send-email-amo@semihalf.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": "<1537859109-25659-5-git-send-email-amo@semihalf.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1537859109-25659-5-git-send-email-amo@semihalf.com",
    "date": "2018-09-25T07:05:00",
    "name": "[v3,04/13] net/mvpp2: change default policer configuration",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "ea796e644474c277b15d47ffeb22c8dcb87e07c3",
    "submitter": {
        "id": 1112,
        "url": "http://patches.dpdk.org/api/people/1112/?format=api",
        "name": "Andrzej Ostruszka",
        "email": "amo@semihalf.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/1537859109-25659-5-git-send-email-amo@semihalf.com/mbox/",
    "series": [
        {
            "id": 1482,
            "url": "http://patches.dpdk.org/api/series/1482/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=1482",
            "date": "2018-09-25T07:04:56",
            "name": "net/mvpp2: add new features",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/1482/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/45292/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/45292/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 D99B6548B;\n\tTue, 25 Sep 2018 09:05:26 +0200 (CEST)",
            "from mail-lf1-f65.google.com (mail-lf1-f65.google.com\n\t[209.85.167.65]) by dpdk.org (Postfix) with ESMTP id 99F5D4CA5\n\tfor <dev@dpdk.org>; Tue, 25 Sep 2018 09:05:16 +0200 (CEST)",
            "by mail-lf1-f65.google.com with SMTP id a82-v6so3619206lfa.4\n\tfor <dev@dpdk.org>; Tue, 25 Sep 2018 00:05:16 -0700 (PDT)",
            "from amok.semihalf.local (31-172-191-173.noc.fibertech.net.pl.\n\t[31.172.191.173]) by smtp.googlemail.com with ESMTPSA id\n\t24-v6sm238306ljb.76.2018.09.25.00.05.14\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tTue, 25 Sep 2018 00:05:15 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=semihalf-com.20150623.gappssmtp.com; s=20150623;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=VQ6BynRxjjN5oqK0wBGUmFaqigfXEHYiyw3U2xCX5Es=;\n\tb=xvkmLIbzjX8vPr+hfGynzpac+6Cr2zbzwD4GLeeYlixhRPpesNz8KGrhzLlMosaNTX\n\tf8SHPqQ8iayq5z3aRsg8F6OqEhBFwfPTCW7umZf1oOXMxdzOB/KUuFCbtiIvGZXIHmoP\n\tgwLAQMruypwZLOwQR20u1tY48/imDL+kbm4EgWKIJB0JRofrYLRrGhNkbAOHDNgHkM2X\n\tLk/QgszUOMyUI0bYufbpTyX8IaWW66LDogW+FWxyxnPkR2v8Im2nA1XaUwUDIwXXNwfN\n\t/BcZe5UZ9QgtjJaPbEkNuy4uGkQedXA00Ve3Izt9zCPwVNQfmxjzTmxK2/Yzn8w/3WlG\n\tckcA==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=VQ6BynRxjjN5oqK0wBGUmFaqigfXEHYiyw3U2xCX5Es=;\n\tb=aelkgNlUUfd806UjnrDojfCdbIIFj4F3Q0oC832THMSA3e9RmmCRMnIV2POrO2rJiJ\n\tiWBrB7TRXofiDLjLxkagjcN2fZ1Fsdj8HTVFFGax+TVyLRBdaeNYGgkoH6vT5EpqwMat\n\tc2GhnS8elaXBq2wuIPu1sQuNLFeR2lsAPf/S+0MKvXQuonZjG342Y0/Bc9nGuSUMOCbt\n\tMHrGJg2pzn6CMEp6awSbbKJ9nTVrqluSG01qiYSzM7lugv6h8xslMMMFGRIvNOoUi3SN\n\teOLjxHlEMtOPsH6p+KLZMiWpldEmLqoXgr2Ib10h9NS2ivaQ+x9Hq7ourht3FgcHMmkk\n\t+R1Q==",
        "X-Gm-Message-State": "ABuFfojlx5RcMAFFPxDbLcgP6AyS6Ju4Cokr1XtvIVmp/CN61JTTzdYS\n\tHdF07s4VIN6Vv1Uzv7tcOezO3PMfu2mg6Q==",
        "X-Google-Smtp-Source": "ACcGV632DLPdOvtGxgdNBveQre5F5ZiWp22aw4kLhIaz8nMeT6tKZ0cV9m8zWCt4+T2LnknzMnikWA==",
        "X-Received": "by 2002:a19:109e:: with SMTP id\n\t30-v6mr1430358lfq.96.1537859115831; \n\tTue, 25 Sep 2018 00:05:15 -0700 (PDT)",
        "From": "Andrzej Ostruszka <amo@semihalf.com>",
        "To": "dev@dpdk.org",
        "Cc": "mw@semihalf.com, nadavh@marvell.com, Tomasz Duszynski <tdu@semihalf.com>,\n\tNatalie Samsonov <nsamsono@marvell.com>",
        "Date": "Tue, 25 Sep 2018 09:05:00 +0200",
        "Message-Id": "<1537859109-25659-5-git-send-email-amo@semihalf.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1537859109-25659-1-git-send-email-amo@semihalf.com>",
        "References": "<1536068953-9352-1-git-send-email-tdu@semihalf.com>\n\t<1537859109-25659-1-git-send-email-amo@semihalf.com>",
        "Subject": "[dpdk-dev] [PATCH v3 04/13] net/mvpp2: change default policer\n\tconfiguration",
        "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": "From: Tomasz Duszynski <tdu@semihalf.com>\n\nChange QoS configuration file syntax for port's default policer\nsetup.\n\nSince default policer configuration is performed before\nany other policer configuration we can pick a default id.\n\nThis simplifies default policer configuration since user\nno longer has to choose ids from range [0, PP2_CLS_PLCR_NUM].\n\nExplicitly document values for rate_limit_enable field.\n\nSigned-off-by: Tomasz Duszynski <tdu@semihalf.com>\nSigned-off-by: Natalie Samsonov <nsamsono@marvell.com>\nReviewed-by: Liron Himi <lironh@marvell.com>\n---\n doc/guides/nics/mvpp2.rst       |  31 ++++---\n drivers/net/mvpp2/mrvl_ethdev.c |   6 +-\n drivers/net/mvpp2/mrvl_ethdev.h |   2 +-\n drivers/net/mvpp2/mrvl_qos.c    | 198 ++++++++++++++++++++++------------------\n drivers/net/mvpp2/mrvl_qos.h    |   2 +-\n 5 files changed, 134 insertions(+), 105 deletions(-)",
    "diff": "diff --git a/doc/guides/nics/mvpp2.rst b/doc/guides/nics/mvpp2.rst\nindex 0408752..a452c8a 100644\n--- a/doc/guides/nics/mvpp2.rst\n+++ b/doc/guides/nics/mvpp2.rst\n@@ -152,20 +152,23 @@ Configuration syntax\n \n .. code-block:: console\n \n-   [port <portnum> default]\n-   default_tc = <default_tc>\n-   mapping_priority = <mapping_priority>\n-   policer_enable = <policer_enable>\n+   [policer <policer_id>]\n    token_unit = <token_unit>\n    color = <color_mode>\n    cir = <cir>\n    ebs = <ebs>\n    cbs = <cbs>\n \n+   [port <portnum> default]\n+   default_tc = <default_tc>\n+   mapping_priority = <mapping_priority>\n+\n    rate_limit_enable = <rate_limit_enable>\n    rate_limit = <rate_limit>\n    burst_size = <burst_size>\n \n+   default_policer = <policer_id>\n+\n    [port <portnum> tc <traffic_class>]\n    rxq = <rx_queue_list>\n    pcp = <pcp_list>\n@@ -201,7 +204,9 @@ Where:\n \n - ``<dscp_list>``: List of DSCP values to handle in particular TC (e.g. 0-12 32-48 63).\n \n-- ``<policer_enable>``: Enable ingress policer.\n+- ``<default_policer>``: Id of the policer configuration section to be used as default.\n+\n+- ``<policer_id>``: Id of the policer configuration section (0..31).\n \n - ``<token_unit>``: Policer token unit (`bytes` or `packets`).\n \n@@ -215,7 +220,7 @@ Where:\n \n - ``<default_color>``: Default color for specific tc.\n \n-- ``<rate_limit_enable>``: Enables per port or per txq rate limiting.\n+- ``<rate_limit_enable>``: Enables per port or per txq rate limiting (`0`/`1` to disable/enable).\n \n - ``<rate_limit>``: Committed information rate, in kilo bits per second.\n \n@@ -234,6 +239,13 @@ Configuration file example\n \n .. code-block:: console\n \n+   [policer 0]\n+   token_unit = bytes\n+   color = blind\n+   cir = 100000\n+   ebs = 64\n+   cbs = 64\n+\n    [port 0 default]\n    default_tc = 0\n    mapping_priority = ip\n@@ -265,12 +277,7 @@ Configuration file example\n    default_tc = 0\n    mapping_priority = vlan/ip\n \n-   policer_enable = 1\n-   token_unit = bytes\n-   color = blind\n-   cir = 100000\n-   ebs = 64\n-   cbs = 64\n+   default_policer = 0\n \n    [port 1 tc 0]\n    rxq = 0\ndiff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c\nindex a6cc550..0571635 100644\n--- a/drivers/net/mvpp2/mrvl_ethdev.c\n+++ b/drivers/net/mvpp2/mrvl_ethdev.c\n@@ -789,9 +789,9 @@ mrvl_dev_close(struct rte_eth_dev *dev)\n \t}\n \n \t/* policer must be released after ppio deinitialization */\n-\tif (priv->policer) {\n-\t\tpp2_cls_plcr_deinit(priv->policer);\n-\t\tpriv->policer = NULL;\n+\tif (priv->default_policer) {\n+\t\tpp2_cls_plcr_deinit(priv->default_policer);\n+\t\tpriv->default_policer = NULL;\n \t}\n }\n \ndiff --git a/drivers/net/mvpp2/mrvl_ethdev.h b/drivers/net/mvpp2/mrvl_ethdev.h\nindex ecb8fdc..de423a9 100644\n--- a/drivers/net/mvpp2/mrvl_ethdev.h\n+++ b/drivers/net/mvpp2/mrvl_ethdev.h\n@@ -168,7 +168,7 @@ struct mrvl_priv {\n \tuint32_t cls_tbl_pattern;\n \tLIST_HEAD(mrvl_flows, rte_flow) flows;\n \n-\tstruct pp2_cls_plcr *policer;\n+\tstruct pp2_cls_plcr *default_policer;\n \n \tLIST_HEAD(profiles, mrvl_mtr_profile) profiles;\n \tLIST_HEAD(mtrs, mrvl_mtr) mtrs;\ndiff --git a/drivers/net/mvpp2/mrvl_qos.c b/drivers/net/mvpp2/mrvl_qos.c\nindex eeb46f8..e039635 100644\n--- a/drivers/net/mvpp2/mrvl_qos.c\n+++ b/drivers/net/mvpp2/mrvl_qos.c\n@@ -42,7 +42,8 @@\n #define MRVL_TOK_WRR_WEIGHT \"wrr_weight\"\n \n /* policer specific configuration tokens */\n-#define MRVL_TOK_PLCR_ENABLE \"policer_enable\"\n+#define MRVL_TOK_PLCR \"policer\"\n+#define MRVL_TOK_PLCR_DEFAULT \"default_policer\"\n #define MRVL_TOK_PLCR_UNIT \"token_unit\"\n #define MRVL_TOK_PLCR_UNIT_BYTES \"bytes\"\n #define MRVL_TOK_PLCR_UNIT_PACKETS \"packets\"\n@@ -368,6 +369,9 @@ parse_tc_cfg(struct rte_cfgfile *file, int port, int tc,\n \t\tcfg->port[port].tc[tc].dscps = n;\n \t}\n \n+\tif (!cfg->port[port].setup_policer)\n+\t\treturn 0;\n+\n \tentry = rte_cfgfile_get_entry(file, sec_name,\n \t\t\tMRVL_TOK_PLCR_DEFAULT_COLOR);\n \tif (entry) {\n@@ -390,6 +394,85 @@ parse_tc_cfg(struct rte_cfgfile *file, int port, int tc,\n }\n \n /**\n+ * Parse default port policer.\n+ *\n+ * @param file Config file handle.\n+ * @param sec_name Section name with policer configuration\n+ * @param port Port number.\n+ * @param cfg[out] Parsing results.\n+ * @returns 0 in case of success, negative value otherwise.\n+ */\n+static int\n+parse_policer(struct rte_cfgfile *file, int port, const char *sec_name,\n+\t\tstruct mrvl_qos_cfg *cfg)\n+{\n+\tconst char *entry;\n+\tuint32_t val;\n+\n+\t/* Read policer token unit */\n+\tentry = rte_cfgfile_get_entry(file, sec_name, MRVL_TOK_PLCR_UNIT);\n+\tif (entry) {\n+\t\tif (!strncmp(entry, MRVL_TOK_PLCR_UNIT_BYTES,\n+\t\t\t\t\tsizeof(MRVL_TOK_PLCR_UNIT_BYTES))) {\n+\t\t\tcfg->port[port].policer_params.token_unit =\n+\t\t\t\tPP2_CLS_PLCR_BYTES_TOKEN_UNIT;\n+\t\t} else if (!strncmp(entry, MRVL_TOK_PLCR_UNIT_PACKETS,\n+\t\t\t\t\tsizeof(MRVL_TOK_PLCR_UNIT_PACKETS))) {\n+\t\t\tcfg->port[port].policer_params.token_unit =\n+\t\t\t\tPP2_CLS_PLCR_PACKETS_TOKEN_UNIT;\n+\t\t} else {\n+\t\t\tRTE_LOG(ERR, PMD, \"Unknown token: %s\\n\", entry);\n+\t\t\treturn -1;\n+\t\t}\n+\t}\n+\n+\t/* Read policer color mode */\n+\tentry = rte_cfgfile_get_entry(file, sec_name, MRVL_TOK_PLCR_COLOR);\n+\tif (entry) {\n+\t\tif (!strncmp(entry, MRVL_TOK_PLCR_COLOR_BLIND,\n+\t\t\t\t\tsizeof(MRVL_TOK_PLCR_COLOR_BLIND))) {\n+\t\t\tcfg->port[port].policer_params.color_mode =\n+\t\t\t\tPP2_CLS_PLCR_COLOR_BLIND_MODE;\n+\t\t} else if (!strncmp(entry, MRVL_TOK_PLCR_COLOR_AWARE,\n+\t\t\t\t\tsizeof(MRVL_TOK_PLCR_COLOR_AWARE))) {\n+\t\t\tcfg->port[port].policer_params.color_mode =\n+\t\t\t\tPP2_CLS_PLCR_COLOR_AWARE_MODE;\n+\t\t} else {\n+\t\t\tRTE_LOG(ERR, PMD, \"Error in parsing: %s\\n\", entry);\n+\t\t\treturn -1;\n+\t\t}\n+\t}\n+\n+\t/* Read policer cir */\n+\tentry = rte_cfgfile_get_entry(file, sec_name, MRVL_TOK_PLCR_CIR);\n+\tif (entry) {\n+\t\tif (get_val_securely(entry, &val) < 0)\n+\t\t\treturn -1;\n+\t\tcfg->port[port].policer_params.cir = val;\n+\t}\n+\n+\t/* Read policer cbs */\n+\tentry = rte_cfgfile_get_entry(file, sec_name, MRVL_TOK_PLCR_CBS);\n+\tif (entry) {\n+\t\tif (get_val_securely(entry, &val) < 0)\n+\t\t\treturn -1;\n+\t\tcfg->port[port].policer_params.cbs = val;\n+\t}\n+\n+\t/* Read policer ebs */\n+\tentry = rte_cfgfile_get_entry(file, sec_name, MRVL_TOK_PLCR_EBS);\n+\tif (entry) {\n+\t\tif (get_val_securely(entry, &val) < 0)\n+\t\t\treturn -1;\n+\t\tcfg->port[port].policer_params.ebs = val;\n+\t}\n+\n+\tcfg->port[port].setup_policer = 1;\n+\n+\treturn 0;\n+}\n+\n+/**\n  * Parse QoS configuration - rte_kvargs_process handler.\n  *\n  * Opens configuration file and parses its content.\n@@ -457,88 +540,6 @@ mrvl_get_qoscfg(const char *key __rte_unused, const char *path,\n \t\t\treturn -1;\n \t\t}\n \n-\t\tentry = rte_cfgfile_get_entry(file, sec_name,\n-\t\t\t\tMRVL_TOK_PLCR_ENABLE);\n-\t\tif (entry) {\n-\t\t\tif (get_val_securely(entry, &val) < 0)\n-\t\t\t\treturn -1;\n-\t\t\t(*cfg)->port[n].policer_enable = val;\n-\t\t}\n-\n-\t\tif ((*cfg)->port[n].policer_enable) {\n-\t\t\tenum pp2_cls_plcr_token_unit unit;\n-\n-\t\t\t/* Read policer token unit */\n-\t\t\tentry = rte_cfgfile_get_entry(file, sec_name,\n-\t\t\t\t\tMRVL_TOK_PLCR_UNIT);\n-\t\t\tif (entry) {\n-\t\t\t\tif (!strncmp(entry, MRVL_TOK_PLCR_UNIT_BYTES,\n-\t\t\t\t\tsizeof(MRVL_TOK_PLCR_UNIT_BYTES))) {\n-\t\t\t\t\tunit = PP2_CLS_PLCR_BYTES_TOKEN_UNIT;\n-\t\t\t\t} else if (!strncmp(entry,\n-\t\t\t\t\t\tMRVL_TOK_PLCR_UNIT_PACKETS,\n-\t\t\t\t\tsizeof(MRVL_TOK_PLCR_UNIT_PACKETS))) {\n-\t\t\t\t\tunit = PP2_CLS_PLCR_PACKETS_TOKEN_UNIT;\n-\t\t\t\t} else {\n-\t\t\t\t\tMRVL_LOG(ERR, \"Unknown token: %s\",\n-\t\t\t\t\t\tentry);\n-\t\t\t\t\treturn -1;\n-\t\t\t\t}\n-\t\t\t\t(*cfg)->port[n].policer_params.token_unit =\n-\t\t\t\t\tunit;\n-\t\t\t}\n-\n-\t\t\t/* Read policer color mode */\n-\t\t\tentry = rte_cfgfile_get_entry(file, sec_name,\n-\t\t\t\t\tMRVL_TOK_PLCR_COLOR);\n-\t\t\tif (entry) {\n-\t\t\t\tenum pp2_cls_plcr_color_mode mode;\n-\n-\t\t\t\tif (!strncmp(entry, MRVL_TOK_PLCR_COLOR_BLIND,\n-\t\t\t\t\tsizeof(MRVL_TOK_PLCR_COLOR_BLIND))) {\n-\t\t\t\t\tmode = PP2_CLS_PLCR_COLOR_BLIND_MODE;\n-\t\t\t\t} else if (!strncmp(entry,\n-\t\t\t\t\t\tMRVL_TOK_PLCR_COLOR_AWARE,\n-\t\t\t\t\tsizeof(MRVL_TOK_PLCR_COLOR_AWARE))) {\n-\t\t\t\t\tmode = PP2_CLS_PLCR_COLOR_AWARE_MODE;\n-\t\t\t\t} else {\n-\t\t\t\t\tMRVL_LOG(ERR,\n-\t\t\t\t\t\t\"Error in parsing: %s\",\n-\t\t\t\t\t\tentry);\n-\t\t\t\t\treturn -1;\n-\t\t\t\t}\n-\t\t\t\t(*cfg)->port[n].policer_params.color_mode =\n-\t\t\t\t\tmode;\n-\t\t\t}\n-\n-\t\t\t/* Read policer cir */\n-\t\t\tentry = rte_cfgfile_get_entry(file, sec_name,\n-\t\t\t\t\tMRVL_TOK_PLCR_CIR);\n-\t\t\tif (entry) {\n-\t\t\t\tif (get_val_securely(entry, &val) < 0)\n-\t\t\t\t\treturn -1;\n-\t\t\t\t(*cfg)->port[n].policer_params.cir = val;\n-\t\t\t}\n-\n-\t\t\t/* Read policer cbs */\n-\t\t\tentry = rte_cfgfile_get_entry(file, sec_name,\n-\t\t\t\t\tMRVL_TOK_PLCR_CBS);\n-\t\t\tif (entry) {\n-\t\t\t\tif (get_val_securely(entry, &val) < 0)\n-\t\t\t\t\treturn -1;\n-\t\t\t\t(*cfg)->port[n].policer_params.cbs = val;\n-\t\t\t}\n-\n-\t\t\t/* Read policer ebs */\n-\t\t\tentry = rte_cfgfile_get_entry(file, sec_name,\n-\t\t\t\t\tMRVL_TOK_PLCR_EBS);\n-\t\t\tif (entry) {\n-\t\t\t\tif (get_val_securely(entry, &val) < 0)\n-\t\t\t\t\treturn -1;\n-\t\t\t\t(*cfg)->port[n].policer_params.ebs = val;\n-\t\t\t}\n-\t\t}\n-\n \t\t/*\n \t\t * Read per-port rate limiting. Setting that will\n \t\t * disable per-queue rate limiting.\n@@ -597,6 +598,20 @@ mrvl_get_qoscfg(const char *key __rte_unused, const char *path,\n \t\t\t\tPP2_CLS_QOS_TBL_VLAN_IP_PRI;\n \t\t}\n \n+\t\t/* Parse policer configuration (if any) */\n+\t\tentry = rte_cfgfile_get_entry(file, sec_name,\n+\t\t\t\tMRVL_TOK_PLCR_DEFAULT);\n+\t\tif (entry) {\n+\t\t\tif (get_val_securely(entry, &val) < 0)\n+\t\t\t\treturn -1;\n+\n+\t\t\tsnprintf(sec_name, sizeof(sec_name), \"%s %d\",\n+\t\t\t\t\tMRVL_TOK_PLCR, val);\n+\t\t\tret = parse_policer(file, n, sec_name, *cfg);\n+\t\t\tif (ret)\n+\t\t\t\treturn -1;\n+\t\t}\n+\n \t\tfor (i = 0; i < MRVL_PP2_RXQ_MAX; ++i) {\n \t\t\tret = get_outq_cfg(file, n, i, *cfg);\n \t\t\tif (ret < 0)\n@@ -659,6 +674,7 @@ setup_tc(struct pp2_ppio_tc_params *param, uint8_t inqs,\n  *\n  * @param priv Port's private data.\n  * @param params Pointer to the policer's configuration.\n+ * @param plcr_id Policer id.\n  * @returns 0 in case of success, negative values otherwise.\n  */\n static int\n@@ -667,17 +683,23 @@ setup_policer(struct mrvl_priv *priv, struct pp2_cls_plcr_params *params)\n \tchar match[16];\n \tint ret;\n \n-\tsnprintf(match, sizeof(match), \"policer-%d:%d\\n\",\n-\t\t\tpriv->pp_id, priv->ppio_id);\n+\t/*\n+\t * At this point no other policers are used which means\n+\t * any policer can be picked up and used as a default one.\n+\t *\n+\t * Lets use 0th then.\n+\t */\n+\tsprintf(match, \"policer-%d:%d\\n\", priv->pp_id, 0);\n \tparams->match = match;\n \n-\tret = pp2_cls_plcr_init(params, &priv->policer);\n+\tret = pp2_cls_plcr_init(params, &priv->default_policer);\n \tif (ret) {\n \t\tMRVL_LOG(ERR, \"Failed to setup %s\", match);\n \t\treturn -1;\n \t}\n \n-\tpriv->ppio_params.inqs_params.plcr = priv->policer;\n+\tpriv->ppio_params.inqs_params.plcr = priv->default_policer;\n+\tpriv->used_plcrs = BIT(0);\n \n \treturn 0;\n }\n@@ -809,7 +831,7 @@ mrvl_configure_rxqs(struct mrvl_priv *priv, uint16_t portid,\n \n \tpriv->ppio_params.inqs_params.num_tcs = i;\n \n-\tif (port_cfg->policer_enable)\n+\tif (port_cfg->setup_policer)\n \t\treturn setup_policer(priv, &port_cfg->policer_params);\n \n \treturn 0;\ndiff --git a/drivers/net/mvpp2/mrvl_qos.h b/drivers/net/mvpp2/mrvl_qos.h\nindex fa9ddec..f03e773 100644\n--- a/drivers/net/mvpp2/mrvl_qos.h\n+++ b/drivers/net/mvpp2/mrvl_qos.h\n@@ -43,7 +43,7 @@ struct mrvl_qos_cfg {\n \t\tuint8_t default_tc;\n \t\tuint8_t use_global_defaults;\n \t\tstruct pp2_cls_plcr_params policer_params;\n-\t\tuint8_t policer_enable;\n+\t\tuint8_t setup_policer;\n \t} port[RTE_MAX_ETHPORTS];\n };\n \n",
    "prefixes": [
        "v3",
        "04/13"
    ]
}