From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0087.outbound.protection.outlook.com [104.47.36.87]) by dpdk.org (Postfix) with ESMTP id E1E941B1ED for ; Sun, 8 Oct 2017 14:46:12 +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=k9Sp//dPT7lnOtvwnrAn/Mje35Ns/RQkwmoovB+Uhds=; b=I7n38tl5XZQ0HxMDkERbzs3wNLJ0eKlxuRfa6ezwwFD9PTwhN0AZ+5Wyj3fnA2cV3n0NszBDDutqGFlO3fb4UZi29hVzRHiOY1tXf3HPUFisrCMApk1V0QSXyFs4jw5Yf5m0pXS/DAGosb3jupoH/sFY6I3w+kFEqlglkt5DHg8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Santosh.Shukla@cavium.com; Received: from localhost.localdomain (14.140.2.178) by BN6PR07MB3089.namprd07.prod.outlook.com (10.172.105.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Sun, 8 Oct 2017 12:46:09 +0000 From: Santosh Shukla To: dev@dpdk.org Cc: ferruh.yigit@intel.com, jerin.jacob@caviumnetworks.com, Santosh Shukla Date: Sun, 8 Oct 2017 18:14:24 +0530 Message-Id: <20171008124430.1866-21-santosh.shukla@caviumnetworks.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20171008124430.1866-1-santosh.shukla@caviumnetworks.com> References: <20170831145436.5397-1-jerin.jacob@caviumnetworks.com> <20171008124430.1866-1-santosh.shukla@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [14.140.2.178] X-ClientProxiedBy: MA1PR01CA0113.INDPRD01.PROD.OUTLOOK.COM (10.174.56.157) To BN6PR07MB3089.namprd07.prod.outlook.com (10.172.105.7) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6738636d-cf9b-4d3f-23ed-08d50e4a8e2f X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:BN6PR07MB3089; X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3089; 3:umRrDezSd88OylCcKb4SFPcCCo9wodw5SyynV7f+tCyqYIzA/8evQJgYlvGjoFfoZh521oZhvCx69fzJKB7K+8HGwjQ/hXqJEvdYqn364AcLYwNS6SHXKLcGxK7Si6ByzQpeEh0LUOkkWAEfli5WcEJk/hOk4NsvNQwf2paR0JdEfMC6uGYJF4d4ZNtTw5W3VaRaMig8bynKkrtspejc0+zf3X3wBCuoTn2/IsfN3RKHmlbyJy3bt8b1jiWUzz31; 25:9m6jpu8HDjk0pYl0EEZuwBe3f5/biVILkOyehJm4Ce3Rj1PHjhI0IU7QTdzTv3fozdIgFM9XdILDSuYwO6SI+06YYkpLf4EROaeXklYqi/X92p96cy/fcdFonSYZI2RY0CB/JMrI0v9hYtJhxC2F0kn/PTwZtu/SbEhKM9+3ct7UAr+L/vlD2vL9wQwx1JQCypMJD8DqPYqydL3qAvC1mNgx68Z6wedMP940/pEKNKCsJlRmsyEHf1I+HdD0Rucm/Wi1/fpT8qYrmNgJZgbax3CO7YGUi4ksupm4L+Z+8ScJkmllaMjq8w5Ke6WRBHn7NEhs4MWB3LbikLwnB2b9oQ==; 31:MDl7/F8lc6FHjRVUinYuNMasNs+mYfrxqvp4VApSgdwdOohvLENUzAtTkwZ5wlBxu0Okvg/qzzmrJSiPBmlyThxxMfyGg2J33OgrMrWG6r277YAIqXbqh8t8SYjj8md4LWceNPegXgVe6JuepBbLXs/TkFZDZ63erwGwtNE34DI8ITjlb1zWfl2ObNH3c7Wg/uWaVpV17GYlg/MFMw8hRDYJgDwF7l1bcrzFTbjEvLg= X-MS-TrafficTypeDiagnostic: BN6PR07MB3089: X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3089; 20:JiDlpx/z8FIu2DGTyTgS9oWPTVrpkaw9Dxgc7w9FKOW+MQHdv1ayzg1VRaVsDjZBMBrElmqZSaO/o9MWJZEuJabtSTptfWoxIuI8Bxi5WlMet2FvO1b3rlUcsNtHOxmbgiFGrhaMLBwUGbyo+dQoa/HFWA5on1WuUCm2cUKS3YGwr91cMunnNo2Bh86NwyMAV0Vew3n/7AgrzUZX/nhX2q970bOJiTyWmSy5cFp0fCKHDHKHZrbEWvQml6AxjFPd3q+I+rcEg//khdh+01yDCaoOdCdeQMJI9dnMLJ2Ls10hkOCXwMPZ2wVDJNbH5hniYUl2CoZuKz+rtLtOlqaM77+hdKExuN5UY8GC0V0wI12Jae71jAFph8KHZqwVNfcGLEQTIdoHtNzAKp9j48/OxSDBp62o2rKs6fhX7Gsz/qFyX6HPJoA2Vl4xCMQcnwYQaQ3I3EUBCuIU3OZ4eQp5SenkM3Bnrwc12GzcArkYZ5FwKSIK7YZUHxN9DU1JYgS31Xdhs3xnGWp4UvjefD/WC99O+2vLLJeHULCY76Uwwk56dfi76avVPhu04gsNQmsUkTOKtJaVC7QVMxCcWBPqgAo5l3BfaTgvTREiJ2tPwoU=; 4:7/m4f7FDGrqngdrhQXxIcrcOIq5/LepFjt0v6BHSBkQIqxiwryJ6HTrCgHdUBL1MtlNg9sf4qZXYcB4HH09KJQplYE3kbt050icbhzSP/UIeuu615UZKBeKhOSC024FAgJ63basZRskW7t/GEtb8bgAt2Z6EfiPB9adoZCC/pDttWhXxiKVL9v17auI/55PNG0DePu2H/aKEfZUZUORHDZQvJsLhEfkav/9QmA1cZMnxYobZXEMN9uiSvdU/F+kp 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)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(100000703101)(100105400095)(6041248)(20161123562025)(20161123558100)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN6PR07MB3089; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN6PR07MB3089; X-Forefront-PRVS: 0454444834 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(6009001)(376002)(346002)(199003)(189002)(6916009)(42882006)(81166006)(2950100002)(81156014)(8936002)(50226002)(6486002)(16526018)(6666003)(189998001)(16586007)(316002)(6116002)(1076002)(6506006)(3846002)(7736002)(305945005)(8676002)(106356001)(105586002)(5009440100003)(53936002)(4326008)(66066001)(107886003)(47776003)(2906002)(5660300001)(6512007)(76176999)(5003940100001)(50986999)(97736004)(25786009)(101416001)(68736007)(48376002)(50466002)(478600001)(72206003)(2351001)(2361001)(33646002)(36756003)(110426004); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR07MB3089; H:localhost.localdomain; 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; BN6PR07MB3089; 23:LGq/OfCo9WG6ufg07nM5xIaUgMB2rtoC11WX2Pr38?= =?us-ascii?Q?PvspQk0KCIE4eMLfOaU3eY3fo+h4/E6tCxp/MMrs9hv1bmqAV4zEk6RemRGG?= =?us-ascii?Q?myCggKw0PHR2D0h17YchIhB6sDEiw/90b1gvJ3voRvZz52kcNT3CJr1g6IkL?= =?us-ascii?Q?NZaSsacozJnZlY2236wUKrLImONwx6rHJ/4YC7r7kNCXZP5Qobyggzz6h89j?= =?us-ascii?Q?+5sTP607fmXxNOP5Xbw/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 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Oct 2017 12:46:09.9466 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR07MB3089 Subject: [dpdk-dev] [PATCH v2 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: Sun, 08 Oct 2017 12:46:13 -0000 From: Jerin Jacob Mark "Queue start/stop" as P as its been implemented only for tx queue. Signed-off-by: Jerin Jacob Co-authored-by: Santosh Shukla Signed-off-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