Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/92209/?format=api
http://patches.dpdk.org/api/patches/92209/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20210426174441.2302-24-pbhagavatula@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": "<20210426174441.2302-24-pbhagavatula@marvell.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20210426174441.2302-24-pbhagavatula@marvell.com", "date": "2021-04-26T17:44:30", "name": "[v2,23/33] event/cnxk: add devargs to disable NPA", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "5f176f9f35a490e5e2f5cb04d321537bbb838f6b", "submitter": { "id": 1183, "url": "http://patches.dpdk.org/api/people/1183/?format=api", "name": "Pavan Nikhilesh Bhagavatula", "email": "pbhagavatula@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/20210426174441.2302-24-pbhagavatula@marvell.com/mbox/", "series": [ { "id": 16682, "url": "http://patches.dpdk.org/api/series/16682/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=16682", "date": "2021-04-26T17:44:07", "name": "Marvell CNXK Event device Driver", "version": 2, "mbox": "http://patches.dpdk.org/series/16682/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/92209/comments/", "check": "warning", "checks": "http://patches.dpdk.org/api/patches/92209/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 90071A0548;\n\tMon, 26 Apr 2021 19:47:54 +0200 (CEST)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 055C341260;\n\tMon, 26 Apr 2021 19:46:18 +0200 (CEST)", "from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com\n [67.231.148.174])\n by mails.dpdk.org (Postfix) with ESMTP id D2CBA4121D\n for <dev@dpdk.org>; Mon, 26 Apr 2021 19:46:16 +0200 (CEST)", "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 13QHjY7s009116 for <dev@dpdk.org>; Mon, 26 Apr 2021 10:46:16 -0700", "from dc5-exch01.marvell.com ([199.233.59.181])\n by mx0a-0016f401.pphosted.com with ESMTP id 385hfr2tpx-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT)\n for <dev@dpdk.org>; Mon, 26 Apr 2021 10:46:16 -0700", "from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2;\n Mon, 26 Apr 2021 10:46:14 -0700", "from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.2 via Frontend\n Transport; Mon, 26 Apr 2021 10:46:14 -0700", "from BG-LT7430.marvell.com (BG-LT7430.marvell.com [10.28.177.176])\n by maili.marvell.com (Postfix) with ESMTP id CAB835B6C96;\n Mon, 26 Apr 2021 10:46:12 -0700 (PDT)" ], "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-transfer-encoding : content-type; s=pfpt0220;\n bh=vsZCRA65w2dBqx9YzkHzhe14uOdNGaQsqvZXeyXCBgE=;\n b=HTW8Xtjv7B6OjYwxmwtWzhPqNLZw5QHBXNf4FFn+lWtd4lazmuhX2lrjBgni9EcHSjuV\n HM+k/OMmEC6Rqj1V8YKd5+pUEVswBU6/oLiA/jEvwXTCWWY5bG2t/CNWOIOaPw6mLhbT\n 7TmJCRIGcGQhOlA3ICeyY/USUR9zhm0vryRBL4Vma6ay0cPK48+hlzZIrOtKvdczXVkV\n 8bhCkdz7/YUz3VbLyZM1JcdrHy63hVdd05/XFbOmvtvNXdUNGv/E1nTQwm6WukjsDE48\n RhOpMOhNU79CYFiKdyZTsNHdJG05lZesnx15bXyHqLQbOoHS4QFQV8WzeOxZsOe5RGxf cw==", "From": "<pbhagavatula@marvell.com>", "To": "<jerinj@marvell.com>, Pavan Nikhilesh <pbhagavatula@marvell.com>, \"Shijith\n Thotton\" <sthotton@marvell.com>", "CC": "<dev@dpdk.org>", "Date": "Mon, 26 Apr 2021 23:14:30 +0530", "Message-ID": "<20210426174441.2302-24-pbhagavatula@marvell.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20210426174441.2302-1-pbhagavatula@marvell.com>", "References": "<20210306162942.6845-1-pbhagavatula@marvell.com>\n <20210426174441.2302-1-pbhagavatula@marvell.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Content-Type": "text/plain", "X-Proofpoint-ORIG-GUID": "hwieIeP3KK_oyPpyKSDR7LzXH30LQ1d0", "X-Proofpoint-GUID": "hwieIeP3KK_oyPpyKSDR7LzXH30LQ1d0", "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10434:6.0.391, 18.0.761\n definitions=2021-04-26_09:2021-04-26,\n 2021-04-26 signatures=0", "Subject": "[dpdk-dev] [PATCH v2 23/33] event/cnxk: add devargs to disable NPA", "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": "From: Pavan Nikhilesh <pbhagavatula@marvell.com>\n\nIf the chunks are allocated from NPA then TIM can automatically free\nthem when traversing the list of chunks.\nAdd devargs to disable NPA and use software mempool to manage chunks.\n\nExample:\n\t--dev \"0002:0e:00.0,tim_disable_npa=1\"\n\nSigned-off-by: Shijith Thotton <sthotton@marvell.com>\nSigned-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>\n---\n doc/guides/eventdevs/cnxk.rst | 10 ++++\n drivers/event/cnxk/cn10k_eventdev.c | 3 +-\n drivers/event/cnxk/cn9k_eventdev.c | 3 +-\n drivers/event/cnxk/cnxk_eventdev.h | 9 +++\n drivers/event/cnxk/cnxk_tim_evdev.c | 86 +++++++++++++++++++++--------\n drivers/event/cnxk/cnxk_tim_evdev.h | 5 ++\n 6 files changed, 92 insertions(+), 24 deletions(-)", "diff": "diff --git a/doc/guides/eventdevs/cnxk.rst b/doc/guides/eventdevs/cnxk.rst\nindex 662df2971..9e14f99f2 100644\n--- a/doc/guides/eventdevs/cnxk.rst\n+++ b/doc/guides/eventdevs/cnxk.rst\n@@ -93,6 +93,16 @@ Runtime Config Options\n \n -a 0002:0e:00.0,qos=[1-50-50-50]\n \n+- ``TIM disable NPA``\n+\n+ By default chunks are allocated from NPA then TIM can automatically free\n+ them when traversing the list of chunks. The ``tim_disable_npa`` devargs\n+ parameter disables NPA and uses software mempool to manage chunks\n+\n+ For example::\n+\n+ -a 0002:0e:00.0,tim_disable_npa=1\n+\n Debugging Options\n -----------------\n \ndiff --git a/drivers/event/cnxk/cn10k_eventdev.c b/drivers/event/cnxk/cn10k_eventdev.c\nindex 30ca0d901..807e666d3 100644\n--- a/drivers/event/cnxk/cn10k_eventdev.c\n+++ b/drivers/event/cnxk/cn10k_eventdev.c\n@@ -502,4 +502,5 @@ RTE_PMD_REGISTER_PCI_TABLE(event_cn10k, cn10k_pci_sso_map);\n RTE_PMD_REGISTER_KMOD_DEP(event_cn10k, \"vfio-pci\");\n RTE_PMD_REGISTER_PARAM_STRING(event_cn10k, CNXK_SSO_XAE_CNT \"=<int>\"\n \t\t\t CNXK_SSO_GGRP_QOS \"=<string>\"\n-\t\t\t CN10K_SSO_GW_MODE \"=<int>\");\n+\t\t\t CN10K_SSO_GW_MODE \"=<int>\"\n+\t\t\t CNXK_TIM_DISABLE_NPA \"=1\");\ndiff --git a/drivers/event/cnxk/cn9k_eventdev.c b/drivers/event/cnxk/cn9k_eventdev.c\nindex 773152e55..3e27fce4a 100644\n--- a/drivers/event/cnxk/cn9k_eventdev.c\n+++ b/drivers/event/cnxk/cn9k_eventdev.c\n@@ -571,4 +571,5 @@ RTE_PMD_REGISTER_PCI_TABLE(event_cn9k, cn9k_pci_sso_map);\n RTE_PMD_REGISTER_KMOD_DEP(event_cn9k, \"vfio-pci\");\n RTE_PMD_REGISTER_PARAM_STRING(event_cn9k, CNXK_SSO_XAE_CNT \"=<int>\"\n \t\t\t CNXK_SSO_GGRP_QOS \"=<string>\"\n-\t\t\t CN9K_SSO_SINGLE_WS \"=1\");\n+\t\t\t CN9K_SSO_SINGLE_WS \"=1\"\n+\t\t\t CNXK_TIM_DISABLE_NPA \"=1\");\ndiff --git a/drivers/event/cnxk/cnxk_eventdev.h b/drivers/event/cnxk/cnxk_eventdev.h\nindex 81bb3488a..257772cb2 100644\n--- a/drivers/event/cnxk/cnxk_eventdev.h\n+++ b/drivers/event/cnxk/cnxk_eventdev.h\n@@ -159,6 +159,15 @@ struct cnxk_sso_hws_cookie {\n \tbool configured;\n } __rte_cache_aligned;\n \n+static inline int\n+parse_kvargs_flag(const char *key, const char *value, void *opaque)\n+{\n+\tRTE_SET_USED(key);\n+\n+\t*(uint8_t *)opaque = !!atoi(value);\n+\treturn 0;\n+}\n+\n static inline int\n parse_kvargs_value(const char *key, const char *value, void *opaque)\n {\ndiff --git a/drivers/event/cnxk/cnxk_tim_evdev.c b/drivers/event/cnxk/cnxk_tim_evdev.c\nindex 986ad8493..44bcad94d 100644\n--- a/drivers/event/cnxk/cnxk_tim_evdev.c\n+++ b/drivers/event/cnxk/cnxk_tim_evdev.c\n@@ -31,30 +31,43 @@ cnxk_tim_chnk_pool_create(struct cnxk_tim_ring *tim_ring,\n \t\tcache_sz = RTE_MEMPOOL_CACHE_MAX_SIZE;\n \tcache_sz = cache_sz != 0 ? cache_sz : 2;\n \ttim_ring->nb_chunks += (cache_sz * rte_lcore_count());\n-\ttim_ring->chunk_pool = rte_mempool_create_empty(\n-\t\tpool_name, tim_ring->nb_chunks, tim_ring->chunk_sz, cache_sz, 0,\n-\t\trte_socket_id(), mp_flags);\n-\n-\tif (tim_ring->chunk_pool == NULL) {\n-\t\tplt_err(\"Unable to create chunkpool.\");\n-\t\treturn -ENOMEM;\n-\t}\n+\tif (!tim_ring->disable_npa) {\n+\t\ttim_ring->chunk_pool = rte_mempool_create_empty(\n+\t\t\tpool_name, tim_ring->nb_chunks, tim_ring->chunk_sz,\n+\t\t\tcache_sz, 0, rte_socket_id(), mp_flags);\n+\n+\t\tif (tim_ring->chunk_pool == NULL) {\n+\t\t\tplt_err(\"Unable to create chunkpool.\");\n+\t\t\treturn -ENOMEM;\n+\t\t}\n \n-\trc = rte_mempool_set_ops_byname(tim_ring->chunk_pool,\n-\t\t\t\t\trte_mbuf_platform_mempool_ops(), NULL);\n-\tif (rc < 0) {\n-\t\tplt_err(\"Unable to set chunkpool ops\");\n-\t\tgoto free;\n-\t}\n+\t\trc = rte_mempool_set_ops_byname(tim_ring->chunk_pool,\n+\t\t\t\t\t\trte_mbuf_platform_mempool_ops(),\n+\t\t\t\t\t\tNULL);\n+\t\tif (rc < 0) {\n+\t\t\tplt_err(\"Unable to set chunkpool ops\");\n+\t\t\tgoto free;\n+\t\t}\n \n-\trc = rte_mempool_populate_default(tim_ring->chunk_pool);\n-\tif (rc < 0) {\n-\t\tplt_err(\"Unable to set populate chunkpool.\");\n-\t\tgoto free;\n+\t\trc = rte_mempool_populate_default(tim_ring->chunk_pool);\n+\t\tif (rc < 0) {\n+\t\t\tplt_err(\"Unable to set populate chunkpool.\");\n+\t\t\tgoto free;\n+\t\t}\n+\t\ttim_ring->aura = roc_npa_aura_handle_to_aura(\n+\t\t\ttim_ring->chunk_pool->pool_id);\n+\t\ttim_ring->ena_dfb = 0;\n+\t} else {\n+\t\ttim_ring->chunk_pool = rte_mempool_create(\n+\t\t\tpool_name, tim_ring->nb_chunks, tim_ring->chunk_sz,\n+\t\t\tcache_sz, 0, NULL, NULL, NULL, NULL, rte_socket_id(),\n+\t\t\tmp_flags);\n+\t\tif (tim_ring->chunk_pool == NULL) {\n+\t\t\tplt_err(\"Unable to create chunkpool.\");\n+\t\t\treturn -ENOMEM;\n+\t\t}\n+\t\ttim_ring->ena_dfb = 1;\n \t}\n-\ttim_ring->aura =\n-\t\troc_npa_aura_handle_to_aura(tim_ring->chunk_pool->pool_id);\n-\ttim_ring->ena_dfb = 0;\n \n \treturn 0;\n \n@@ -110,8 +123,17 @@ cnxk_tim_ring_create(struct rte_event_timer_adapter *adptr)\n \ttim_ring->nb_bkts = (tim_ring->max_tout / tim_ring->tck_nsec);\n \ttim_ring->nb_timers = rcfg->nb_timers;\n \ttim_ring->chunk_sz = dev->chunk_sz;\n+\ttim_ring->disable_npa = dev->disable_npa;\n+\n+\tif (tim_ring->disable_npa) {\n+\t\ttim_ring->nb_chunks =\n+\t\t\ttim_ring->nb_timers /\n+\t\t\tCNXK_TIM_NB_CHUNK_SLOTS(tim_ring->chunk_sz);\n+\t\ttim_ring->nb_chunks = tim_ring->nb_chunks * tim_ring->nb_bkts;\n+\t} else {\n+\t\ttim_ring->nb_chunks = tim_ring->nb_timers;\n+\t}\n \n-\ttim_ring->nb_chunks = tim_ring->nb_timers;\n \ttim_ring->nb_chunk_slots = CNXK_TIM_NB_CHUNK_SLOTS(tim_ring->chunk_sz);\n \t/* Create buckets. */\n \ttim_ring->bkt =\n@@ -199,6 +221,24 @@ cnxk_tim_caps_get(const struct rte_eventdev *evdev, uint64_t flags,\n \treturn 0;\n }\n \n+static void\n+cnxk_tim_parse_devargs(struct rte_devargs *devargs, struct cnxk_tim_evdev *dev)\n+{\n+\tstruct rte_kvargs *kvlist;\n+\n+\tif (devargs == NULL)\n+\t\treturn;\n+\n+\tkvlist = rte_kvargs_parse(devargs->args, NULL);\n+\tif (kvlist == NULL)\n+\t\treturn;\n+\n+\trte_kvargs_process(kvlist, CNXK_TIM_DISABLE_NPA, &parse_kvargs_flag,\n+\t\t\t &dev->disable_npa);\n+\n+\trte_kvargs_free(kvlist);\n+}\n+\n void\n cnxk_tim_init(struct roc_sso *sso)\n {\n@@ -217,6 +257,8 @@ cnxk_tim_init(struct roc_sso *sso)\n \t}\n \tdev = mz->addr;\n \n+\tcnxk_tim_parse_devargs(sso->pci_dev->device.devargs, dev);\n+\n \tdev->tim.roc_sso = sso;\n \trc = roc_tim_init(&dev->tim);\n \tif (rc < 0) {\ndiff --git a/drivers/event/cnxk/cnxk_tim_evdev.h b/drivers/event/cnxk/cnxk_tim_evdev.h\nindex 62bb2f1eb..8c21ab1fe 100644\n--- a/drivers/event/cnxk/cnxk_tim_evdev.h\n+++ b/drivers/event/cnxk/cnxk_tim_evdev.h\n@@ -33,11 +33,15 @@\n \n #define CN9K_TIM_MIN_TMO_TKS (256)\n \n+#define CNXK_TIM_DISABLE_NPA \"tim_disable_npa\"\n+\n struct cnxk_tim_evdev {\n \tstruct roc_tim tim;\n \tstruct rte_eventdev *event_dev;\n \tuint16_t nb_rings;\n \tuint32_t chunk_sz;\n+\t/* Dev args */\n+\tuint8_t disable_npa;\n };\n \n enum cnxk_tim_clk_src {\n@@ -75,6 +79,7 @@ struct cnxk_tim_ring {\n \tstruct rte_mempool *chunk_pool;\n \tuint64_t arm_cnt;\n \tuint8_t prod_type_sp;\n+\tuint8_t disable_npa;\n \tuint8_t ena_dfb;\n \tuint16_t ring_id;\n \tuint32_t aura;\n", "prefixes": [ "v2", "23/33" ] }{ "id": 92209, "url": "