Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/88565/?format=api
http://patches.dpdk.org/api/patches/88565/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20210305133918.8005-39-ndabilpuram@marvell.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": "<20210305133918.8005-39-ndabilpuram@marvell.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20210305133918.8005-39-ndabilpuram@marvell.com", "date": "2021-03-05T13:39:04", "name": "[38/52] common/cnxk: add nix tm dynamic update support", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "199b963753cac6fc206b7a15521d33a66e8c28b6", "submitter": { "id": 1202, "url": "http://patches.dpdk.org/api/people/1202/?format=api", "name": "Nithin Dabilpuram", "email": "ndabilpuram@marvell.com" }, "delegate": { "id": 310, "url": "http://patches.dpdk.org/api/users/310/?format=api", "username": "jerin", "first_name": "Jerin", "last_name": "Jacob", "email": "jerinj@marvell.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20210305133918.8005-39-ndabilpuram@marvell.com/mbox/", "series": [ { "id": 15508, "url": "http://patches.dpdk.org/api/series/15508/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=15508", "date": "2021-03-05T13:38:26", "name": "Add Marvell CNXK common driver", "version": 1, "mbox": "http://patches.dpdk.org/series/15508/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/88565/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/88565/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 70881A0547;\n\tFri, 5 Mar 2021 14:46:29 +0100 (CET)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 7C26122A447;\n\tFri, 5 Mar 2021 14:41:28 +0100 (CET)", "from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com\n [67.231.148.174])\n by mails.dpdk.org (Postfix) with ESMTP id 1D76822A440\n for <dev@dpdk.org>; Fri, 5 Mar 2021 14:41:25 +0100 (CET)", "from pps.filterd (m0045849.ppops.net [127.0.0.1])\n by mx0a-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id\n 125DelDS001639 for <dev@dpdk.org>; Fri, 5 Mar 2021 05:41:25 -0800", "from dc5-exch01.marvell.com ([199.233.59.181])\n by mx0a-0016f401.pphosted.com with ESMTP id 372s2umrr5-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT)\n for <dev@dpdk.org>; Fri, 05 Mar 2021 05:41:25 -0800", "from SC-EXCH04.marvell.com (10.93.176.84) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2;\n Fri, 5 Mar 2021 05:41:24 -0800", "from DC5-EXCH02.marvell.com (10.69.176.39) by SC-EXCH04.marvell.com\n (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1497.2;\n Fri, 5 Mar 2021 05:41:23 -0800", "from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.2 via Frontend\n Transport; Fri, 5 Mar 2021 05:41:23 -0800", "from hyd1588t430.marvell.com (unknown [10.29.52.204])\n by maili.marvell.com (Postfix) with ESMTP id D0E9F3F703F;\n Fri, 5 Mar 2021 05:41:20 -0800 (PST)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n h=from : to : cc :\n subject : date : message-id : in-reply-to : references : mime-version :\n content-type; s=pfpt0220; bh=D7ugJKsMhXgt5zKqzwGjvKJRUsGhr0uusgE7hXyL8wE=;\n b=LqtPAeIARlDjV2foUpaIGCRFDX4H29U7+WmH1N4CpL6KyvVAJNgOTvfTqx6r2pPMt6Lb\n jVz8jCgtqiEZxUcNIwIs0s1eAPbmJJ4AKs30JMOHeXwdXM6rzjyVN1UGjjq6MeemGFPT\n /8QaajCvjhhC1kiCBfQ73uoiRiIsYYrhuT+JbbE5k6Re7mL59QQ9x+2mVoBtEICUVzWq\n XRFPtIqstC1Xono6JYhVGcHiaUyq2E8V5JWHqBguF1NF3eMUsy40O2Jf6SgDv0eKaF01\n u8zGkJDauM0vJxWvL6ioypu9Gx/JxdkYNFHt3xJhRiy6+kTwVzZ+g7uavTwZBbDVxuPQ 9A==", "From": "Nithin Dabilpuram <ndabilpuram@marvell.com>", "To": "<dev@dpdk.org>", "CC": "<jerinj@marvell.com>, <skori@marvell.com>, <skoteshwar@marvell.com>,\n <pbhagavatula@marvell.com>, <kirankumark@marvell.com>,\n <psatheesh@marvell.com>, <asekhar@marvell.com>, Nithin Dabilpuram\n <ndabilpuram@marvell.com>", "Date": "Fri, 5 Mar 2021 19:09:04 +0530", "Message-ID": "<20210305133918.8005-39-ndabilpuram@marvell.com>", "X-Mailer": "git-send-email 2.8.4", "In-Reply-To": "<20210305133918.8005-1-ndabilpuram@marvell.com>", "References": "<20210305133918.8005-1-ndabilpuram@marvell.com>", "MIME-Version": "1.0", "Content-Type": "text/plain", "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10434:6.0.369, 18.0.761\n definitions=2021-03-05_08:2021-03-03,\n 2021-03-05 signatures=0", "Subject": "[dpdk-dev] [PATCH 38/52] common/cnxk: add nix tm dynamic update\n support", "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", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "Add support for dynamic node update of shaper profile,\nRR quantum and also support to suspend or resume an active\nTM node.\n\nSigned-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>\n---\n drivers/common/cnxk/roc_nix.h | 10 ++\n drivers/common/cnxk/roc_nix_tm_ops.c | 220 +++++++++++++++++++++++++++++++++++\n drivers/common/cnxk/version.map | 3 +\n 3 files changed, 233 insertions(+)", "diff": "diff --git a/drivers/common/cnxk/roc_nix.h b/drivers/common/cnxk/roc_nix.h\nindex 859995b..84ec09f 100644\n--- a/drivers/common/cnxk/roc_nix.h\n+++ b/drivers/common/cnxk/roc_nix.h\n@@ -362,6 +362,16 @@ int __roc_api roc_nix_tm_node_add(struct roc_nix *roc_nix,\n int __roc_api roc_nix_tm_node_delete(struct roc_nix *roc_nix, uint32_t node_id,\n \t\t\t\t bool free);\n int __roc_api roc_nix_tm_free_resources(struct roc_nix *roc_nix, bool hw_only);\n+int __roc_api roc_nix_tm_node_suspend_resume(struct roc_nix *roc_nix,\n+\t\t\t\t\t uint32_t node_id, bool suspend);\n+int __roc_api roc_nix_tm_node_parent_update(struct roc_nix *roc_nix,\n+\t\t\t\t\t uint32_t node_id,\n+\t\t\t\t\t uint32_t new_parent_id,\n+\t\t\t\t\t uint32_t priority, uint32_t weight);\n+int __roc_api roc_nix_tm_node_shaper_update(struct roc_nix *roc_nix,\n+\t\t\t\t\t uint32_t node_id,\n+\t\t\t\t\t uint32_t profile_id,\n+\t\t\t\t\t bool force_update);\n int __roc_api roc_nix_tm_node_pkt_mode_update(struct roc_nix *roc_nix,\n \t\t\t\t\t uint32_t node_id, bool pkt_mode);\n int __roc_api roc_nix_tm_shaper_profile_add(\ndiff --git a/drivers/common/cnxk/roc_nix_tm_ops.c b/drivers/common/cnxk/roc_nix_tm_ops.c\nindex 6274f32..b383ef2 100644\n--- a/drivers/common/cnxk/roc_nix_tm_ops.c\n+++ b/drivers/common/cnxk/roc_nix_tm_ops.c\n@@ -545,6 +545,226 @@ roc_nix_tm_hierarchy_enable(struct roc_nix *roc_nix, enum roc_nix_tm_tree tree,\n }\n \n int\n+roc_nix_tm_node_suspend_resume(struct roc_nix *roc_nix, uint32_t node_id,\n+\t\t\t bool suspend)\n+{\n+\tstruct nix *nix = roc_nix_to_nix_priv(roc_nix);\n+\tstruct mbox *mbox = (&nix->dev)->mbox;\n+\tstruct nix_txschq_config *req;\n+\tstruct nix_tm_node *node;\n+\tuint16_t flags;\n+\tint rc;\n+\n+\tnode = nix_tm_node_search(nix, node_id, ROC_NIX_TM_USER);\n+\tif (!node)\n+\t\treturn NIX_ERR_TM_INVALID_NODE;\n+\n+\tflags = node->flags;\n+\tflags = suspend ? (flags & ~NIX_TM_NODE_ENABLED) :\n+\t\t\t\t(flags | NIX_TM_NODE_ENABLED);\n+\n+\tif (node->flags == flags)\n+\t\treturn 0;\n+\n+\t/* send mbox for state change */\n+\treq = mbox_alloc_msg_nix_txschq_cfg(mbox);\n+\n+\treq->lvl = node->hw_lvl;\n+\treq->num_regs =\n+\t\tnix_tm_sw_xoff_prep(node, suspend, req->reg, req->regval);\n+\trc = mbox_process(mbox);\n+\tif (!rc)\n+\t\tnode->flags = flags;\n+\treturn rc;\n+}\n+\n+int\n+roc_nix_tm_node_shaper_update(struct roc_nix *roc_nix, uint32_t node_id,\n+\t\t\t uint32_t profile_id, bool force_update)\n+{\n+\tstruct nix *nix = roc_nix_to_nix_priv(roc_nix);\n+\tstruct nix_tm_shaper_profile *profile = NULL;\n+\tstruct mbox *mbox = (&nix->dev)->mbox;\n+\tstruct nix_txschq_config *req;\n+\tstruct nix_tm_node *node;\n+\tuint8_t k;\n+\tint rc;\n+\n+\t/* Shaper updates valid only for user nodes */\n+\tnode = nix_tm_node_search(nix, node_id, ROC_NIX_TM_USER);\n+\tif (!node || nix_tm_is_leaf(nix, node->lvl))\n+\t\treturn NIX_ERR_TM_INVALID_NODE;\n+\n+\tif (profile_id != ROC_NIX_TM_SHAPER_PROFILE_NONE) {\n+\t\tprofile = nix_tm_shaper_profile_search(nix, profile_id);\n+\t\tif (!profile)\n+\t\t\treturn NIX_ERR_TM_INVALID_SHAPER_PROFILE;\n+\t}\n+\n+\t/* Pkt mode should match existing node's pkt mode */\n+\tif (profile && profile->pkt_mode != node->pkt_mode)\n+\t\treturn NIX_ERR_TM_PKT_MODE_MISMATCH;\n+\n+\tif ((profile_id == node->shaper_profile_id) && !force_update) {\n+\t\treturn 0;\n+\t} else if (profile_id != node->shaper_profile_id) {\n+\t\tstruct nix_tm_shaper_profile *old;\n+\n+\t\t/* Find old shaper profile and reduce ref count */\n+\t\told = nix_tm_shaper_profile_search(nix,\n+\t\t\t\t\t\t node->shaper_profile_id);\n+\t\tif (old)\n+\t\t\told->ref_cnt--;\n+\n+\t\tif (profile)\n+\t\t\tprofile->ref_cnt++;\n+\n+\t\t/* Reduce older shaper ref count and increase new one */\n+\t\tnode->shaper_profile_id = profile_id;\n+\t}\n+\n+\t/* Nothing to do if hierarchy not yet enabled */\n+\tif (!(nix->tm_flags & NIX_TM_HIERARCHY_ENA))\n+\t\treturn 0;\n+\n+\tnode->flags &= ~NIX_TM_NODE_ENABLED;\n+\n+\t/* Flush the specific node with SW_XOFF */\n+\treq = mbox_alloc_msg_nix_txschq_cfg(mbox);\n+\treq->lvl = node->hw_lvl;\n+\tk = nix_tm_sw_xoff_prep(node, true, req->reg, req->regval);\n+\treq->num_regs = k;\n+\n+\trc = mbox_process(mbox);\n+\tif (rc)\n+\t\treturn rc;\n+\n+\t/* Update the PIR/CIR and clear SW XOFF */\n+\treq = mbox_alloc_msg_nix_txschq_cfg(mbox);\n+\treq->lvl = node->hw_lvl;\n+\n+\tk = nix_tm_shaper_reg_prep(node, profile, req->reg, req->regval);\n+\n+\tk += nix_tm_sw_xoff_prep(node, false, &req->reg[k], &req->regval[k]);\n+\n+\treq->num_regs = k;\n+\trc = mbox_process(mbox);\n+\tif (!rc)\n+\t\tnode->flags |= NIX_TM_NODE_ENABLED;\n+\treturn rc;\n+}\n+\n+int\n+roc_nix_tm_node_parent_update(struct roc_nix *roc_nix, uint32_t node_id,\n+\t\t\t uint32_t new_parent_id, uint32_t priority,\n+\t\t\t uint32_t weight)\n+{\n+\tstruct nix *nix = roc_nix_to_nix_priv(roc_nix);\n+\tstruct mbox *mbox = (&nix->dev)->mbox;\n+\tstruct nix_tm_node *node, *sibling;\n+\tstruct nix_tm_node *new_parent;\n+\tstruct nix_txschq_config *req;\n+\tstruct nix_tm_node_list *list;\n+\tuint8_t k;\n+\tint rc;\n+\n+\tnode = nix_tm_node_search(nix, node_id, ROC_NIX_TM_USER);\n+\tif (!node)\n+\t\treturn NIX_ERR_TM_INVALID_NODE;\n+\n+\t/* Parent id valid only for non root nodes */\n+\tif (node->hw_lvl != nix->tm_root_lvl) {\n+\t\tnew_parent =\n+\t\t\tnix_tm_node_search(nix, new_parent_id, ROC_NIX_TM_USER);\n+\t\tif (!new_parent)\n+\t\t\treturn NIX_ERR_TM_INVALID_PARENT;\n+\n+\t\t/* Current support is only for dynamic weight update */\n+\t\tif (node->parent != new_parent || node->priority != priority)\n+\t\t\treturn NIX_ERR_TM_PARENT_PRIO_UPDATE;\n+\t}\n+\n+\tlist = nix_tm_node_list(nix, ROC_NIX_TM_USER);\n+\t/* Skip if no change */\n+\tif (node->weight == weight)\n+\t\treturn 0;\n+\n+\tnode->weight = weight;\n+\n+\t/* Nothing to do if hierarchy not yet enabled */\n+\tif (!(nix->tm_flags & NIX_TM_HIERARCHY_ENA))\n+\t\treturn 0;\n+\n+\t/* For leaf nodes, SQ CTX needs update */\n+\tif (nix_tm_is_leaf(nix, node->lvl)) {\n+\t\t/* Update SQ quantum data on the fly */\n+\t\trc = nix_tm_sq_sched_conf(nix, node, true);\n+\t\tif (rc)\n+\t\t\treturn NIX_ERR_TM_SQ_UPDATE_FAIL;\n+\t} else {\n+\t\t/* XOFF Parent node */\n+\t\treq = mbox_alloc_msg_nix_txschq_cfg(mbox);\n+\t\treq->lvl = node->parent->hw_lvl;\n+\t\treq->num_regs = nix_tm_sw_xoff_prep(node->parent, true,\n+\t\t\t\t\t\t req->reg, req->regval);\n+\t\trc = mbox_process(mbox);\n+\t\tif (rc)\n+\t\t\treturn rc;\n+\n+\t\t/* XOFF this node and all other siblings */\n+\t\treq = mbox_alloc_msg_nix_txschq_cfg(mbox);\n+\t\treq->lvl = node->hw_lvl;\n+\n+\t\tk = 0;\n+\t\tTAILQ_FOREACH(sibling, list, node) {\n+\t\t\tif (sibling->parent != node->parent)\n+\t\t\t\tcontinue;\n+\t\t\tk += nix_tm_sw_xoff_prep(sibling, true, &req->reg[k],\n+\t\t\t\t\t\t &req->regval[k]);\n+\t\t}\n+\t\treq->num_regs = k;\n+\t\trc = mbox_process(mbox);\n+\t\tif (rc)\n+\t\t\treturn rc;\n+\n+\t\t/* Update new weight for current node */\n+\t\treq = mbox_alloc_msg_nix_txschq_cfg(mbox);\n+\t\treq->lvl = node->hw_lvl;\n+\t\treq->num_regs =\n+\t\t\tnix_tm_sched_reg_prep(nix, node, req->reg, req->regval);\n+\t\trc = mbox_process(mbox);\n+\t\tif (rc)\n+\t\t\treturn rc;\n+\n+\t\t/* XON this node and all other siblings */\n+\t\treq = mbox_alloc_msg_nix_txschq_cfg(mbox);\n+\t\treq->lvl = node->hw_lvl;\n+\n+\t\tk = 0;\n+\t\tTAILQ_FOREACH(sibling, list, node) {\n+\t\t\tif (sibling->parent != node->parent)\n+\t\t\t\tcontinue;\n+\t\t\tk += nix_tm_sw_xoff_prep(sibling, false, &req->reg[k],\n+\t\t\t\t\t\t &req->regval[k]);\n+\t\t}\n+\t\treq->num_regs = k;\n+\t\trc = mbox_process(mbox);\n+\t\tif (rc)\n+\t\t\treturn rc;\n+\n+\t\t/* XON Parent node */\n+\t\treq = mbox_alloc_msg_nix_txschq_cfg(mbox);\n+\t\treq->lvl = node->parent->hw_lvl;\n+\t\treq->num_regs = nix_tm_sw_xoff_prep(node->parent, false,\n+\t\t\t\t\t\t req->reg, req->regval);\n+\t\trc = mbox_process(mbox);\n+\t\tif (rc)\n+\t\t\treturn rc;\n+\t}\n+\treturn 0;\n+}\n+\n+int\n roc_nix_tm_init(struct roc_nix *roc_nix)\n {\n \tstruct nix *nix = roc_nix_to_nix_priv(roc_nix);\ndiff --git a/drivers/common/cnxk/version.map b/drivers/common/cnxk/version.map\nindex 4d8f092..22955fe 100644\n--- a/drivers/common/cnxk/version.map\n+++ b/drivers/common/cnxk/version.map\n@@ -114,7 +114,10 @@ INTERNAL {\n \troc_nix_tm_node_lvl;\n \troc_nix_tm_node_name_get;\n \troc_nix_tm_node_next;\n+\troc_nix_tm_node_parent_update;\n \troc_nix_tm_node_pkt_mode_update;\n+\troc_nix_tm_node_shaper_update;\n+\troc_nix_tm_node_suspend_resume;\n \troc_nix_tm_rlimit_sq;\n \troc_nix_tm_shaper_profile_add;\n \troc_nix_tm_shaper_profile_delete;\n", "prefixes": [ "38/52" ] }{ "id": 88565, "url": "