Show a patch.

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

{
    "id": 73406,
    "url": "https://patches.dpdk.org/api/patches/73406/",
    "web_url": "https://patches.dpdk.org/patch/73406/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/",
        "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"
    },
    "msgid": "<20200707092244.12791-27-hemant.agrawal@nxp.com>",
    "date": "2020-07-07T09:22:41",
    "name": "[v2,26/29] net/dpaa2: modify flow API QoS setup to follow FS setup",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "58f3d94ec7663768f6be963cde92d6c1b936f315",
    "submitter": {
        "id": 477,
        "url": "https://patches.dpdk.org/api/people/477/",
        "name": "Hemant Agrawal",
        "email": "hemant.agrawal@nxp.com"
    },
    "delegate": {
        "id": 319,
        "url": "https://patches.dpdk.org/api/users/319/",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@intel.com"
    },
    "mbox": "https://patches.dpdk.org/patch/73406/mbox/",
    "series": [
        {
            "id": 10842,
            "url": "https://patches.dpdk.org/api/series/10842/",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=10842",
            "date": "2020-07-07T09:22:15",
            "name": "NXP DPAAx enhancements",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/10842/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/73406/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/73406/checks/",
    "tags": {},
    "headers": {
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "Return-Path": "<dev-bounces@dpdk.org>",
        "Message-Id": "<20200707092244.12791-27-hemant.agrawal@nxp.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "To": "dev@dpdk.org",
        "Cc": "ferruh.yigit@intel.com,\n\tJun Yang <jun.yang@nxp.com>",
        "X-BeenThere": "dev@dpdk.org",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 017A0A00BE;\n\tTue,  7 Jul 2020 11:32:41 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id D46E71DE1B;\n\tTue,  7 Jul 2020 11:27:38 +0200 (CEST)",
            "from inva021.nxp.com (inva021.nxp.com [92.121.34.21])\n by dpdk.org (Postfix) with ESMTP id D7AE31DD5F\n for <dev@dpdk.org>; Tue,  7 Jul 2020 11:27:16 +0200 (CEST)",
            "from inva021.nxp.com (localhost [127.0.0.1])\n by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id BBBEB20060D;\n Tue,  7 Jul 2020 11:27:16 +0200 (CEST)",
            "from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com\n [165.114.16.14])\n by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id C0F822008CE;\n Tue,  7 Jul 2020 11:27:14 +0200 (CEST)",
            "from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net\n [10.232.133.63])\n by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 84AF4402F7;\n Tue,  7 Jul 2020 17:27:12 +0800 (SGT)"
        ],
        "Subject": "[dpdk-dev] [PATCH v2 26/29] net/dpaa2: modify flow API QoS setup to\n\tfollow FS setup",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "In-Reply-To": "<20200707092244.12791-1-hemant.agrawal@nxp.com>",
        "Precedence": "list",
        "From": "Hemant Agrawal <hemant.agrawal@nxp.com>",
        "References": "<20200527132326.1382-1-hemant.agrawal@nxp.com>\n <20200707092244.12791-1-hemant.agrawal@nxp.com>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "Errors-To": "dev-bounces@dpdk.org",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Date": "Tue,  7 Jul 2020 14:52:41 +0530",
        "X-Mailman-Version": "2.1.15",
        "X-Virus-Scanned": "ClamAV using ClamSMTP",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>"
    },
    "content": "From: Jun Yang <jun.yang@nxp.com>\n\nIn HW/MC logical, QoS setup should follow FS setup.\nIn addition, Skip QoS setup if MAX TC number of DPNI is set 1.\n\nSigned-off-by: Jun Yang <jun.yang@nxp.com>\n---\n drivers/net/dpaa2/dpaa2_flow.c | 151 ++++++++++++++++++---------------\n 1 file changed, 84 insertions(+), 67 deletions(-)",
    "diff": "diff --git a/drivers/net/dpaa2/dpaa2_flow.c b/drivers/net/dpaa2/dpaa2_flow.c\nindex 3601829c9..9239fa459 100644\n--- a/drivers/net/dpaa2/dpaa2_flow.c\n+++ b/drivers/net/dpaa2/dpaa2_flow.c\n@@ -2872,11 +2872,13 @@ dpaa2_flow_entry_update(\n \n \t\tdpaa2_flow_qos_entry_log(\"Before update\", curr, qos_index);\n \n-\t\tret = dpni_remove_qos_entry(dpni, CMD_PRI_LOW,\n-\t\t\t\tpriv->token, &curr->qos_rule);\n-\t\tif (ret) {\n-\t\t\tDPAA2_PMD_ERR(\"Qos entry remove failed.\");\n-\t\t\treturn -1;\n+\t\tif (priv->num_rx_tc > 1) {\n+\t\t\tret = dpni_remove_qos_entry(dpni, CMD_PRI_LOW,\n+\t\t\t\t\tpriv->token, &curr->qos_rule);\n+\t\t\tif (ret) {\n+\t\t\t\tDPAA2_PMD_ERR(\"Qos entry remove failed.\");\n+\t\t\t\treturn -1;\n+\t\t\t}\n \t\t}\n \n \t\textend = -1;\n@@ -2977,13 +2979,15 @@ dpaa2_flow_entry_update(\n \n \t\tdpaa2_flow_qos_entry_log(\"Start update\", curr, qos_index);\n \n-\t\tret = dpni_add_qos_entry(dpni, CMD_PRI_LOW,\n-\t\t\t\tpriv->token, &curr->qos_rule,\n-\t\t\t\tcurr->tc_id, qos_index,\n-\t\t\t\t0, 0);\n-\t\tif (ret) {\n-\t\t\tDPAA2_PMD_ERR(\"Qos entry update failed.\");\n-\t\t\treturn -1;\n+\t\tif (priv->num_rx_tc > 1) {\n+\t\t\tret = dpni_add_qos_entry(dpni, CMD_PRI_LOW,\n+\t\t\t\t\tpriv->token, &curr->qos_rule,\n+\t\t\t\t\tcurr->tc_id, qos_index,\n+\t\t\t\t\t0, 0);\n+\t\t\tif (ret) {\n+\t\t\t\tDPAA2_PMD_ERR(\"Qos entry update failed.\");\n+\t\t\t\treturn -1;\n+\t\t\t}\n \t\t}\n \n \t\tif (curr->action != RTE_FLOW_ACTION_TYPE_QUEUE) {\n@@ -3313,31 +3317,8 @@ dpaa2_generic_flow_set(struct rte_flow *flow,\n \t\t\tflow->action = RTE_FLOW_ACTION_TYPE_QUEUE;\n \t\t\tmemset(&action, 0, sizeof(struct dpni_fs_action_cfg));\n \t\t\taction.flow_id = rxq->flow_id;\n-\t\t\tif (is_keycfg_configured & DPAA2_QOS_TABLE_RECONFIGURE) {\n-\t\t\t\tdpaa2_flow_qos_table_extracts_log(priv);\n-\t\t\t\tif (dpkg_prepare_key_cfg(\n-\t\t\t\t\t&priv->extract.qos_key_extract.dpkg,\n-\t\t\t\t\t(uint8_t *)(size_t)priv->extract.qos_extract_param)\n-\t\t\t\t\t< 0) {\n-\t\t\t\t\tDPAA2_PMD_ERR(\n-\t\t\t\t\t\"Unable to prepare extract parameters\");\n-\t\t\t\t\treturn -1;\n-\t\t\t\t}\n \n-\t\t\t\tmemset(&qos_cfg, 0, sizeof(struct dpni_qos_tbl_cfg));\n-\t\t\t\tqos_cfg.discard_on_miss = true;\n-\t\t\t\tqos_cfg.keep_entries = true;\n-\t\t\t\tqos_cfg.key_cfg_iova =\n-\t\t\t\t\t(size_t)priv->extract.qos_extract_param;\n-\t\t\t\tret = dpni_set_qos_table(dpni, CMD_PRI_LOW,\n-\t\t\t\t\t\tpriv->token, &qos_cfg);\n-\t\t\t\tif (ret < 0) {\n-\t\t\t\t\tDPAA2_PMD_ERR(\n-\t\t\t\t\t\"Distribution cannot be configured.(%d)\"\n-\t\t\t\t\t, ret);\n-\t\t\t\t\treturn -1;\n-\t\t\t\t}\n-\t\t\t}\n+\t\t\t/* Configure FS table first*/\n \t\t\tif (is_keycfg_configured & DPAA2_FS_TABLE_RECONFIGURE) {\n \t\t\t\tdpaa2_flow_fs_table_extracts_log(priv, flow->tc_id);\n \t\t\t\tif (dpkg_prepare_key_cfg(\n@@ -3366,17 +3347,39 @@ dpaa2_generic_flow_set(struct rte_flow *flow,\n \t\t\t\t\treturn -1;\n \t\t\t\t}\n \t\t\t}\n-\t\t\t/* Configure QoS table first */\n \n-\t\t\tqos_index = flow->tc_id * priv->fs_entries +\n-\t\t\t\tflow->tc_index;\n+\t\t\t/* Configure QoS table then.*/\n+\t\t\tif (is_keycfg_configured & DPAA2_QOS_TABLE_RECONFIGURE) {\n+\t\t\t\tdpaa2_flow_qos_table_extracts_log(priv);\n+\t\t\t\tif (dpkg_prepare_key_cfg(\n+\t\t\t\t\t&priv->extract.qos_key_extract.dpkg,\n+\t\t\t\t\t(uint8_t *)(size_t)priv->extract.qos_extract_param) < 0) {\n+\t\t\t\t\tDPAA2_PMD_ERR(\n+\t\t\t\t\t\t\"Unable to prepare extract parameters\");\n+\t\t\t\t\treturn -1;\n+\t\t\t\t}\n \n-\t\t\tif (qos_index >= priv->qos_entries) {\n-\t\t\t\tDPAA2_PMD_ERR(\"QoS table with %d entries full\",\n-\t\t\t\t\tpriv->qos_entries);\n-\t\t\t\treturn -1;\n+\t\t\t\tmemset(&qos_cfg, 0, sizeof(struct dpni_qos_tbl_cfg));\n+\t\t\t\tqos_cfg.discard_on_miss = false;\n+\t\t\t\tqos_cfg.default_tc = 0;\n+\t\t\t\tqos_cfg.keep_entries = true;\n+\t\t\t\tqos_cfg.key_cfg_iova =\n+\t\t\t\t\t(size_t)priv->extract.qos_extract_param;\n+\t\t\t\t/* QoS table is effecitive for multiple TCs.*/\n+\t\t\t\tif (priv->num_rx_tc > 1) {\n+\t\t\t\t\tret = dpni_set_qos_table(dpni, CMD_PRI_LOW,\n+\t\t\t\t\t\tpriv->token, &qos_cfg);\n+\t\t\t\t\tif (ret < 0) {\n+\t\t\t\t\t\tDPAA2_PMD_ERR(\n+\t\t\t\t\t\t\"RSS QoS table can not be configured(%d)\\n\",\n+\t\t\t\t\t\t\tret);\n+\t\t\t\t\t\treturn -1;\n+\t\t\t\t\t}\n+\t\t\t\t}\n \t\t\t}\n-\t\t\tflow->qos_rule.key_size = FIXED_ENTRY_SIZE;\n+\n+\t\t\tflow->qos_real_key_size = priv->extract\n+\t\t\t\t.qos_key_extract.key_info.key_total_size;\n \t\t\tif (flow->ipaddr_rule.ipaddr_type == FLOW_IPV4_ADDR) {\n \t\t\t\tif (flow->ipaddr_rule.qos_ipdst_offset >=\n \t\t\t\t\tflow->ipaddr_rule.qos_ipsrc_offset) {\n@@ -3402,21 +3405,30 @@ dpaa2_generic_flow_set(struct rte_flow *flow,\n \t\t\t\t}\n \t\t\t}\n \n-\t\t\tflow->qos_rule.key_size = FIXED_ENTRY_SIZE;\n+\t\t\t/* QoS entry added is only effective for multiple TCs.*/\n+\t\t\tif (priv->num_rx_tc > 1) {\n+\t\t\t\tqos_index = flow->tc_id * priv->fs_entries +\n+\t\t\t\t\tflow->tc_index;\n+\t\t\t\tif (qos_index >= priv->qos_entries) {\n+\t\t\t\t\tDPAA2_PMD_ERR(\"QoS table with %d entries full\",\n+\t\t\t\t\t\tpriv->qos_entries);\n+\t\t\t\t\treturn -1;\n+\t\t\t\t}\n+\t\t\t\tflow->qos_rule.key_size = FIXED_ENTRY_SIZE;\n \n-\t\t\tdpaa2_flow_qos_entry_log(\"Start add\", flow, qos_index);\n+\t\t\t\tdpaa2_flow_qos_entry_log(\"Start add\", flow, qos_index);\n \n-\t\t\tret = dpni_add_qos_entry(dpni, CMD_PRI_LOW,\n+\t\t\t\tret = dpni_add_qos_entry(dpni, CMD_PRI_LOW,\n \t\t\t\t\t\tpriv->token, &flow->qos_rule,\n \t\t\t\t\t\tflow->tc_id, qos_index,\n \t\t\t\t\t\t0, 0);\n-\t\t\tif (ret < 0) {\n-\t\t\t\tDPAA2_PMD_ERR(\n-\t\t\t\t\"Error in addnig entry to QoS table(%d)\", ret);\n-\t\t\t\treturn ret;\n+\t\t\t\tif (ret < 0) {\n+\t\t\t\t\tDPAA2_PMD_ERR(\n+\t\t\t\t\t\t\"Error in addnig entry to QoS table(%d)\", ret);\n+\t\t\t\t\treturn ret;\n+\t\t\t\t}\n \t\t\t}\n \n-\t\t\t/* Then Configure FS table */\n \t\t\tif (flow->tc_index >= priv->fs_entries) {\n \t\t\t\tDPAA2_PMD_ERR(\"FS table with %d entries full\",\n \t\t\t\t\tpriv->fs_entries);\n@@ -3507,7 +3519,8 @@ dpaa2_generic_flow_set(struct rte_flow *flow,\n \t\t\t\t\t\t &tc_cfg);\n \t\t\tif (ret < 0) {\n \t\t\t\tDPAA2_PMD_ERR(\n-\t\t\t\t\"Distribution cannot be configured: %d\\n\", ret);\n+\t\t\t\t\t\"RSS FS table cannot be configured: %d\\n\",\n+\t\t\t\t\tret);\n \t\t\t\trte_free((void *)param);\n \t\t\t\treturn -1;\n \t\t\t}\n@@ -3841,13 +3854,15 @@ int dpaa2_flow_destroy(struct rte_eth_dev *dev,\n \n \tswitch (flow->action) {\n \tcase RTE_FLOW_ACTION_TYPE_QUEUE:\n-\t\t/* Remove entry from QoS table first */\n-\t\tret = dpni_remove_qos_entry(dpni, CMD_PRI_LOW, priv->token,\n-\t\t\t\t\t   &flow->qos_rule);\n-\t\tif (ret < 0) {\n-\t\t\tDPAA2_PMD_ERR(\n-\t\t\t\t\"Error in adding entry to QoS table(%d)\", ret);\n-\t\t\tgoto error;\n+\t\tif (priv->num_rx_tc > 1) {\n+\t\t\t/* Remove entry from QoS table first */\n+\t\t\tret = dpni_remove_qos_entry(dpni, CMD_PRI_LOW, priv->token,\n+\t\t\t\t\t&flow->qos_rule);\n+\t\t\tif (ret < 0) {\n+\t\t\t\tDPAA2_PMD_ERR(\n+\t\t\t\t\t\"Error in removing entry from QoS table(%d)\", ret);\n+\t\t\t\tgoto error;\n+\t\t\t}\n \t\t}\n \n \t\t/* Then remove entry from FS table */\n@@ -3855,17 +3870,19 @@ int dpaa2_flow_destroy(struct rte_eth_dev *dev,\n \t\t\t\t\t   flow->tc_id, &flow->fs_rule);\n \t\tif (ret < 0) {\n \t\t\tDPAA2_PMD_ERR(\n-\t\t\t\t\"Error in entry addition in FS table(%d)\", ret);\n+\t\t\t\t\"Error in removing entry from FS table(%d)\", ret);\n \t\t\tgoto error;\n \t\t}\n \t\tbreak;\n \tcase RTE_FLOW_ACTION_TYPE_RSS:\n-\t\tret = dpni_remove_qos_entry(dpni, CMD_PRI_LOW, priv->token,\n-\t\t\t\t\t   &flow->qos_rule);\n-\t\tif (ret < 0) {\n-\t\t\tDPAA2_PMD_ERR(\n-\t\t\t\"Error in entry addition in QoS table(%d)\", ret);\n-\t\t\tgoto error;\n+\t\tif (priv->num_rx_tc > 1) {\n+\t\t\tret = dpni_remove_qos_entry(dpni, CMD_PRI_LOW, priv->token,\n+\t\t\t\t\t&flow->qos_rule);\n+\t\t\tif (ret < 0) {\n+\t\t\t\tDPAA2_PMD_ERR(\n+\t\t\t\t\t\"Error in entry addition in QoS table(%d)\", ret);\n+\t\t\t\tgoto error;\n+\t\t\t}\n \t\t}\n \t\tbreak;\n \tdefault:\n",
    "prefixes": [
        "v2",
        "26/29"
    ]
}