From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2on0099.outbound.protection.outlook.com [207.46.100.99]) by dpdk.org (Postfix) with ESMTP id 22FFE9ACF for ; Tue, 14 Jun 2016 21:08:38 +0200 (CEST) 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=kTfr96/5NTBNorMhICuMn4J44YkZxjCEXaBo9LTvpwM=; b=TlPyqaRBSmO/5H2vGz4lJUVbMFKdOcOHC1ZFVkAkbMGLSnhMOBcm+CUY6ML0Vx7dly0D2CaKYuvTfEN8pbD4eDPvadr0ntM/RXx51Qim4JYfMPqKSSuafhrPB9uk58FjHA348lHYf7MNT0sIrnAMQwmq3oeDq7n55+BobJFqPR0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from localhost.caveonetworks.com (111.93.218.67) by BY1PR0701MB1723.namprd07.prod.outlook.com (10.162.111.142) with Microsoft SMTP Server (TLS) id 15.1.511.8; Tue, 14 Jun 2016 19:08:34 +0000 From: Jerin Jacob To: CC: , , , Jerin Jacob , Maciej Czekaj , Kamil Rytarowski , Zyta Szpak , Slawomir Rosek , Radoslaw Biernacki Date: Wed, 15 Jun 2016 00:36:37 +0530 Message-ID: <1465931200-23912-23-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1465931200-23912-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1465826143-22159-1-git-send-email-jerin.jacob@caviumnetworks.com> <1465931200-23912-1-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: MA1PR01CA0040.INDPRD01.PROD.OUTLOOK.COM (10.164.116.140) To BY1PR0701MB1723.namprd07.prod.outlook.com (10.162.111.142) X-MS-Office365-Filtering-Correlation-Id: 06632c1f-bcec-4c68-9e8d-08d3948749ae X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 2:GYTU+GHidUxEHjllP6T71EZ5n5h1abN44pz5Sf8AqBQbgg6JfMry9afa5oXvml8xUd+xOA8evN1A8yqrj+BL2vXm8+FeoIxNjb7rD0L+tDzlc0IFp3kuFx3Nrcyub+spoZFUZdtjy+/y5dHY8ShqengZq45XtjMISS4G3haL7hkq/zbAEH8AJAkQmfrZrJbn; 3:2qPhQFoyqrcX+ic2to9UYSlYvqTfoRQK/2B+9IBgV2fIqcOM/aAEhu3Y1DaN5TFv7It+ESX0xVk/vrbmiuvSwxIW7Vv7WtZgmOlQFHDm+zce0LMkR3hAb0GkpCYZLPOX; 25:vaQCH+2HDXkzy9UTYXmHTR+jzLvpposbz/uKw8TMFTgZEIqVmVOu8f8YUpmudFEvby0RUMyZzyaqBvwKGpq9MKv2qBIxlJ06uUkDghEwqHFIinaMeJiwiQC5KOIBmouR6dUfbjA6IjxLj7V/xC8JSzMss/uNcqqNeN2j8BxQIHeUzizot3gV3mWKyK8/IiMArbDoWO6umsd7+BJhFMjm5tOLW5vc78rfVTcHeX6j3RMfJcwsHZNMiQIKrx1pODHMlx/In/oDGGrg5seluT+LUc9fJX9NeyfGI8AVodOdinQXuhxRCJH6WEuRufCxOzPtRWdZ4m8PyXJo8agpiLmxJG5v9pd8agZlMlWFqupPvpYNXWyNgHQOM9k9eoVcGeFX+Ow5XdmuoudekOCAuoNh3dl+ITdLeF03czST8v6Ywak= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY1PR0701MB1723; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 20:GSyERn8SFL/4do46cZ/2TnkiAcYXV56fPtt0idAFFoMipyOCqWWMCA03ykd0SR38R71IBuwPyEITynrUGxMrIEdOxwOiTpj1PZzq8sgSy3H5f9gB49kSf7+9eWp2RlMSAaGdwRlQpBiuuM6CJ4Vr0bbi2rkuockfE+vYKM2/LDizw8kHixLSO5erc4EO5Ex03Z6VS60o8PwTIj4XjKNmDPxdUmA6Q+ecsm5Kbu7AZAozSlf141+I2HET2g4WDXGQe+4UJ0ockHQS2ON6BQh6HnZSCA6HG8Or67rwwU+v2Ol/8cgfzRFRB0Mb8xQOxGf9/nSe3J6AH8NwjsL/0/bXvJuYZJluVAL9zca5kI6ptP9Zi+ScZgw544xgFoAE20Ju6mFmhiWY94GqGEJqOPsYAH8SYTct1CDEWA8b48ymGz+Yu9ahBF1vN/08hVYJDUAiT8LpwL1QYWOkCk2xh+yp9gv8s4Me1sw06WJSnkcDu8amJZJj3ehDS69YgpQ70+qJzo4/H5QyzWk+3fUfk2PwO4uNX7fLJ4fkcIv6Riom4y0vWRl4hYcaVqwVPnG1mWFOHDF66JJalPjZ3yGh1Ls+EvpJOarUuNiip9uN5OlOpN4= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046); SRVR:BY1PR0701MB1723; BCL:0; PCL:0; RULEID:; SRVR:BY1PR0701MB1723; X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 4:fxEODzPQc8iWl4xDfKuyrerSifS1YTL1/N9D5KuL3S7vtzTKH+il+32Pbh/Z5rcxR3lcGk+LVunRk4unpT+zpCFXjbXHHo3oYSvx0UYvX/hSXTJZNf4UJWkw9OXoO18kO5bXIFn14tCkjaltQiPdQbSx51GzP6hmV5UEav/5/zBjc01VLVmwoiP3cBduHsCfY5ASiahBkk3h7cgiirixfEfbeRCRYhWlaBkWCXTxDFkGtgJ2z4z3NU6IubmjPtOSWjau+OnnndBmQcajHGaXeZ/0x8CL2/1yHilDAwVQaq+u/mHmtKVX6sZK9SlbmKoQJv1Q2y7nSFFi+AuVvzvMcXiWbpV7hQ8zCOU/jVM/RqCdsYZlU6SG+FSAK2vMwQiw X-Forefront-PRVS: 09730BD177 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(7916002)(189002)(199003)(69596002)(189998001)(2950100001)(48376002)(77096005)(36756003)(19580405001)(5004730100002)(19580395003)(76176999)(5009440100003)(50986999)(97736004)(5003940100001)(68736007)(110136002)(92566002)(101416001)(5008740100001)(81166006)(8676002)(229853001)(81156014)(66066001)(4326007)(50466002)(2906002)(105586002)(106356001)(2351001)(47776003)(53416004)(76506005)(42186005)(33646002)(586003)(3846002)(6116002)(50226002)(7099028); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0701MB1723; H:localhost.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; BY1PR0701MB1723; 23:W/OPZ7Pw6r3iiqSgcSGJ6NMAcTBupQE76AVecx7?= =?us-ascii?Q?SfyU5HdJXo2Rnq1NfjK9rKdaJuegtLf5id85yT5diXBZimy9pLz0OZLW5Hm5?= =?us-ascii?Q?Drui25iMnJTotIEIJQ0guknl6NdCFpO6wnLeWIQ1jATzxDM9OQLu+Eilt5fF?= =?us-ascii?Q?vxmbwS17EXHThJZA8MotcofUbTKye3J1CncPVlYseE/s7yLoHeVEUDYg2cBk?= =?us-ascii?Q?C2aPUqTtQz0PJzi/isGi3hbET7iDd8wBzvTy3dCLvc2JA+Ha+MSfWgfYAN9C?= =?us-ascii?Q?GfuQOHP5Tv3OPKjEP7o3JXC6oK/W+It1n7A7Iq/lEQxisFinBGxv1PFdksNy?= =?us-ascii?Q?B8Dcga4/yynSfqgxilW1ZvwAXHL3XU3WwPv6xkuWjMlQ+sUAyTHVB+ZBWNpy?= =?us-ascii?Q?R7yquG/QIpsmB1oHtD7CPkw9g0S58AQ9bHpXClqD7nbk2/KD/kktPqFM+/NU?= =?us-ascii?Q?ySa3du18JVkJIUo81esrv4T4RJWKcSyp6eAejjJxnvewe1BTmTXlzjfhCNvT?= =?us-ascii?Q?I5DzeijQiU+wrmUcWthitfhOvHmdXOCV3htaUTIxi95HjPpb0uMVfcGfy7pC?= =?us-ascii?Q?KTFhA/5t2HBbrtcVtDu/3JxbaiUSFNoF4NeM2nXj0IPqxsaBiE5U1o3yKpWQ?= =?us-ascii?Q?5xF+j7rIry7GQDplTlnbxaQgu66H+dPzhepqMxnoseGTSCvHVcyBDakcG2m3?= =?us-ascii?Q?lsc6hgAOHHY57nRmkvHS3/7lOJ5euKkK/85oQgEPtigc789mvP9yoqpdBdfy?= =?us-ascii?Q?ukqeMrU8mFGy9zwio8of+jLnGdK52Mn0Lr1Py6wslXNBa08W799mdfxS8Aak?= =?us-ascii?Q?yTcVLLLupO+PFArgcJYpeAurThmqQ3qqw7zTnz8s5DZ1sorBUvqcg7yLBjgi?= =?us-ascii?Q?E4OHapDSDDZnk8RmOSl20q8AClCEzUla8DjAA0rdaAROBZqhw9Kr+B9UkpOP?= =?us-ascii?Q?aqShiQmV7auKR3Sl/zHJczwAurVvtpxqW7UpF8S53BwehzouVw+067pzu3Xs?= =?us-ascii?Q?pJFKErIreng0R+YE1pKvENZBUmsDahVAApKRJH91XthUGKvzrRRFGba16rzu?= =?us-ascii?Q?lq18MpopQejPzYqkHuFos4+EMQAAJYATJQtdyVzx8Kcc3WCYK9vzfgIZ8bk2?= =?us-ascii?Q?4DGFSqf/q0x9rD+j7uPOFD20j/WQQQxPZVKULnUI/NfnWFux97CtkA+j2Fc2?= =?us-ascii?Q?+jgQv7NJlJrwQKEw=3D?= X-Microsoft-Exchange-Diagnostics: 1; BY1PR0701MB1723; 5:4F/f6ggZjjxYcgL/sYVVladELc5ryaSOdhlaP6KFYsaqX4JpmUinp/81hAENQiyDeyrt02mVkiYHFc+Bo1qP+qKL4r0bd8bAwiLHvmG+a4URQPQ6tZoLznA9Ttn2SEgUTEM8LsxWjzWvS0t9ZboGMQ==; 24:eftqATNevg3KFzGxjh/o0EPzImQfc9qVotXr3El9QGX0NWxm9QH2u+XCJRU/G5aq6hQAnS+u7YvrK2eOReFCaxbXPOUFhMp4kpjPndIBhCs=; 7:ykCqxSYzVkq1rZj/k/EyU6YgCHE9MriUp4vcDQcaHYTwdvppKGVhvql4qciWJ2eH1LCaOOg2J2ywPq5KqkjQ0Nri64CyMmq7/uFya/YSoZ4ttR5SUBKoYXcQUbUb6qVA34uaFXAxEhC6i5JyCFzY0F0nkRlj8n3bGG5YIgpi7FIOslt0zm7XQiHW0xQTF+7pOBUntbK8qsIlLwtnDYZgsw== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Jun 2016 19:08:34.0640 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR0701MB1723 Subject: [dpdk-dev] [PATCH v5 22/25] net/thunderx: add Tx queue start and stop support X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jun 2016 19:08:38 -0000 Signed-off-by: Jerin Jacob Signed-off-by: Maciej Czekaj Signed-off-by: Kamil Rytarowski Signed-off-by: Zyta Szpak Signed-off-by: Slawomir Rosek Signed-off-by: Radoslaw Biernacki --- drivers/net/thunderx/nicvf_ethdev.c | 59 +++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c index 7a58cb3..3c88290 100644 --- a/drivers/net/thunderx/nicvf_ethdev.c +++ b/drivers/net/thunderx/nicvf_ethdev.c @@ -562,6 +562,51 @@ nicvf_tx_queue_reset(struct nicvf_txq *txq) txq->xmit_bufs = 0; } +static inline int +nicvf_start_tx_queue(struct rte_eth_dev *dev, uint16_t qidx) +{ + struct nicvf_txq *txq; + int ret; + + if (dev->data->tx_queue_state[qidx] == RTE_ETH_QUEUE_STATE_STARTED) + return 0; + + txq = dev->data->tx_queues[qidx]; + txq->pool = NULL; + ret = nicvf_qset_sq_config(nicvf_pmd_priv(dev), qidx, txq); + if (ret) { + PMD_INIT_LOG(ERR, "Failed to configure sq %d %d", qidx, ret); + goto config_sq_error; + } + + dev->data->tx_queue_state[qidx] = RTE_ETH_QUEUE_STATE_STARTED; + return ret; + +config_sq_error: + nicvf_qset_sq_reclaim(nicvf_pmd_priv(dev), qidx); + return ret; +} + +static inline int +nicvf_stop_tx_queue(struct rte_eth_dev *dev, uint16_t qidx) +{ + struct nicvf_txq *txq; + int ret; + + if (dev->data->tx_queue_state[qidx] == RTE_ETH_QUEUE_STATE_STOPPED) + return 0; + + ret = nicvf_qset_sq_reclaim(nicvf_pmd_priv(dev), qidx); + if (ret) + PMD_INIT_LOG(ERR, "Failed to reclaim sq %d %d", qidx, ret); + + txq = dev->data->tx_queues[qidx]; + nicvf_tx_queue_release_mbufs(txq); + nicvf_tx_queue_reset(txq); + + dev->data->tx_queue_state[qidx] = RTE_ETH_QUEUE_STATE_STOPPED; + return ret; +} static inline int nicvf_configure_cpi(struct rte_eth_dev *dev) @@ -872,6 +917,18 @@ nicvf_dev_rx_queue_stop(struct rte_eth_dev *dev, uint16_t qidx) } static int +nicvf_dev_tx_queue_start(struct rte_eth_dev *dev, uint16_t qidx) +{ + return nicvf_start_tx_queue(dev, qidx); +} + +static int +nicvf_dev_tx_queue_stop(struct rte_eth_dev *dev, uint16_t qidx) +{ + return nicvf_stop_tx_queue(dev, qidx); +} + +static int nicvf_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t qidx, uint16_t nb_desc, unsigned int socket_id, const struct rte_eth_rxconf *rx_conf, @@ -1100,6 +1157,8 @@ static const struct eth_dev_ops nicvf_eth_dev_ops = { .rss_hash_conf_get = nicvf_dev_rss_hash_conf_get, .rx_queue_start = nicvf_dev_rx_queue_start, .rx_queue_stop = nicvf_dev_rx_queue_stop, + .tx_queue_start = nicvf_dev_tx_queue_start, + .tx_queue_stop = nicvf_dev_tx_queue_stop, .rx_queue_setup = nicvf_dev_rx_queue_setup, .rx_queue_release = nicvf_dev_rx_queue_release, .rx_queue_count = nicvf_dev_rx_queue_count, -- 2.5.5