Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/53993/?format=api
https://patches.dpdk.org/api/patches/53993/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20190601014905.45531-23-jerinj@marvell.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": "<20190601014905.45531-23-jerinj@marvell.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20190601014905.45531-23-jerinj@marvell.com", "date": "2019-06-01T01:49:00", "name": "[v2,22/27] mempool/octeontx2: add mempool free op", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "2453a3f9b4501e57c422c432cb95e9f6f1c62fa9", "submitter": { "id": 1188, "url": "https://patches.dpdk.org/api/people/1188/?format=api", "name": "Jerin Jacob Kollanukkaran", "email": "jerinj@marvell.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/20190601014905.45531-23-jerinj@marvell.com/mbox/", "series": [ { "id": 4844, "url": "https://patches.dpdk.org/api/series/4844/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=4844", "date": "2019-06-01T01:48:38", "name": "OCTEON TX2 common and mempool driver", "version": 2, "mbox": "https://patches.dpdk.org/series/4844/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/53993/comments/", "check": "fail", "checks": "https://patches.dpdk.org/api/patches/53993/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 C4BA11B9CC;\n\tSat, 1 Jun 2019 03:50:23 +0200 (CEST)", "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n\t[67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 51A561B9F7\n\tfor <dev@dpdk.org>; Sat, 1 Jun 2019 03:50:22 +0200 (CEST)", "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n\tby mx0b-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id\n\tx511lgs0003158; Fri, 31 May 2019 18:50:21 -0700", "from sc-exch02.marvell.com ([199.233.58.182])\n\tby mx0b-0016f401.pphosted.com with ESMTP id 2su5xh2bw6-1\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); \n\tFri, 31 May 2019 18:50:21 -0700", "from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH02.marvell.com\n\t(10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3;\n\tFri, 31 May 2019 18:50:19 -0700", "from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com\n\t(10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend\n\tTransport; Fri, 31 May 2019 18:50:19 -0700", "from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14])\n\tby maili.marvell.com (Postfix) with ESMTP id 5C48C3F703F;\n\tFri, 31 May 2019 18:50:18 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n\th=from : to : cc :\n\tsubject : date : message-id : in-reply-to : references : mime-version\n\t: content-transfer-encoding : content-type; s=pfpt0818;\n\tbh=F1fHqOAgJrFtFLqnxmni9YArWHbWN6yxNAC3IcV2uj4=;\n\tb=h4fCh3aETEML1fq75F+HKqx3+AADrKhQLMLiDU4Vc/cy5r+kSkQjkQ7DYyiMgbvmnqjQ\n\tFoWIPMv71koqWA4QNOSqEgzPQKGvg8GvfOh40sO8eXybsbV14bIV+u1X73fwZGArbwq+\n\telHugn+s5P7nvv/XHF+yTIBN7RH3SHeyUO93tu+RGUPfY5flJ+SsS3SzBJVCooRZKxSX\n\tj14Zsn942xFrLrD4eP2W7sNNHkpaE1hexeu3L0S1reFMJEIQiNZdCmWzJPOyJiuHAdGl\n\tnlzhLKGkcfrQ2BWeaQ92ywBakP+3A1FRzhQRHHev0l8SxiDFlTom0+ZqpH0BHNbzU62s\n\tnw== ", "From": "<jerinj@marvell.com>", "To": "<dev@dpdk.org>, Jerin Jacob <jerinj@marvell.com>, Nithin Dabilpuram\n\t<ndabilpuram@marvell.com>, Vamsi Attunuru <vattunuru@marvell.com>", "CC": "Olivier Matz <olivier.matz@6wind.com>", "Date": "Sat, 1 Jun 2019 07:19:00 +0530", "Message-ID": "<20190601014905.45531-23-jerinj@marvell.com>", "X-Mailer": "git-send-email 2.21.0", "In-Reply-To": "<20190601014905.45531-1-jerinj@marvell.com>", "References": "<20190523081339.56348-1-jerinj@marvell.com>\n\t<20190601014905.45531-1-jerinj@marvell.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Content-Type": "text/plain", "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10434:, ,\n\tdefinitions=2019-06-01_02:, , signatures=0", "Subject": "[dpdk-dev] [PATCH v2 22/27] mempool/octeontx2: add mempool free op", "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: Jerin Jacob <jerinj@marvell.com>\n\nThe DPDK mempool free operation frees HW AURA\nand POOL reserved in alloc operation. In addition to that it free all\nthe memory resources allocated in mempool alloc operations.\n\nCc: Olivier Matz <olivier.matz@6wind.com>\n\nSigned-off-by: Jerin Jacob <jerinj@marvell.com>\n---\n drivers/mempool/octeontx2/otx2_mempool_ops.c | 104 +++++++++++++++++++\n 1 file changed, 104 insertions(+)", "diff": "diff --git a/drivers/mempool/octeontx2/otx2_mempool_ops.c b/drivers/mempool/octeontx2/otx2_mempool_ops.c\nindex 0e7b7a77c..94570319a 100644\n--- a/drivers/mempool/octeontx2/otx2_mempool_ops.c\n+++ b/drivers/mempool/octeontx2/otx2_mempool_ops.c\n@@ -47,6 +47,62 @@ npa_lf_aura_pool_init(struct otx2_mbox *mbox, uint32_t aura_id,\n \t\treturn NPA_LF_ERR_AURA_POOL_INIT;\n }\n \n+static int\n+npa_lf_aura_pool_fini(struct otx2_mbox *mbox,\n+\t\t uint32_t aura_id,\n+\t\t uint64_t aura_handle)\n+{\n+\tstruct npa_aq_enq_req *aura_req, *pool_req;\n+\tstruct npa_aq_enq_rsp *aura_rsp, *pool_rsp;\n+\tstruct otx2_mbox_dev *mdev = &mbox->dev[0];\n+\tstruct ndc_sync_op *ndc_req;\n+\tint rc, off;\n+\n+\t/* Procedure for disabling an aura/pool */\n+\trte_delay_us(10);\n+\tnpa_lf_aura_op_alloc(aura_handle, 0);\n+\n+\tpool_req = otx2_mbox_alloc_msg_npa_aq_enq(mbox);\n+\tpool_req->aura_id = aura_id;\n+\tpool_req->ctype = NPA_AQ_CTYPE_POOL;\n+\tpool_req->op = NPA_AQ_INSTOP_WRITE;\n+\tpool_req->pool.ena = 0;\n+\tpool_req->pool_mask.ena = ~pool_req->pool_mask.ena;\n+\n+\taura_req = otx2_mbox_alloc_msg_npa_aq_enq(mbox);\n+\taura_req->aura_id = aura_id;\n+\taura_req->ctype = NPA_AQ_CTYPE_AURA;\n+\taura_req->op = NPA_AQ_INSTOP_WRITE;\n+\taura_req->aura.ena = 0;\n+\taura_req->aura_mask.ena = ~aura_req->aura_mask.ena;\n+\n+\totx2_mbox_msg_send(mbox, 0);\n+\trc = otx2_mbox_wait_for_rsp(mbox, 0);\n+\tif (rc < 0)\n+\t\treturn rc;\n+\n+\toff = mbox->rx_start +\n+\t\t\tRTE_ALIGN(sizeof(struct mbox_hdr), MBOX_MSG_ALIGN);\n+\tpool_rsp = (struct npa_aq_enq_rsp *)((uintptr_t)mdev->mbase + off);\n+\n+\toff = mbox->rx_start + pool_rsp->hdr.next_msgoff;\n+\taura_rsp = (struct npa_aq_enq_rsp *)((uintptr_t)mdev->mbase + off);\n+\n+\tif (rc != 2 || aura_rsp->hdr.rc != 0 || pool_rsp->hdr.rc != 0)\n+\t\treturn NPA_LF_ERR_AURA_POOL_FINI;\n+\n+\t/* Sync NDC-NPA for LF */\n+\tndc_req = otx2_mbox_alloc_msg_ndc_sync_op(mbox);\n+\tndc_req->npa_lf_sync = 1;\n+\n+\trc = otx2_mbox_process(mbox);\n+\tif (rc) {\n+\t\totx2_err(\"Error on NDC-NPA LF sync, rc %d\", rc);\n+\t\treturn NPA_LF_ERR_AURA_POOL_FINI;\n+\t}\n+\treturn 0;\n+}\n+\n static inline char*\n npa_lf_stack_memzone_name(struct otx2_npa_lf *lf, int pool_id, char *name)\n {\n@@ -65,6 +121,18 @@ npa_lf_stack_dma_alloc(struct otx2_npa_lf *lf, char *name,\n \t\t\tRTE_MEMZONE_IOVA_CONTIG, OTX2_ALIGN);\n }\n \n+static inline int\n+npa_lf_stack_dma_free(struct otx2_npa_lf *lf, char *name, int pool_id)\n+{\n+\tconst struct rte_memzone *mz;\n+\n+\tmz = rte_memzone_lookup(npa_lf_stack_memzone_name(lf, pool_id, name));\n+\tif (mz == NULL)\n+\t\treturn -EINVAL;\n+\n+\treturn rte_memzone_free(mz);\n+}\n+\n static inline int\n bitmap_ctzll(uint64_t slab)\n {\n@@ -179,6 +247,24 @@ npa_lf_aura_pool_pair_alloc(struct otx2_npa_lf *lf, const uint32_t block_size,\n \treturn rc;\n }\n \n+static int\n+npa_lf_aura_pool_pair_free(struct otx2_npa_lf *lf, uint64_t aura_handle)\n+{\n+\tchar name[RTE_MEMZONE_NAMESIZE];\n+\tint aura_id, pool_id, rc;\n+\n+\tif (!lf || !aura_handle)\n+\t\treturn NPA_LF_ERR_PARAM;\n+\n+\taura_id = pool_id = npa_lf_aura_handle_to_aura(aura_handle);\n+\trc = npa_lf_aura_pool_fini(lf->mbox, aura_id, aura_handle);\n+\trc |= npa_lf_stack_dma_free(lf, name, pool_id);\n+\n+\trte_bitmap_set(lf->npa_bmp, aura_id);\n+\n+\treturn rc;\n+}\n+\n static int\n otx2_npa_alloc(struct rte_mempool *mp)\n {\n@@ -238,9 +324,27 @@ otx2_npa_alloc(struct rte_mempool *mp)\n \treturn rc;\n }\n \n+static void\n+otx2_npa_free(struct rte_mempool *mp)\n+{\n+\tstruct otx2_npa_lf *lf = otx2_npa_lf_obj_get();\n+\tint rc = 0;\n+\n+\totx2_npa_dbg(\"lf=%p aura_handle=0x%\"PRIx64, lf, mp->pool_id);\n+\tif (lf != NULL)\n+\t\trc = npa_lf_aura_pool_pair_free(lf, mp->pool_id);\n+\n+\tif (rc)\n+\t\totx2_err(\"Failed to free pool or aura rc=%d\", rc);\n+\n+\t/* Release the reference of npalf */\n+\totx2_npa_lf_fini();\n+}\n+\n static struct rte_mempool_ops otx2_npa_ops = {\n \t.name = \"octeontx2_npa\",\n \t.alloc = otx2_npa_alloc,\n+\t.free = otx2_npa_free,\n };\n \n MEMPOOL_REGISTER_OPS(otx2_npa_ops);\n", "prefixes": [ "v2", "22/27" ] }{ "id": 53993, "url": "