From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0048.outbound.protection.outlook.com [104.47.42.48]) by dpdk.org (Postfix) with ESMTP id 4311B7CDF for ; Thu, 31 Aug 2017 16:56:11 +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=+DdOQNDZNRdbYHZS3X01T0q5FDiLquT8ZxoXL3DLzJY=; b=GZJnvOMkLa+gRV2zhPl8Lb+19XpE+uIHJrb+T1/w3M3VwQxCzZaQU/SjyOCpIAq9ElukEnnMBfKFcfzxRR8FhMJghm+qvaj7ErIxXc80+50KbbAxNiTxZJd4orcaOng0FTG0g+OdM1rEcQak98YiS1baDYpozZPx2fueOoxwhHs= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jerin.JacobKollanukkaran@cavium.com; Received: from jerin.domain.name (171.76.126.71) by SN2PR07MB2526.namprd07.prod.outlook.com (2603:10b6:804:6::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.13.10; Thu, 31 Aug 2017 14:56:08 +0000 From: Jerin Jacob To: dev@dpdk.org Cc: ferruh.yigit@intel.com, santosh.shukla@caviumnetworks.com, Jerin Jacob Date: Thu, 31 Aug 2017 20:24:30 +0530 Message-Id: <20170831145436.5397-21-jerin.jacob@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170831145436.5397-1-jerin.jacob@caviumnetworks.com> References: <20170831145436.5397-1-jerin.jacob@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [171.76.126.71] X-ClientProxiedBy: MA1PR01CA0109.INDPRD01.PROD.OUTLOOK.COM (2603:1096:a00:1::25) To SN2PR07MB2526.namprd07.prod.outlook.com (2603:10b6:804:6::26) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8c599738-3542-4d18-9866-08d4f0806a88 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(2017030254152)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:SN2PR07MB2526; X-Microsoft-Exchange-Diagnostics: 1; SN2PR07MB2526; 3:rXejW3fOTR1JTnYY2ro43av2x981h1R5bOlu1beT69NgGhO68WPZnw/KYC+n3u8ZzKPz7BxZUih7nUZHislCVJlzArLrIK7Vio22tUFrSaP5BY4qj2a+2T48XiFSfvsSO6bk3w+pykRn5ui7ZGIqrxjmq3ER2BGJe9HQpTqvipmpQRclh9Ui5vPxkAhTp44JV6p1JaIvLy2c7alFN29IRerMKBxqYqf24vLviHi+LOtBQ9esflW6/SPs2j01CoIW; 25:Gym0ZfKLMdLfNU7j5VYblz0Dl1/9QYKQIdZUJYf8ChqRhBTiQ7p2Vhs2E+WFxi1xI492xiKLlhAge/m46YZ6FX/oRRcvDXmwfu55D3wL8nJtbzKa7uY8oqRIL/zOfkSLU5HZWBFAhn1P2Vwu+7Q2tqHGtZ2+K5Wmmu5vM/eCUmcOJXmaIv+W2dPpzX9ffJPPbEwyhGX9VVhfMWalBYn3BpQk/gT0wzhA8ykzvrI2TGBFInQ/8MdKXh1VAU/Qlw6ZzG5Tvq3aXInX1dg2ht37Djeoo8k7w2mhOQ4FQ+zPU7vEfo+OCAPtGptmZ6y9C6Q8sDSnKvbcSpGkIr8waK6DbQ==; 31:2epoB1pqQgCCPF9yqb2E/9Vm0gf7dTS8ig7Us8ipMMCzXd0K7EfGXUKUWkY8lyj8EyNBVRG6QtafNuEZ6GJWtV7MwGvmcodcJIqwUnlCAzqL9UgqRXlCUQIq3nfwFRNunYtIxrpywS8Li0E7DLq9tFtgsl4/9QxjSbZ9yiSJpXCJjW20nwSDsI9DoWd9B477RQ4f7RU54TaAWzrVpyY375HZ8ppnYdUMhAOU22DLJWI= X-MS-TrafficTypeDiagnostic: SN2PR07MB2526: X-Microsoft-Exchange-Diagnostics: 1; SN2PR07MB2526; 20:cIitIRPRfGG2DyObUKMnqOcyoDlKsXgmmVFhMS8JWAdMe27iBxSxtNVU//dT+OhGatPuO//bFmquJFzEG4bgl8ZN6Fd8wJ6DVfn1vGGHSuy9vOyfkxruVlO8A59rJii8oKoFcSpyWYKPzBNVXpwQ+30u9BjhjFhij/YqMfRy9MwZt5XVjSXIrZEWPelLpOZAcpXYpeoAz3b1wZ3F/Xwq+PRbFq2fNApIPA2bQ0mXlI7fXimNhJ2Uuei41jYd32DBTxVsrJcREmxph3B1jKwbgn3NdsY5WJ/brTLjikJDdaRuvHukUk+YgEy6wmdTxzxEvhJxomxqD1JTE1OYcU9Dj8/mN78zNzPcQqBWRaAw3Renfu4WgQgfEBPFyuE0L+xFzRKoAf81uFcYfPpTL3vZR88rlCmY5WGJ3q/4lQYiwbEavnz/j+DxZH8taQ4uwoOdAwST9nxmfLfdYrp1AjOTEik88C0lsFGR+wl2CL5P3zG/SiyAOtmPqjdtX9DNH7Yvrlwa5BhSkDmc1zAD1/ZmTujG4mLo38XZkFQ766YU/QPmrE2jGheexryZyhIFmoBc9TmscaxMvuR4BBqdJiVVwTwB7oCnJ4t59Sabgif/Sbw=; 4:W2+z7jxVjyTs4YfVhwYkMYiFhiPsMihP19n9osKL1onrzlnZPm3SydaLcE0EfeXmJMDDSJuJFfxEfuEhR5jCGu0bgtighrnRqNJrC4+bXTRsGO//z94rYOppPQGEsP9vJnFhCRhDu81hNSTywMMvCWWZCHD+cl9HE/9nWpQ4yjDOB0CcZ1Il6fqm9W5+d//LCNrzCxwBu1d/p9G3YWydqfFDdw0oHBtq+eWq/ROokJMlKxmjrs1+GoPw3w6dSTov X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(93006095)(100000703101)(100105400095)(10201501046)(3002001)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123564025)(20161123562025)(20161123560025)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:SN2PR07MB2526; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:SN2PR07MB2526; X-Forefront-PRVS: 04163EF38A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(199003)(189002)(25786009)(1076002)(53936002)(3846002)(6116002)(478600001)(110136004)(72206003)(7736002)(6666003)(107886003)(6512007)(305945005)(6506006)(36756003)(6486002)(68736007)(5003940100001)(189998001)(50986999)(42882006)(106356001)(101416001)(76176999)(2950100002)(6916009)(5660300001)(2361001)(33646002)(2351001)(2906002)(4326008)(97736004)(105586002)(48376002)(50466002)(81166006)(66066001)(69596002)(8936002)(47776003)(53416004)(8676002)(50226002)(81156014)(42186005); DIR:OUT; SFP:1101; SCL:1; SRVR:SN2PR07MB2526; H:jerin.domain.name; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX: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; SN2PR07MB2526; 23:T5XZz7wo4ZjMEoJwka/e3/aA0pxLpySIQAC0HKsgd?= =?us-ascii?Q?wfQc2gfKNaZhr4arzMb+fzgVeUmncS/kj1hp1tcFBxl4jAXZTjv48iT2RxWk?= =?us-ascii?Q?L48OWOGHRDxJNhgwWbmA9oPGqQTAfG37DzqlGOkSbNukgymVhG1EfU9AgD1t?= =?us-ascii?Q?2qV6or8xo+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DiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Aug 2017 14:56:08.4430 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR07MB2526 Subject: [dpdk-dev] [PATCH 20/26] net/octeontx: add Tx queue start and stop 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: Thu, 31 Aug 2017 14:56:12 -0000 Mark "Queue start/stop" as P as its been implemented only for tx queue. Signed-off-by: Jerin Jacob Co-authored-by: Santosh Shukla --- doc/guides/nics/features/octeontx.ini | 1 + drivers/net/octeontx/octeontx_ethdev.c | 90 ++++++++++++++++++++++++++++++++++ drivers/net/octeontx/octeontx_ethdev.h | 6 +++ 3 files changed, 97 insertions(+) diff --git a/doc/guides/nics/features/octeontx.ini b/doc/guides/nics/features/octeontx.ini index a8f38e031..cf9167df9 100644 --- a/doc/guides/nics/features/octeontx.ini +++ b/doc/guides/nics/features/octeontx.ini @@ -7,6 +7,7 @@ Speed capabilities = Y Link status = Y Lock-free Tx queue = Y +Queue start/stop = P Jumbo frame = Y Promiscuous mode = Y Unicast MAC filter = P diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/octeontx_ethdev.c index 034de113a..e2f1e630b 100644 --- a/drivers/net/octeontx/octeontx_ethdev.c +++ b/drivers/net/octeontx/octeontx_ethdev.c @@ -160,6 +160,14 @@ octeontx_port_close(struct octeontx_nic *nic) octeontx_log_dbg("port closed %d", nic->port_id); } +static int +octeontx_port_stop(struct octeontx_nic *nic) +{ + PMD_INIT_FUNC_TRACE(); + + return octeontx_bgx_port_stop(nic->port_id); +} + static void octeontx_port_promisc_set(struct octeontx_nic *nic, int en) { @@ -500,6 +508,86 @@ octeontx_dev_info(struct rte_eth_dev *dev, dev_info->tx_offload_capa = DEV_TX_OFFLOAD_MT_LOCKFREE; } +static void +octeontx_dq_info_getter(octeontx_dq_t *dq, void *out) +{ + ((octeontx_dq_t *)out)->lmtline_va = dq->lmtline_va; + ((octeontx_dq_t *)out)->ioreg_va = dq->ioreg_va; + ((octeontx_dq_t *)out)->fc_status_va = dq->fc_status_va; +} + +static int +octeontx_vf_start_tx_queue(struct rte_eth_dev *dev, struct octeontx_nic *nic, + uint16_t qidx) +{ + struct octeontx_txq *txq; + int res; + + PMD_INIT_FUNC_TRACE(); + + if (dev->data->tx_queue_state[qidx] == RTE_ETH_QUEUE_STATE_STARTED) + return 0; + + txq = dev->data->tx_queues[qidx]; + + res = octeontx_pko_channel_query_dqs(nic->base_ochan, + &txq->dq, + sizeof(octeontx_dq_t), + txq->queue_id, + octeontx_dq_info_getter); + if (res < 0) { + res = -EFAULT; + goto close_port; + } + + dev->data->tx_queue_state[qidx] = RTE_ETH_QUEUE_STATE_STARTED; + return res; + +close_port: + (void)octeontx_port_stop(nic); + octeontx_pko_channel_stop(nic->base_ochan); + octeontx_pko_channel_close(nic->base_ochan); + dev->data->tx_queue_state[qidx] = RTE_ETH_QUEUE_STATE_STOPPED; + return res; +} + +static int +octeontx_dev_tx_queue_start(struct rte_eth_dev *dev, uint16_t qidx) +{ + struct octeontx_nic *nic = octeontx_pmd_priv(dev); + + PMD_INIT_FUNC_TRACE(); + qidx = qidx % PKO_VF_NUM_DQ; + return octeontx_vf_start_tx_queue(dev, nic, qidx); +} + +static inline int +octeontx_vf_stop_tx_queue(struct rte_eth_dev *dev, struct octeontx_nic *nic, + uint16_t qidx) +{ + int ret = 0; + + RTE_SET_USED(nic); + PMD_INIT_FUNC_TRACE(); + + if (dev->data->tx_queue_state[qidx] == RTE_ETH_QUEUE_STATE_STOPPED) + return 0; + + dev->data->tx_queue_state[qidx] = RTE_ETH_QUEUE_STATE_STOPPED; + return ret; +} + +static int +octeontx_dev_tx_queue_stop(struct rte_eth_dev *dev, uint16_t qidx) +{ + struct octeontx_nic *nic = octeontx_pmd_priv(dev); + + PMD_INIT_FUNC_TRACE(); + qidx = qidx % PKO_VF_NUM_DQ; + + return octeontx_vf_stop_tx_queue(dev, nic, qidx); +} + static int octeontx_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t qidx, uint16_t nb_desc, unsigned int socket_id, @@ -676,6 +764,8 @@ static const struct eth_dev_ops octeontx_dev_ops = { .stats_get = octeontx_dev_stats_get, .stats_reset = octeontx_dev_stats_reset, .mac_addr_set = octeontx_dev_default_mac_addr_set, + .tx_queue_start = octeontx_dev_tx_queue_start, + .tx_queue_stop = octeontx_dev_tx_queue_stop, .rx_queue_setup = octeontx_dev_rx_queue_setup, .rx_queue_release = octeontx_dev_rx_queue_release, }; diff --git a/drivers/net/octeontx/octeontx_ethdev.h b/drivers/net/octeontx/octeontx_ethdev.h index 0c3452956..c47d4c6d3 100644 --- a/drivers/net/octeontx/octeontx_ethdev.h +++ b/drivers/net/octeontx/octeontx_ethdev.h @@ -91,6 +91,12 @@ struct octeontx_nic { uint16_t ev_ports; } __rte_cache_aligned; +struct octeontx_txq { + uint16_t queue_id; + octeontx_dq_t dq; + struct rte_eth_dev *eth_dev; +} __rte_cache_aligned; + struct octeontx_rxq { uint16_t queue_id; uint16_t port_id; -- 2.14.1