From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0075.outbound.protection.outlook.com [104.47.33.75]) by dpdk.org (Postfix) with ESMTP id 57559F928 for ; Sat, 25 Mar 2017 07:28:06 +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=GEGog7rfw8sLw8Y5floQ9h/PiHe9emgD1XbkjZHHUKX9bviToj6QeL9QdV1jhFOEEKip8V/MdNNOWVQ1/YVtEz73x5+sStmXZiOLP/JTMwOXlPdFOJhLPTVtV5mzav3ei41psjogzsxmN5QN/Jaw1vwtIjkEITk+9HrSdS4Xq4c= 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 CY1PR07MB2280.namprd07.prod.outlook.com (10.164.112.158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.977.11; Sat, 25 Mar 2017 06:28:02 +0000 From: Shijith Thotton To: Ferruh Yigit Cc: dev@dpdk.org, Jerin Jacob , Derek Chickles , Venkat Koppula , Srisivasubramanian S , Mallesham Jatharakonda Date: Sat, 25 Mar 2017 11:54:34 +0530 Message-Id: <1490423097-6797-24-git-send-email-shijith.thotton@caviumnetworks.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1490423097-6797-1-git-send-email-shijith.thotton@caviumnetworks.com> References: <1488454371-3342-1-git-send-email-shijith.thotton@caviumnetworks.com> <1490423097-6797-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: BM1PR01CA0117.INDPRD01.PROD.OUTLOOK.COM (10.174.208.33) To CY1PR07MB2280.namprd07.prod.outlook.com (10.164.112.158) X-MS-Office365-Filtering-Correlation-Id: 0cebb62a-c0c4-4916-867d-08d473481864 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY1PR07MB2280; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 3:ibJb5jUZuO6wAiZFlXrBpTYXnYlExjAdCr2JEtcuLeu8kKCT1Ikz2OGKd1MDJtyCvsriK3LLhPcrqm2M9yFU/OOnVwUkOlidT0gDieBKfKSd/8pIttLozMxkZHRIRqyxT+/pr+JKQTM+rIogtqauZ6utnLyaVnbZdalVYWKT5i+KNLyK+gxS5iwC0iz/u4LAJ6MHaMAgkxgXKDlmQzirtJ9LUCXDw52JNFDZHK8u65sG/vyYMwYc6CfF1qYXoOjU7/1w7fGKu0Fu85ZFxFdV2Q==; 25:5s3X/OqoVFpGuYVGnMQOHc35VIDpP0Uya4V5Eh535C/yTiUk10fbXcPTwLMZdFIwTndgt7Amr6ZGFxuelqSeCuppFYrFdO1T8TERmswhpw/OPrKicp5LrVbxOCccWtS5cXRSMa+Pz/mio8ZCZngN8q68tAi9zQ1v/Pw+eYMTaV/bC06xH9QkAtesW46GcwiK4AOHTbK7Pu4n03CgVbLyoNEaHBHYFLQKMKg0cFHNZPazd9p/r1PLJilEH3rORKZ3HyZHv4W9VJHz5Bfy7Q/o8qdv6839z6iopYV4XTj15qks2IbFbFwI+2tXw+JOv75Zl+H1Rq7fshaVtTI9smHTPNjKCv6NBXvllbfCVdZJfLTiAmlVnQFYRfJCd8mtFnBzbgKJJvYc54jmPKj1MBk4ngGFWruBRv4ALC7DVHa90gewT317qk7Ywt3b+EpjXCfT+BqUj8rfw2nUaFd5rpMDPQ== X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 31:YfxIOd7voFn1hu8WRWSRqfysoRwz9fv9WY9PvMiyY3KOI82LSERh0DJDonYePsbQZW/5N8dpy/yLaMHkPH5b+9HmRPGnzpG5RF4QzCiiGdIgk4OvS8silOqrG3TWrfvbDbgoDA7tSdTnobO7PB+6wu870UMeMfC2TjRfwk2YOrPnTEx/p7ce4LmzudkWj9tI3pb30C07B95UGq33OEX/fPwntbnQLq6rAtQbo1X6CifiJxfZV3vk8cd50M2iafdP; 20:3z7pBp6vawM434klHEHIFyR9U/PgmbBAD6ssMi9lJoWqmV1YbPJRdMUGrbptBLLTp1Mr+pv50V+C7SLZ4jpXQj71+/0CCbKSq8WnjbAXyuugaAtZAYbX8VLdBVCii47bs+t9DTVciYLdfutijXZFj8SHKbHdhTU+F+TmH5paf2BlA06B0TQ8rmjcTul72dfY/yw7pZcKlzkxlGKYBcAWVJTIioiWErsFFD5xiaQSV8inR5P2J1q0OcLxTMxnbBjYVBYro0rFngcikkZMwmUSCFM+Y+OpKoDln0NEUNRazO1JNtHaRJd8jxqWoXdwowE73Xvw4ZLMUvqAl9z7/lZYO3HgAVGxyr/9DhFsU6+MfR0DIXRfjI4ylv3NjDvonqJzjnloLklPn2EcS56V1qy6KVta+vbrR3f4fU64s0HWq36JnIfCUfJK5GDGocmLOBGJO+CD7B9WUFmAPdNH0WsStYRi0vL5JYEOMBBbbySrC5lDwAcGNsjjPSe8QFcleudT7rCANQw1uJietoZZPBRGefO/tGsklXcJqwPlkjz8o1e3iTtxcB9Ggvs5Q34m/XJ3ryJnLwcAg8C5Linhdlbbl8A6mFWPlkJJX7IrcAXPleo= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6041248)(20161123564025)(20161123560025)(20161123562025)(20161123558025)(20161123555025)(6072148); SRVR:CY1PR07MB2280; BCL:0; PCL:0; RULEID:; SRVR:CY1PR07MB2280; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 4:GOdVtQpNEWwHDlKhU/qrkJp6D9dx0D6vCpKRYIMmrmm0TkUKiKz7K0oGAQy+yNkpsOK17VpXDUS+SFxtu272CbZsWR+S+Nfsw57HYaFeIe5b11shzseZpd5f1kxQdJSE5VstIO78u50MV4u8Qbjhq0ESHkyCVXm8nr6CmOI0yg3Kh2Sn+dSPVOQUdP5ZC6Q71cwD0lKpHKD/2cs51P1WvRUYx/xzrO6+HBRQ6G7vuBnXlHGaAIOmMYm3nDYJLl6zU+Ky7VayQjuCTR81paHP6pVJhE67ja9nd68f4+0TTffpL2FNbNdEmEJaPFHjpyB7stOlKcN+8jGvEmkySbmJ6SSv6ldaBRB07LPpp6yoB78oT1laEIfnxNPmZXbcGr4dJNWHlk4SvM2IzrZ3CqYEb5g+D/u3E/exM4RELOFVPdJ4oINm8TGOJHdIDp8/k84PhcnoYmm4oD+VJ8Y+0BIROIOtKD22SXANIl/PwavV6YsWK+hVnnCQteSgbqw9PMP/Y7ev3KxhIRpBjw/2xMrxu5MOOKYPqdhktVoUkVQjU190lnli5k89MveJO0IIIJAOrT+xic7UY8YXUGBABwJeR3/of7oUa5SStekNUdG3C4c= X-Forefront-PRVS: 025796F161 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39450400003)(39410400002)(39830400002)(2906002)(2950100002)(5003940100001)(66066001)(42882006)(6916009)(50466002)(48376002)(47776003)(42186005)(53936002)(6512007)(68736007)(5009440100003)(54906002)(50226002)(38730400002)(6486002)(6666003)(25786009)(305945005)(81166006)(7736002)(6116002)(3846002)(4326008)(8676002)(6506006)(189998001)(36756003)(50986999)(76176999)(33646002)(4720700003)(5660300001)(110136004)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR07MB2280; H:lio357.in.caveonetworks.com; FPR:; SPF:None; MLV:nov; PTR:InfoNoRecords; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR07MB2280; 23:gVb7OgHaWdSuiMdZGkygMercGkn/jIdl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ynQR2urpiwB4YQwlK8gZ9j4lEeMSYt4yInUn7hpyuPZUN?= =?us-ascii?Q?SJEQkEj4Iz2zWXLVFsmT9UCB9B5jetl+bmo1HuyfUW3YU7V3+lJcO1kViRzj?= =?us-ascii?Q?nIF97rCbVFCtWEiihaW5u/dUSb5ph40teaybiQWc9H1UAbAV+WmQMlKfv25d?= =?us-ascii?Q?QcpLNM0Nu2ziAzKnwcqeHbpJqOD?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 6:UCQUXCoaFifBxN6gnQJm73k8j6BcwdH5fSOHIJvb0GvSgpvu7UvAje5OiPbQnyTEZl8ihKnABQuHUM0VwYS0Qgg5gEN53DVO3bUL2B85WjG4hTI6Ff4yeLMEO+ixtvn9hUtFsVDbibXnyBqAdtWYwd2E9oMnAKkJCKdlrRyfXkx+6umx+IY69racj+xNzdtHSRaeCk99xzeS+D9PjC0/mOqLJ8cSRaJYjp5b0SOuVwNZZCtR1FBlt1ue/A1G27qolp67B4Bqi8HOhau/zKKAx94aLRt5IGJt8Lgssf55xRFd/WnqEKNAQWtgegyeoMS5LUQy3n6j+IEufAl/2+9KPOg+nGeomxbl5951QipXYCX7X3BKnwux8lGYTO9Q2YVqp1NA0GVW1LQYYqyZXtKg0g==; 5:ucP7kNy8B8dcVi0aQIK6UAeAdBzIHRAhUxFAi3whk/Su5YOEGcOXK8yQqJ2jzpeI6u2CYnKuuY0V5NsHhIzu2Yk/o4BTDPP/XoqPmTO+BJI+GksDzPMBeMtcrNEM9nE2axXP8C+ruD1OrEmtI+RFdw==; 24:Q2qNmNk6UfJs1phKdYq1YHGya5OCoy6Yrw+Td53bfTDYHnL8dbuE3hXQuUcm10gjVlDk5tCPpRsUf1Gln2oS7niLk8TxArADJC5L4elhQCI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2280; 7:CS8w/WwCJQiXJkkc8KS9eM/wOSut6yULKtUul8VlWoyL0lma5NDxSg4WZO7EzdAWAUcYgl+UxrOtT3Na1VmYB1lh4p4g2g6iS5DA5aYCTUzHQ2xTd0Utz5dj+eqpikrMJUpBfKVile8np+V9MEsd+DnbWuSD5oFZM1FRoUgNGaeLx8dzJALnrwSTSoLCssTaUV2vHkTS0nc4219z+g385khwOXng6B3tXFUhkvoHRR8COz/FT+hZhYRPvaBtZONih6d4/RSmSwk29qmgENv58wcFSvM+yS3v449UZDshDqbHU+QEIxLSANWW/t/KzI4LMC4a94+HnOI/JkNEeme94A== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Mar 2017 06:28:02.6374 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2280 Subject: [dpdk-dev] [PATCH v3 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: Sat, 25 Mar 2017 06:28:06 -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