From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0066.outbound.protection.outlook.com [104.47.42.66]) by dpdk.org (Postfix) with ESMTP id 541D4FA38 for ; Thu, 2 Mar 2017 12:39:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=ouHINJEDwjiIptruhUSRy6bQtCNF2cREfd1hqr7TejY=; b=dW+FuaOzGiTDEMC1pBvPq/OBP/NnHMe3EVeJBIqr/V5icfkZ0WskaKEgzgR/cXCe39jsuRL93CWdg9KvR80a82C8gBMRhh6hVC83Gx8mexurTzXHcP+tvun3kMEmzdan/qMU5a1Rjgj9mSct/PuiXjIZLPf3aW2rwN0PcwdyimY= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=caviumnetworks.com; Received: from lio357.in.caveonetworks.com (14.140.2.178) by CY1PR07MB2277.namprd07.prod.outlook.com (10.164.112.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.947.12; Thu, 2 Mar 2017 11:39:04 +0000 From: Shijith Thotton To: ferruh.yigit@intel.com Cc: dev@dpdk.org, Jerin Jacob , Derek Chickles , Venkat Koppula , Srisivasubramanian S , Mallesham Jatharakonda Date: Thu, 2 Mar 2017 17:02:28 +0530 Message-Id: <1488454371-3342-24-git-send-email-shijith.thotton@caviumnetworks.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1488454371-3342-1-git-send-email-shijith.thotton@caviumnetworks.com> References: <1487669225-30091-1-git-send-email-shijith.thotton@caviumnetworks.com> <1488454371-3342-1-git-send-email-shijith.thotton@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.140.2.178] X-ClientProxiedBy: BM1PR01CA0021.INDPRD01.PROD.OUTLOOK.COM (10.163.198.156) To CY1PR07MB2277.namprd07.prod.outlook.com (10.164.112.155) X-MS-Office365-Filtering-Correlation-Id: 5232f1c5-b64a-4819-2393-08d46160bcc4 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY1PR07MB2277; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2277; 3:cpVMJCeZZIRXOMGh80zffGr2BGXnzSfvtHWTjGp8yFtjvx8ducGola4ANZeDl/uEEupabWabiuqH1aIMDOYlwsG5aF838wcoRe3zRwemSPADCn+9uV7YoTsfU/j5niK3lEZP+FwrQJVQqPpVXmaIPVpCi+Ln8VDP/doyGr6/33uMFFW+1xP0WaunyKd8SqEG7n7CV1yW5cmntuDLViNoUgaWPznlB4Eg4Xc/uUjUMQv4HVOdceBh0irNydKotEx/7RDEM5cze8kkMAjIfByVAA==; 25:PipWG87KWnPCY+e1X4ctGa27AGHFMFMyXURrTRcWqbdqHP8saqsRvb3bFbP224tb7bPXbYTPujDJy4zX4epZYYg/wnczYW1inmmUj5YpiE0hps6kULm8NU9r6hEhE+MS7I4Pvwb59HS46kU6drpkcEYX3FoBa1KqnCbNmReBCFL+3nB9qn6Y1D2dS6e2gafc9+g+Hs0ZgnxPhMccIhm9Wl+qkYFrfhX0q2l0CLB8tL5K1l/tB8RoBaKT5Xu07vW2pqQUp3jdlQVq1WtovFTCRDUIaZSEmX7qzU7mEUvmUiPztuIqSkQnG3o2f5/IvuXBajaZD5dWuQj2AG/eyE0FiPTzS3pjlQX8Cwc7hxT5PUgY+7FZFnlqNr3xwLv4Iw1yZJoLapDl7zYZssKPN+Hdk55UlLV1DmXbGzWRX1nNxhx1zs49dPd/6FVNnku7zP+TynfsTOfH1VjSDXB3fCDPhQ== X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2277; 31:b7OlLfbsywy533BBAXuuOSBALFOGjJoJPi/NxjQX2oXgoIOtA3vlOeTTErYadjdkbBbv0niHQaPlZgnufh0oJAOtJcnSep2a1qN8fqvtqYLIVE5rpImhRMhCQbBNxlTh8C1VfOXp5HKSQLtKcmuvUGdSMm8sN74o0zvzt3dTn3JTEdjqgY3pS5dKU/BYyuNRxnkPMk8v9cqvxoRUxry/Mg+bUgCxAqYKNuIR9eyWaUuObbj6DcWfsgweMnddP3cH; 20:WtpsRbKUU0NxKh3Ox4ny9YyRAWq+vqs+BqSU/g+7V/1VDqWGBU5sj4UraU1vjF53HkoEAiS48xh169XS9ZHUQgi8/Dwl/2N7yzIzPXlSEQ06R1RVVLBGbzwsYqrmf2fT98F80pRVEqh+Fvr4umGZUH7a3xyvdGdJ10Rmj7iSk5D73ZSErjpjkOGGeI5Cta0kmRHwMcYvxjxYaO0VBu8D9pahaZy/yo+7p75JHz9vsukUA4Umip082jjaqnco4rM7oS98p4AHFeDRZSCy9iwgO2kaF9vaT8z6tHPL+WM5UdekqSXxtFigp280X2PLBNpeS0ZvHxnBUFVkldZ9QAeJgpgSaXJoiuS7v2qskyI9db25ZR25ZTBJRvtiKfBYGckm3bmgw/eHypUjKul7CUn9jgjLpWksskz4rY1h4JF1hhWvUvQGZY4d86LpB9nh0dRARuDljoVGs7uoEbcvCCcTZfnnqu0Q5LPbrDubpVHsTHYwAyaYmaQH5b4CM2lM4Jaiveki8bis4KLriSnJ3PJicyIWWIpwXc4iANBF+LpRiHZm0yRC9Xr+s/ystDjH0hW0Y/l9cqoN8rS9fbbOSp7RBMgfmGUJs8z58Cl6b9YX2Sk= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6041248)(20161123558025)(20161123555025)(20161123560025)(20161123564025)(20161123562025)(6072148); SRVR:CY1PR07MB2277; BCL:0; PCL:0; RULEID:; SRVR:CY1PR07MB2277; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2277; 4:QKSJZV2R0zLAPI5bryKhr+m7TXg585JLAYCuKXbSmRR5kA7R3TyE3sr9Jb93+9zOClzEqJ4rluWyT9NwG6ztKI9lPFyWo3LMQPeNrD98Q7QmQaBqJVGhIq8U8amNW2sm5raCZG9rETliedbCrRMuUeyfAD0LVbEOxj0VZLhL9FehSyyt4ms+gVfi+Ke3XDZnXucKAJKAQtEUqkfiJAaRwoSKCYxyRvU2N+pbD/BWJACZxGlw2pPJmW0tSnY7wU8G7oRGxkOHzWxuII3gK5ObQFkZhA2bM6TGEjgOUeO902BWxAtc4YRl6IjYe9NtSdr5H3Pz1KDLrIiUw8/NUvySCkH6SGhaOR+76MN/WbMrIkB/YteK153pU3kZoL/PCk8jf4arrYtsZsejEnU2HcFh9YcdNiyO/t7u0fuCYKj5kqrcdgsWJs2lMR3sH7Mpg5JiGIwxz2+LKg0girIvmUX3IdKHHwTx8/NusjlUCHn/vlgs1sbb5DJ6o/U30tlguxQL33lewalLqxY1NpHZkCt8w9nrYIAdSDNg/Y590NkxdmHIYPtegbrx75kKsEbkJ1frkLnOWGK88syTaBBdyjY0/zVVxBk5Llu+crE+u6QF2AA= X-Forefront-PRVS: 023495660C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(39450400003)(2950100002)(6916009)(42882006)(5660300001)(92566002)(4720700003)(33646002)(48376002)(50226002)(6666003)(2906002)(5003940100001)(36756003)(8676002)(50466002)(81166006)(110136004)(38730400002)(4326008)(305945005)(2361001)(53936002)(2351001)(25786008)(6512007)(189998001)(54906002)(47776003)(6506006)(6486002)(66066001)(6116002)(3846002)(50986999)(76176999)(5009440100003)(42186005)(7736002)(7099028)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR07MB2277; H:lio357.in.caveonetworks.com; FPR:; SPF:None; MLV:nov; PTR:InfoNoRecords; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR07MB2277; 23:GaN9gNfLNEwXOp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ascii?Q?HB2xoxZBKFAotcGCvLkQI6soFjx2LuYVEWj84hwXDf+RqgMdf1VygGrM7SDu?= =?us-ascii?Q?LmEINqDEPtn8J6WIM+qxjEyw+RIX338MA+h5Ynrkx72bvQSrIl5qVhOpr//M?= =?us-ascii?Q?lcrSBaNwR4+IQhltb9c2/EonG5KY9Aa0+qW4ioLM8kbv8EIwsGdHNvbVUm/V?= =?us-ascii?Q?hvxiHh9sCv7fxyGnkTvDAKWAFVxaxMTgd0vDyhB9v34k2/cQw=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2277; 6:yGu1fxNytYBA+hlFBagz51As+sbGGPQWhL+eZr3IgVNGhvKO2nNqcwPqgvpb8gjNR+WNVBbHI+U/A2Rdsteh1mSOXhBfzeyvJOdKNUaEqdu4CkHdFF1pb8hLo76k5agbblO8vX2Q1uv+J+VnllffumgvCBsa4N79/RWWx7j6Qf55eur1ZFgW2gSu07tV7Wz+x0h5Mgv68+cOzluZ81o0VSBd1v1SUwWs8IJ5Ny8C5GRnrnMLdX8WM08/fwkeIacmmN8e/llKm5Xoz30/NBubSeiBwlN4dWYJzAYHJ56PPKGniIj4GnZsKJSVFzuaJd0ESMQWOgwCUiqLQ71PQcQ3khc9JfE8L2d6O5KnByax4XVAMOVrFvCMAfcCkz6g1p8tPLJ6MRXEY/o7kFhwgeWJag==; 5:6ropzKRCepdduunTohkemJH0cJSoWRmS5gQ+T5zgOoKq9Ai7M/ZVpg+M+DG7XzgmJpatImwaZzpm22Y8xk34nEjOQg0FcJy+rXdG4UDR7VF9nY2sxr5m9OzGAkARaAaNW3rXcHQ5MVichzif9c02sw==; 24:/thJqLn0nTV5bmx34rBu+V0lg3Wv0d8oSKQfn6ZTeJ7QFHjVNbOspE8DpRhMvqBktQ1AnsjKKHRnZy2YlQgK2n1xVPq7RyAVNNLLFc4UUZw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2277; 7:maTPVIZo3TqGoPxOzhYq+0VBCWDxaKWDASNX7eUb6HaAy5s2+mMKfmY6/y82WSBJiPP1f/1nGSRnwnewS9XuvYYLBe+6175Tqj2w3qFCZ9JuaN6xKUFZWXho5rpxVtHpTB3SRF9wglb6TbG/R1Ii/txF1MqJKC/MSruCb2ETEg8rbPvYr7wrkZmAQE5y8bYj5xgDkayxKvsnZk4KAUZIhBMa2/OAGuB6iqKu1YjLY1Ay7sGY1o19xHcBwLiYIqjd34rqUAPTfevb/fwjsnwD2Y4SvlMVbUSbts+rwOfeKEDAnn1/7w695DN9Dz7N4C+PwybBki1vWPSDjMD2gT0NFA== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Mar 2017 11:39:04.8744 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2277 Subject: [dpdk-dev] [PATCH v2 23/46] net/liquidio: add API to release Rx queue X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Mar 2017 11:39:10 -0000 Signed-off-by: Shijith Thotton Signed-off-by: Jerin Jacob Signed-off-by: Derek Chickles Signed-off-by: Venkat Koppula Signed-off-by: Srisivasubramanian S Signed-off-by: Mallesham Jatharakonda --- drivers/net/liquidio/lio_ethdev.c | 28 ++++++++++++++++++++++++++++ drivers/net/liquidio/lio_rxtx.c | 10 ++++++++++ drivers/net/liquidio/lio_rxtx.h | 1 + 3 files changed, 39 insertions(+) diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c index ebfdf7a..d5f650e 100644 --- a/drivers/net/liquidio/lio_ethdev.c +++ b/drivers/net/liquidio/lio_ethdev.c @@ -121,6 +121,33 @@ return 0; } +/** + * Release the receive queue/ringbuffer. Called by + * the upper layers. + * + * @param rxq + * Opaque pointer to the receive queue to release + * + * @return + * - nothing + */ +static void +lio_dev_rx_queue_release(void *rxq) +{ + struct lio_droq *droq = rxq; + struct lio_device *lio_dev = droq->lio_dev; + int oq_no; + + /* Run time queue deletion not supported */ + if (lio_dev->port_configured) + return; + + if (droq != NULL) { + oq_no = droq->q_no; + lio_delete_droq_queue(droq->lio_dev, oq_no); + } +} + static int lio_dev_configure(struct rte_eth_dev *eth_dev) { struct lio_device *lio_dev = LIO_DEV(eth_dev); @@ -266,6 +293,7 @@ static int lio_dev_configure(struct rte_eth_dev *eth_dev) static const struct eth_dev_ops liovf_eth_dev_ops = { .dev_configure = lio_dev_configure, .rx_queue_setup = lio_dev_rx_queue_setup, + .rx_queue_release = lio_dev_rx_queue_release, }; static void diff --git a/drivers/net/liquidio/lio_rxtx.c b/drivers/net/liquidio/lio_rxtx.c index 9e4da3a..4e63a50 100644 --- a/drivers/net/liquidio/lio_rxtx.c +++ b/drivers/net/liquidio/lio_rxtx.c @@ -706,6 +706,16 @@ return pkts_processed; } +void +lio_delete_droq_queue(struct lio_device *lio_dev, + int oq_no) +{ + lio_delete_droq(lio_dev, oq_no); + lio_dev->num_oqs--; + rte_free(lio_dev->droq[oq_no]); + lio_dev->droq[oq_no] = NULL; +} + /** * lio_init_instr_queue() * @param lio_dev - pointer to the lio device structure. diff --git a/drivers/net/liquidio/lio_rxtx.h b/drivers/net/liquidio/lio_rxtx.h index 420b893..76d067e 100644 --- a/drivers/net/liquidio/lio_rxtx.h +++ b/drivers/net/liquidio/lio_rxtx.h @@ -546,6 +546,7 @@ int lio_setup_droq(struct lio_device *lio_dev, int q_no, int num_descs, unsigned int socket_id); uint16_t lio_dev_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t budget); +void lio_delete_droq_queue(struct lio_device *lio_dev, int oq_no); /** Setup instruction queue zero for the device * @param lio_dev which lio device to setup -- 1.8.3.1