From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0060.outbound.protection.outlook.com [104.47.32.60]) by dpdk.org (Postfix) with ESMTP id 01DE7FA48 for ; Tue, 21 Feb 2017 10:29:31 +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=zgCNUyVRem+tBq6GqM8MdEqKMZxIemz1VAjfQgiotJ8=; b=KR6RpcfXfsYUKq+uF3q7ICls1ovELXCZqHiV6pNJrkgbrKagzyYEnINvgf0i8Ndg5okzFt2vTqAr2tEw7VVMeN9ad6Av7ky8FmT01W6XF8UntZ2bgSsmErmVmEkjeYmnl2N4s6lhxqg4fqqrRnFbhpH31hDRRyuS7UgHNyRSpMg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Shijith.Thotton@cavium.com; Received: from lio357.in.caveonetworks.com (14.140.2.178) by SN1PR07MB2285.namprd07.prod.outlook.com (10.164.47.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.919.13; Tue, 21 Feb 2017 09:29:27 +0000 From: Shijith Thotton To: dev@dpdk.org Cc: Jerin Jacob , Derek Chickles , Venkat Koppula , Mallesham Jatharakonda Date: Tue, 21 Feb 2017 14:56:41 +0530 Message-Id: <1487669225-30091-27-git-send-email-shijith.thotton@caviumnetworks.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1487669225-30091-1-git-send-email-shijith.thotton@caviumnetworks.com> References: <1487669225-30091-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: MA1PR01CA0089.INDPRD01.PROD.OUTLOOK.COM (10.174.56.29) To SN1PR07MB2285.namprd07.prod.outlook.com (10.164.47.155) X-MS-Office365-Filtering-Correlation-Id: 75850a8e-2fb4-4e55-4a7e-08d45a3c22a9 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:SN1PR07MB2285; X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2285; 3:nEJauyezecwkPetL8KJTN2NkgR4CaRarnD71eHTLbGXSWz5zGKsjvpLa+sqOS3UJZhFmTzVaEMMp1F0KO4r2cvlJt/xHiSue8qP2IlWNB/yQ629OTYbLGtOkb5dGgZYrT9d0UJCjEfgrbzsLO0aHst3yD9ch3vvqJN0siDIcCI84g1LthHG7hMIhDbKMkMAwdCgtDP5RvSacYwrLlt6pEUP8AI5Zbwhritn9V6bfn5VDCDs8msFCMWu8vn8qbLpmQygCypOIM7WphqD0mObfWA==; 25:Sh+mPLgS2tzV7EfbIuvg+52045YLV+KCRnq8KthIqHVBTRcfQDu8wB2AdpGc4WRkBDW4MzcnztGCfmKexoUQ0piqO58i/Yhcj6TmSgw3hwNYWG4BxNwqhwWhOzJ3ZMen4fTparFoXrxMgMR+WAcZ5P+Q1DIR5iiwYXIAXRyONnc2ZQ0XhLb4GFFa1JiRKw3zG7HeAQoPlw4oCphfiqTsZTtD11jU0U7jPHy6XhLr0fZJG5B83RBbUXihMZTC+ohE3T8eUhQs8qSoJSI/gPSg2IwAbrsByIts/tr5zv3+DQ+5RQ7jKZwSk/dP+ew4V7VLHWqSpPdNXZCDO43Po9a+0mCktEkdfTdgvEJByo2I1gd1R46A/t76OWCc6brzosSlBx+L/sPaWPTkPZNYpVxGO5etKo4aZD3eoXv1z0niWibq3uNyMkp3eDagAJMXmek8RBStWs3/2TEm/Nk/tm2zoA== X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2285; 31:/cE2tLv5z97WaKyIgZ+FYAvSpDMM0snvneAxJfr00KRVk45WVvnhbxj6gDjrrnRD68KBhOYI93kvRNwztk5pEMGSIYu14kjI9S1enpa3dy83jOh10Y2NX/9y4M5S9u/ec6B2STRxRwfomwyKIdt19yWvIhqiTWZ7TJLa7Pq2HgZxsx7xP8X5YRBZs46qYozHoiNTC+oCWKAcRzwWdwjNyQdzJ1pWBz9MLLPo2LX6oW8=; 20:MKMXaJW5V2K++M6+uSWDt4bQOl36saLZkDmX/4UhsxUitaPMcvYl6NSw76BfDvrrEo7kYSdKKm8jrEGnfOVxKiK0ud+63YJmEcc9xMCKqvlogT7N5h5tb7wbj4DUBSE5+e2Xn+4XtnniZUjJbAKkkufGcww1ce4dnUTF6tJVdWAXsSmAsPr80R2oZyORBIewpIbpTeLAVj3fhoqcBqaJh+10mZXuiqzBneZqavRHyNa9cs/NNYrL8hvNl3LPaIOgwGgJFCoYHh0/PqylrQRfhh/Mgml+pBysz331rkjpgC+UGzTcxDjYyRBuPs+qEmXujmy5KG40iQ2TxWZsSW3Fu1AAPzbIZIrBqzfIRXOtBE7uFmqjm7thEn+2201QmcxWwgL4iFQEk32E2e30lwWb0F3onRyMjnbXnPo7oHKoNnj8NToBEf7e23w9JW0Z0fcz/aMdZXSu3xi6BglfGbuYMkHiQi1m0YTC9QR2tx36haZgjgB5erHumADw4THRnHd3MHhjwLqXq1B9X2s5GW8oSsJiMLJBVs9Das24IxVKjz/J2ZTM4qjNet5n9B9GJHcWudZSHdY2qnBRUEphMwH26gKR3+DTVMDJZfdgJfDfk8E= 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)(3002001)(10201501046)(6041248)(20161123555025)(20161123564025)(20161123562025)(20161123560025)(20161123558025)(6072148); SRVR:SN1PR07MB2285; BCL:0; PCL:0; RULEID:; SRVR:SN1PR07MB2285; X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2285; 4:L2SJ+wI/ikP+rB+CNirB0O0o0igjfd4XT5owTA0e5O6p1iKPqMp+pYYoBe8b1uU9jHJ0XCnDME7P76v9L8CPRtsT3LmI+c7bKWO23m+BrX2R9IW+gXtWQqc7EAqX+rrJf/JzJbuTXMHglvcVKFlpIGwiBOtUPd/JHwZKpcj7kLlButvGLo1NKjlAtI+CcYvpopF53gYLkFGSDXfdSJzE1IAAXASs5O8wxmg2xdAU4Ygu6F60uP2SFA5lDLHQLpNHpYA4yOhnBeLjmfVQOd0doNFqonCWTsdIuaTfqkEGYWlSA2Pq2dpw0sYEEhfO7j4q3KcPhLOG6vouhjTSN1NV588GmMO/eFbMWd+CPNzadCaXxSivOJw/uOC1OL+ScEcVnI2FiHtaHN5phwklTxCOzwlx9wW3SxCUYD6n0HRsLNu1gTbn86xooIufAqai4353Qy6vDC47w63rGFsLujpwR2kQd69h6tve5ri0CnMSInG3bnlAFLgekP5SEMLrNTMOzWIoesU72QrQtp/LkrYSV14BrFwmi0WdeVVP1uy9JacCDepoD/SIhlzexbX+wwBQvq9Kt/v7hicKrNULnn4XI1iSJml4ozOAkM1xFqFP+H4= X-Forefront-PRVS: 0225B0D5BC X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(39450400003)(39410400002)(39830400002)(189002)(199003)(50226002)(81166006)(42186005)(2361001)(101416001)(81156014)(305945005)(3846002)(6116002)(5009440100003)(8676002)(105586002)(7736002)(53936002)(36756003)(110136004)(106356001)(6506006)(25786008)(38730400002)(2351001)(92566002)(48376002)(6486002)(97736004)(50466002)(5003940100001)(189998001)(68736007)(2906002)(4326007)(33646002)(76176999)(54906002)(5660300001)(6666003)(6916009)(50986999)(2950100002)(6512007)(4720700003)(42882006)(66066001)(47776003)(7099028)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR07MB2285; H:lio357.in.caveonetworks.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR07MB2285; 23:tN0RJgHIa6FVZm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xr4pwoccUxPtQD0wIyWuXhPSPY8jN1kdqW+tveHSQwFWHbhzaCVQQ==; 24:swToySNE4q1m0ipZPpgSIpOfNCigt0WNDw/613ni3o56y7YqwYhE/6PLppiRKfIbDJIbFsh0oytKtcX0cHa9cxxOVfjrt3AaD8k7UdxsXEM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR07MB2285; 7:28KUtguCM6p2Ir1QqWQM9GSEhprDdJF1FZkQqYKDazkuNOSTWQ4yHLZHp29W+WB8ruW4G/0S1sNc/JmHhRggxs9J+FBx2SuEDoGhTthydVo4umdjXvhRl6mnFJ2vUEaplzZHSqhPy3yigf3JDgwXsC/piL824/7UsB8nqL5Lpb8+HUzWyTGkAeLh2BDfcVm+0k/DdLyXY7enmKnQAz81199FAPxopP6ezx1bKjmZCibggPGdL9bj4d/DVphrgpoAq4Txg0Vyh3hbl4aOMzZCFgKLm1B8YltdgtYV3hGCCX8R8bQW+RYyT3Po2inV+P9FFeEq4U8ipHJecwIaknCtyA== X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Feb 2017 09:29:27.2764 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR07MB2285 Subject: [dpdk-dev] [PATCH 26/50] 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: Tue, 21 Feb 2017 09:29:31 -0000 Signed-off-by: Shijith Thotton Signed-off-by: Jerin Jacob Signed-off-by: Derek Chickles Signed-off-by: Venkat Koppula 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 300baee..9778b3a 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 7c6b446..b7687a1 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 ccf9ca3..41c351a 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