From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1on0064.outbound.protection.outlook.com [157.56.110.64]) by dpdk.org (Postfix) with ESMTP id 458B0D0CF for ; Fri, 17 Jun 2016 15:32:53 +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=s6HMW72fhk0ARAoYpfRGczdXwa8U3IxX5jlKFzRnx04=; b=MWVRVvcW4mBAu7ztmXtoqTFJQ17bJt4oIAeIlL6wQdK+cP7BPNu8iOqPAQkhl6rQWYgK5w66lOkI8oo+gJ3xadm8RrOHvaF5jXZESQAj60slFXRRf/OI+hWxiYkcxFadwTNKxZ2NtTCB70OZt6KZqHavWOLz+z+er1FRNpv3ueI= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from localhost.localdomain.localdomain (171.48.17.70) by BN3PR0701MB1718.namprd07.prod.outlook.com (10.163.39.17) with Microsoft SMTP Server (TLS) id 15.1.517.8; Fri, 17 Jun 2016 13:32:48 +0000 From: Jerin Jacob To: CC: , , , Jerin Jacob , Maciej Czekaj , Kamil Rytarowski , Zyta Szpak , Slawomir Rosek , Radoslaw Biernacki Date: Fri, 17 Jun 2016 18:59:51 +0530 Message-ID: <1466170194-28393-25-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1466170194-28393-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1465931200-23912-1-git-send-email-jerin.jacob@caviumnetworks.com> <1466170194-28393-1-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [171.48.17.70] X-ClientProxiedBy: BM1PR01CA0028.INDPRD01.PROD.OUTLOOK.COM (10.163.198.163) To BN3PR0701MB1718.namprd07.prod.outlook.com (10.163.39.17) X-MS-Office365-Filtering-Correlation-Id: 40f6905d-1a8d-48b8-48db-08d396b3e1c4 X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1718; 2:5e+OF983Wa+jIg7q9SUX59H28g2qacXSEB2uY2+ZVUc5isrSAv1BBIvgSfDmNSWWS/ioWVqDfglf+KFGa7tRqi1u8iuB/RYMfv101uyRB3c4QBaKSgOscnPQc6vN0YUisKypjI8DzCeajB4O7955SzFt0KGaUdzm+WlZ/gk9p7aOfHmK4l8DznMQzNwsuMtO; 3:P9QkqjIDMIj+HoDCuDFFbuQKMZE5IXOzEZkK3piR3a9kzDtraxBqf0idUKgKPuBjoO6ywL6AD9ETkfSx+zEIipb6aeFr4gA83P0bWC/NDEok5+MwSKBSd3uBGh8fYgWY; 25:7yHtPKNJW6cjXQnZCC3L3/gtDN09GjX1snxguUUVcn15v6hGykyEnH7wAg68AYVpGr+wotrOqNCeKYFty5Oa5aVURbWg+9YIO5UsIORVc6Rb1HLHYlvtWWH1B+Oj1uYOpjuvOE+grw1UfNG3NFsqFF7rQXQAzgbdAfiPLsSEbEWS58M7/ZnsxtzF/zFS33Zg5viKQpgNwU7E4BdZB2BfzoKDlAGlL4AIQ/9U6cTJ/OTiCYX4w9KWMD8eIm8+uXU8PWTUaMINhBIkGfbRD1c7305D3qwgx7Lj7QGVbf7Zs468PNiO/ElFHWAcxmy8GzGvru2rVH8vZJyJdQrCtXUW8TESyH9JWy09hS6VeAMYV6Tt+pW1AfHIbo2FChyAegDZcTzPDzVazsEhcfPEWeGmVCHjegnp4iD3mxCcmjxyTUQ= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN3PR0701MB1718; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1718; 20:uu7xzxO9wg4XMW63QqY0y6quateep/7p/zZaPn4lvWfClNELSAWRSlBBUPkG58kAueX6cAqR8Yc90NvGPI2ibTYbEDfEjgiROvV9vesICIAHvTqAKYGF4S9NXdUCZLrWLC4hMSxY8j0cLuRHbEa90oMLIXIZ3R9mWcFoUO9KnCbXs4CAk2pZJR3O5QaU/UMf+HKbJ9iZEu0kzwYG0Ua+4DN7/z0Qy5jWKin0K+sNY9gL7QtjWfgOIJZuojwc3z/9jx4GzAL9irB78VzRCPX7m1/otLX0zP4jxl6fjlWVynuYiXalCdrdGs24LbxAA/+NLpuRUo7ARrNnos3skq6zh8uo7kqVLtvdJrqateTdKoiBglnlAwamwD2jy31WVhqYhYl1y+CRlXoT6V0AJD2dDl9gmw9Z7bl2QisVUxXfJs2/pTBPS+sZu39jkvpd7CoV2Io1eLwB+VgI/06VZbgu1icETwexT/6VHsCRmkhSQwl0dT/dpQcvfMLZ8NvWsuR8J9Ss8NxQuEB1iL5u3avb5+lamvyg4mBlQoB4Nuap4gXfJxM4z0JCwE+/+JkP9vRZDBFsEzW+QOHerzEFA7Pp67gqAd/Y6KyoUN/tNf6Xh00= 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:BN3PR0701MB1718; BCL:0; PCL:0; RULEID:; SRVR:BN3PR0701MB1718; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1718; 4:MnrrDGapbQnGLCX6VP9as8bdYVz4nVLqKtgT5CFjZTRW5RfEsExJKCCiMvghPWHDep59H+VrpNN6urO5dT6PkMX/9crCZ/QQsJHz5ggrd/148qnkZGlIOGMzIkzZJiENubSj6W7WZ0txjILpQ98x63Er6vKoQ/G5ClxQcpHSReDMjeW5z9kPqTWgBIC89x4bZ8MWMRcLJPfIbdrkfR5Rs9Krwqix1l9hOxkBNOYuzssOSMe2ft2nymF8Ky0nYTzphN+cvgpJSmnbDOcgXXKVZS/PNYDyvKQXzeKBeiW49AABGtaxlXewGP2TwiZ1APfqPtZTdbFMeJ2mji5Xib/rGbNfUfJIVTt664LJGt5xYRM1hfjPKP7YL1S3YWe/V8Bd X-Forefront-PRVS: 09760A0505 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6069001)(6009001)(7916002)(199003)(189002)(48376002)(19580395003)(68736007)(2351001)(47776003)(229853001)(97736004)(19580405001)(586003)(50986999)(110136002)(36756003)(3846002)(66066001)(92566002)(105586002)(189998001)(76176999)(33646002)(42186005)(81156014)(5004730100002)(101416001)(50466002)(2950100001)(5003940100001)(4326007)(5008740100001)(50226002)(2906002)(6116002)(77096005)(81166006)(8676002)(106356001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR0701MB1718; H:localhost.localdomain.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; CAT:NONE; LANG:en; CAT:NONE; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR0701MB1718; 23:yfuCmKvitv+tOPhyiwzNFNzMobAiBSHUOKgHd9X?= =?us-ascii?Q?HYV4jNiGOE+yhh/a2ivgMM133p55OD/JNMOA57nhKDBb27KmRNjJ265oX9sQ?= =?us-ascii?Q?ObAj4n11+OUABlMOMRNautWgWDA8RM1sdgKzFn7HaUYMy0PCtLrE4puTqZrP?= =?us-ascii?Q?CIh2JAX5Not+CdvQgWU0npZimJBh21/cAytYYSrptEU5pUbVSICgWJts87Ri?= =?us-ascii?Q?X1k+7Qg7FKffHSrvBQtNXT2scMdw6/DC01BpxaX6t46j6M2i32VEERQBB5QQ?= =?us-ascii?Q?dsFtRSHenx5w/9QWXxfOlkdz1VfyRzez+HqbfjOZBWsLWtj9wA/trwxM+cXF?= =?us-ascii?Q?4/bUxawZJC7rulWwg/DKy6Kwy8qN6FCe+BydaZPBd+SBxRXGPgy8nKnVTs4j?= =?us-ascii?Q?bejHwgoRAviHC3OplWAbabFwVfDVVtNryK9SyKRNYBcvnLnujqCBGJZfBU8w?= =?us-ascii?Q?Xtk43PXH2KmA6S344a1RT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=; 5:nLBwpYbxTcEs+/w0CHWydlmGrjmnqHYJI38XxUzBKONP32cgxk2yWmpabD5wxmBwcqrY1H6OxmVy/2FX8uA2EGParsYS4Nkt6uiuBJBgGVTsKIia5uSWHcOfS8R1dGM3YGIxLeNvNvrRxNOLPiMMGQ==; 24:nmbQhiDNdwijJ2i1rYjhZ89c6jEAtSGDa04ftfCcq5YdrHZJyTTwRf7WQ+gYNREqWG0tiG8YpBy5hrd3YMIVaSS4enDHEE5tRJOukiJDW48=; 7:t7KLpIPKhph7SQYJsw8k9c/ezTdzWJ+UpGwfMoa8QwTjp6aL7DhLq+sfIay7Xv2Iz4pO5vt9Wrv4Tufksp4G+8jL9A43ELjOluYOSEf/SrPKL/ORHBZjMtbph+odVb9wS2Gm0TAUBMMeyI19p53VjLfHoHE/UQJjmVOEqjpJR9vDben55ofSfpLsF3+bC3zeGRu07LAcpYEmXvJHrSXPVw== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2016 13:32:48.1045 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1718 Subject: [dpdk-dev] [PATCH v6 24/27] 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: Fri, 17 Jun 2016 13:32:53 -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 ed69147..fd5751e 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