From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2on0058.outbound.protection.outlook.com [207.46.100.58]) by dpdk.org (Postfix) with ESMTP id BBF435A06 for ; Mon, 13 Jun 2016 15:57:51 +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=DK6III34CnOfeXBJs1yUmtrj6pWIYEXNdl9ATio2Hfobj/DOXv57VOibq3kwQ3trwsSUFlMAkjL8gx6q4Qy5H2vuwGWmdtEJKFG8OspiP2Du5G+jV2mJtcob3tPusGUXEZGRDOL+qODK1aXEksV6MheYidcW1MvmF1ua2RNul80= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.Jacob@cavium.com; Received: from localhost.localdomain.localdomain (171.48.21.3) by BN3PR0701MB1717.namprd07.prod.outlook.com (10.163.39.16) with Microsoft SMTP Server (TLS) id 15.1.517.8; Mon, 13 Jun 2016 13:57:46 +0000 From: Jerin Jacob To: CC: , , , Jerin Jacob , Maciej Czekaj , Kamil Rytarowski , Zyta Szpak , Slawomir Rosek , Radoslaw Biernacki Date: Mon, 13 Jun 2016 19:25:40 +0530 Message-ID: <1465826143-22159-17-git-send-email-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1465826143-22159-1-git-send-email-jerin.jacob@caviumnetworks.com> References: <1465317632-11471-2-git-send-email-jerin.jacob@caviumnetworks.com> <1465826143-22159-1-git-send-email-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [171.48.21.3] X-ClientProxiedBy: BM1PR01CA0031.INDPRD01.PROD.OUTLOOK.COM (10.163.198.166) To BN3PR0701MB1717.namprd07.prod.outlook.com (10.163.39.16) X-MS-Office365-Filtering-Correlation-Id: 6721a646-7afa-4b65-fc62-08d39392b511 X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1717; 2:flCaBQfJuNfsjs/145FOK8lfz679mFFVnN8PlAJtBs27GFmcgsB1gAdC7c+Q4+27w6L4w0Tw3D9ahNGM+EkfTF5Nn//ptcB+Y43wG+Y67Tz6aIluaommFOjbjYo2EsN/ko1sa8aZlfEGvpSX08vd0JGSLREithNY5a7hyB7dO4RDFKEYuMm/HT/tKmFInfLl; 3:uwJ/ycVcog0d8XtOi0Hz/yr9j4qe/d0HmYlyYI/BrgiHg6Mu8K1SZ506G0Pkk5cZ3ca9oscezddj/PWBcWh7HLKBenskQoG0r2p1//rHsSaz81EBxsRCNG4QZwvyLRw+ X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN3PR0701MB1717; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1717; 25:bS5ZLwIWGd+z0foMUsJOe8mecAIf6iYoJmBhq1jR+xzWZMzgOExv5N8J8F8jWKEb79HYjE0eWYcpb2eVq1eNqJx6fgWUZB2qS2afNBky5yoXh4i+n8j0Xg8208aC0ySAWtQ9/S/SCGKomkw40HpE9ewQphAvZX1/qmk7uSqrv8MLDRy95h3kpXBQLNiyqOR3gCle05cNdKDoILdefSA4ZVNIElcp05C2Z1CtVsGw7ub/H77RTgK3R4+HOwGZEHpahzGvF78R3zaJwld/iN5m11UT8yxFi5YqD+cyyr7Gh2MWw/IS4sBp48sX2laHC81u+SDbVxYOvafjC5hr6MZy/4TpmBLUSOGOZ6XZw3HRJTdFs4psUbsQzBGUi99xxkD85DqIexztDDtC2CbIbriTg6ssaklE+57lvYMhX9zHcrRJtEVddjwEUWW2J98sw9x/YMNsAcOe4CIBC516RoK+rOlViEKGMxF2CTnXUcqx0vdi/38aTvW6/ZRKwe6CptAVHgrusp+va54ApjA1HJMeFQ7W2FbINUl05IG2Dc0W4Li99ndQyhpyyJeTNSXqI12bDZ4yJ06sySlNYsOIPhtuFWCdTqyiUIeRTw97cf0cqoQ2HV3phagHGZmwSNbCEduoPhlnJ2cH2ly2iZrDf8tv79uPT16P0uVHfJj5LCMP5/cswBXqvX62eUaC4Rhe1dIH3CxDvEXAH0AJvKL1M7xUyOpp+cU4tyIuDrTr5hQde/zmvIvq/Yi2xj4chQRrJq4ctTw8rTVDWy+/lxm+rlx/og== X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1717; 20:RyVtggd5v/2YC0mlDPifxbHiUn43I4vGL8PhhoH7GOpl0oLu6LdTXQVa9oqXQ9QbtrfTax+KCEcaS9IwL43YHGY0bgZxZMvvbFZ4CDmCFCPFpEo9hqMxdoTA1xsjtwipcI90on2oXMEX+zczNyjEXpqcXRFli63dBXMnnwckFhMzYXg+3hefjoM97G1jLNJlqiD9pOvXnkfiSXJlUFs6eyahfWPIpBTtWloZGZNDWSlQq3WPm7e9Sgwi8iPTWpPfWpi4fVrUjGWsvTjROYnvsb++jsnfcTDjVC/jkxyOjziWcTusKIP5VUUAblYCLsOv4UTA/2bKgBO1aJUiqT5ySo7kih3G7ZTZYLMe+JoCqF7trb3fYJhM7hnhdqQPoTIwJciPPORJCjbHn4Ga4rCraBxND9Hk2FAFoemERdglNvIH+0nIqRBScfDxIAq/5xBOzJcibyttlw2kfJa+QD5BF2W7UKdgt3KNR1y3U2pqxZDxMQu72Y9QoQtcpmLEqXYrUiF/sIrBLP2Rdc7YtlgcYGfSZh6oQd8oOFi4tKqwNmE1ouMsTP5G93dJTSbgzIy4BCapmWAoQYFIT4Dy+4Aocjx70Oqb7skLavf/tPg60pU= 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:BN3PR0701MB1717; BCL:0; PCL:0; RULEID:; SRVR:BN3PR0701MB1717; X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1717; 4:iSuA3aprxwJqr1sbwhzUy66fCd/lNkJHgRSLQ/pTkab4MnNTzFR+evLRKiYHVxVdKiNzY5XiJllYN+UAomj5GSurE2lJCswQi+tGZwkVBh2mUqeRzzThM3Mrmua36pmMTDfdUcsyZX3aC6VJuYOL+WneHRdtE7yhGH4GkHNhM1y6Nicn0L/k/1upSL43u852yY4niQG84QpWOqv19ip6ctwa43bAG7HXWmBS0MzLVELWPcEVkzrzpPwWB/FNwAEmrnrVI4D8/a6pYBHbtgcgkxQbBwy/tBkuxHkt+yrzBz6YO8nOD2PjK0zYrz7wZwPIUhLGzEihVHe7+I35me6/IphxXCXb12ySbQC/UfupxOne9xA+kak/+0x6P2rdLVpd X-Forefront-PRVS: 0972DEC1D9 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(6069001)(7916002)(189002)(199003)(50466002)(48376002)(101416001)(42186005)(50986999)(92566002)(76176999)(105586002)(106356001)(33646002)(2351001)(5004730100002)(47776003)(66066001)(36756003)(586003)(3846002)(6116002)(19580405001)(19580395003)(77096005)(8676002)(2906002)(81156014)(81166006)(4326007)(189998001)(97736004)(2950100001)(110136002)(5008740100001)(229853001)(5003940100001)(50226002)(68736007); DIR:OUT; SFP:1101; SCL:1; SRVR:BN3PR0701MB1717; H:localhost.localdomain.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A: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; BN3PR0701MB1717; 23:ieJCwbHk7v3ylbAsIC8hGc0CnVt5eKwu70dF7gn?= =?us-ascii?Q?pXT+W9O9Lre2/DcHAvAhj2PT9hMEB8X040100Ftv5WthI7dxwrZIY+vfvA9f?= =?us-ascii?Q?kiNzQindr/kwvxMU4bKP2tuPE6rMWpgqALgwrxArfUpYu5FJDHA0LOdUwPXX?= =?us-ascii?Q?VBMq+416WI4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?= =?us-ascii?Q?a926VQfX2mHl0hdCI1RjpDxdaG8Px?= X-Microsoft-Exchange-Diagnostics: 1; BN3PR0701MB1717; 6:os2rJ78F8t9FJRfGyM24CBWDUYYXmfoC4fTZSi1aWhghkG0E/wvEWogfr8oA2c8+Y61/3SbksK2e9QPhRB6nbnsv/6afr8nKQ1ZWk4IZmAp/dows8LnHoxauxWqEAwSjF5ooz6ujhcAVElnE4LxPnbmnmshHA1LWKlKV+cj6CPbmNvpNSN+7U1TLipPq3TTxky9qMwfcIVgxeL1pPvds2FCi0RVdBfL30wut+ZiXtA7GntRWuEt1yyN+pN7RjKGFTD7H4un03Gk4Pw9Mg5/LoatzYRDRXXKsF1pkJtYlxS4=; 5:p/dwG3NJFd2672aF83nrBqurJUfGgungRosDnHsyS2QmvAcDSgPifWkX1ZkUmETn7+5UnQvon5phHvpCDUIbFR6V5RtYCRfrBEnKUyCdxi4E7fZvqG90FJNvKwelfNJwQ5j+i1Rd6D0vicniL0c5bA==; 24:NHV2s89xUBQAwyxECTenYPhkxeKxp90BpqQnqig4/B3ETRlmiXsSWjp/ITfpbI1FVjLoOSY/CZUBeXgH4hcmmZs3mX05WaSMMd4rkOXlpSE=; 7:ofiXtMDT0I8V8EJmzEv9+SQP9eYpSpMNpsJkU1os3uV1x//Qxyklr0wAxyWfiuL5IdwC8+CUUh5UHGDKccvx8bnzv8YBjuzLzc02LbpEyOLNEJ+rHcouo5l5BJyQBPqQ5EDg8EatdkHiXrTqbvZQBxVIrGcu8PjYIU9SKaWTYf8OIVDc6cGixIjWCAjetQ3R6eByz4Mavdr4uqsTvEC/NlAM2aVWpUJB1RfWKYNSz8I= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jun 2016 13:57:46.2603 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0701MB1717 Subject: [dpdk-dev] [PATCH v4 16/19] 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: Mon, 13 Jun 2016 13:57:52 -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