From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM03-BY2-obe.outbound.protection.outlook.com (mail-by2nam03on0074.outbound.protection.outlook.com [104.47.42.74]) by dpdk.org (Postfix) with ESMTP id C30AB689B for ; Fri, 30 Sep 2016 14:06:59 +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=xb0z2PBp8Jgj+COGtgAP85McYqzsOvdNrHEdTNMUcs8=; b=IyzweAwPUhPUqOv6FBThUbIVCCm8qYtzYO7IkmoxGb8pcxpp/GndY8DkV8GPnPd7adDve8lRJJscpyJur0q0oN7AosdDk0rSfK3Zyy5USJyNZsMfbfnXQKpdYVLUBNQR+EIulGxCN8wQHaMS0gcobyvX+EHKd+e8DLeJkRoXrMk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Kamil.Rytarowski@cavium.com; Received: from cavium1.semihalf.local (31.172.191.173) by CY4PR07MB3063.namprd07.prod.outlook.com (10.172.116.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.549.15; Fri, 30 Sep 2016 12:06:56 +0000 From: Kamil Rytarowski To: CC: , , , , , , , Kamil Rytarowski Date: Fri, 30 Sep 2016 14:05:48 +0200 Message-ID: <1475237154-25388-10-git-send-email-krytarowski@caviumnetworks.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1475237154-25388-1-git-send-email-krytarowski@caviumnetworks.com> References: <1472230448-17490-1-git-send-email-krytarowski@caviumnetworks.com> <1475237154-25388-1-git-send-email-krytarowski@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [31.172.191.173] X-ClientProxiedBy: VI1PR07CA0001.eurprd07.prod.outlook.com (10.163.160.139) To CY4PR07MB3063.namprd07.prod.outlook.com (10.172.116.144) X-MS-Office365-Filtering-Correlation-Id: 8fc38779-631a-45ce-cdf7-08d3e92a476c X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3063; 2:FOeKtxZ+IeyN8I+aZykfZda1iRL1B4tnPwr3LTvhfwI3/NSCl5jxSw8zcBS9IyyUvCCtAd+dc1+flSV3PKtX+NdwOzmeMnI1V9IEtERyJS3vBLJOPNUQgm/RbiesJyBtJbJYDeFrWrbz/sQ9T5Jq2rWuikh1VdU8rWoiPUGjr/Kbwj5WZGTc0hY1HwiKm+t1; 3:Iqsyuotzw6SGqfzZgpFeoj1fj88Iq3shi1Y3s6JBicsQvfCd5URBbfy7yMpyXMP7EFV60am3uWtOQdCZgiSo0bSFIppFPU0w01n12uJypSUiaLFWg/COoGLJIHwhxYwG; 25:9s3pBH67xXiIYG9XDkUWHWjeREvxFr6fjWDAE/W7yS4bYtXgDycod+lZIZtKGJ2CgVlQ9dxHpcNbOO9o9ciAsW7nnQfp2k4LjzgFd3yDHdTb2fi/Rht3zKhnOawME9RRzHFg7T8MlZykiYf91y4nqbug2MCDBYKhEPjt843PkC40fF/iF9kRS/eHCzeJIijfRqDFnu9j5CroiIMFzhBK6anFJjUQVdgS8RPSfYFh36nfyK+2ahs4mVI0buWWty56rmgzyegAcv6U7fAjTsSL7r81B+iEKhUKJQVOAIYBvJq8gMF1j4hcj3pcLLtXQ1C7OK+yULXJpbrof2TJws7EV3sJ0Atk6cfps/48IkvPuU+UltIhIi0JUX2dHAT5+5VLJx/VY3Pa+58uQ+HPk0cHxURBuDzQrovd+qMHzs4Kd5w= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY4PR07MB3063; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3063; 31:ZGKK363Yc3WBBqiGURXwrWyzWSyfWxAIzdbVlai2roAmBZCn+rzlCq1F8IN0wlPTb7APs+dtM6X4kKQfsO3y9FbTUgrYWTGPNkCa8ij/Nx7FhP8Y79BivBGYl5CrRT3BjlxJ58yn/7ricCVaPHmbdvhXIAGXOHxD74JE7yHAV6ANqnS8FgGyJ0qvbHYtDAMv9N2ADAUFtR5Vs/XOtBS44Zr0GDpQHCLVlt3o+pMmntI=; 20:cYbfO3bmZu8Q6Y2SqHHJBnt91QWp4vcqfX2UtxpuvCo2QaXYVmXV46NygGlUR5IKbSCUTcZAEq4h1lzcF9w60q0/NvDUD23kv+w3pK4QtNfp4IDityPWxSjG/PzD0x5AlBOxt1VnCsKRnIDnkwxjrlJhgCY+hN26cFYAIIO3w9emya+PEPczcUHHCL1fEr6UFJiOwMdbtc6lja+FUE2IkuCb878lcUMQUOGKQrabliejEh/hcWCdrq90mswOxvJFIQu2K2zw2IseEmlnnnScw4zjk3FzbRH8LIHQ0JDTmu+d32yq/0FvgpTwYdQNQQtK7OMgDw5Om6UAKY+a/3TblPOdwOYbxINlpQ6YfhqO4XYODSrWWxZE2LkN9vNGW0UO999K8e4YgjKHMcsvqsAfhgkyAxeFswywQUcTvkd2L3q1+EInUKoE8Z19vnokjuy8p7JYoPmmESJ3OQcuM6M6hAAPaQbrD0uuH6bQu+knm4QYFfPqbeut8YgNl5nqtoqmlPTnCRBDsVYuYkbCEnLgoflnY4O/0pTHX0L1/ivCRYcloZ6RB5ph3aHBixzn/h9t2oSXutPPb38uTJ6tcOv5C7NMdG3j9u6tQh8R5850dko= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001); SRVR:CY4PR07MB3063; BCL:0; PCL:0; RULEID:; SRVR:CY4PR07MB3063; X-Microsoft-Exchange-Diagnostics: 1; CY4PR07MB3063; 4:EQEXopJPKZOVPIV8kughXEqPMcr2Nzg+mXX2CCvqGHbDnIVFo5ogptgyb83q49BDBZGK23jyyaaG5uBTJyPUhUIulTZzBEQoH7upe+NeIJGLDfA8faxvVjnrRWzjFUQLktwZmoTeLMt7rRMq56A5V9OJSBZ4l3YOB6Ux6NivZgPkmIzfBHWMqUq7BEmh7l4fB47gqmf86B/6E3Ly6+6lTKHywrDA9hioKQUDDLxldm6Bg41DMcslfjR+e7QsLKBUJ2+A2dyxVC4hu+GTUMpYNvLEThmwjaxNn8DyhaXScuVoEYd+bLr6ABRIWf3rFzyLTVAIRw+VqKATJ5fPk5q5HOyebB9zUQ8BhTIV99JK+l3uPxWn+aLmUkdqp67F1SaN6ehiA7dpZGtQIau/xy/KHA== X-Forefront-PRVS: 008184426E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(189002)(199003)(92566002)(3846002)(66066001)(189998001)(47776003)(42882006)(36756003)(105586002)(19580395003)(97736004)(6916009)(6666003)(68736007)(42186005)(19580405001)(50986999)(50226002)(77096005)(76176999)(5003940100001)(6116002)(7736002)(2950100002)(101416001)(586003)(106356001)(7846002)(5660300001)(4001430100002)(305945005)(33646002)(229853001)(110136003)(8676002)(4326007)(81166006)(107886002)(81156014)(50466002)(2906002)(48376002)(2351001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR07MB3063; H:cavium1.semihalf.local; 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; CY4PR07MB3063; 23:94uTKryIbaX1OSVlcevXsVs408ZSo9m+DBAXqNhm2?= =?us-ascii?Q?ezekKJyhB5Wk1HRXnRk7fNaigHbp6zrgcdxh7FJ3X3wGyQivbXY2wSPeuIME?= =?us-ascii?Q?rzNcw8yHYZs/WwC7FbfjDQxYezCTkAkVQHlAYDIpfvWR5fFB42glCJ9lpw9J?= =?us-ascii?Q?kOFnJrreA00AP4iqkgYHweja4zuqLHGtdzpQltiivkBwSV6wDXW092Oxm1WN?= =?us-ascii?Q?oq6b9svkdPuHwL8wL948jQOO7LVEMJs4M5UFo3zADcsBoTvaaw7e4H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S-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2016 12:06:56.8689 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB3063 Subject: [dpdk-dev] [PATCH v2 09/15] net/thunderx: add secondary qset support in dev stop/close 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, 30 Sep 2016 12:07:00 -0000 From: Kamil Rytarowski 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 Signed-off-by: Jerin Jacob --- drivers/net/thunderx/nicvf_ethdev.c | 142 +++++++++++++++++++++++++++--------- 1 file changed, 107 insertions(+), 35 deletions(-) diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c index c8b42f7..7ca7d07 100644 --- a/drivers/net/thunderx/nicvf_ethdev.c +++ b/drivers/net/thunderx/nicvf_ethdev.c @@ -67,9 +67,13 @@ #include "nicvf_ethdev.h" #include "nicvf_rxtx.h" +#include "nicvf_svf.h" #include "nicvf_logs.h" static void nicvf_dev_stop(struct rte_eth_dev *dev); +static void nicvf_dev_stop_cleanup(struct rte_eth_dev *dev, bool cleanup); +static void nicvf_vf_stop(struct rte_eth_dev *dev, struct nicvf *nic, + bool cleanup); static inline int nicvf_atomic_write_link_status(struct rte_eth_dev *dev, @@ -674,23 +678,29 @@ config_sq_error: } static inline int -nicvf_stop_tx_queue(struct rte_eth_dev *dev, uint16_t qidx) +nicvf_vf_stop_tx_queue(struct rte_eth_dev *dev, struct nicvf *nic, + uint16_t qidx) { struct nicvf_txq *txq; int ret; - if (dev->data->tx_queue_state[qidx] == RTE_ETH_QUEUE_STATE_STOPPED) + assert(qidx < MAX_SND_QUEUES_PER_QS); + + if (dev->data->tx_queue_state[nicvf_netdev_qidx(nic, qidx)] == + RTE_ETH_QUEUE_STATE_STOPPED) return 0; - ret = nicvf_qset_sq_reclaim(nicvf_pmd_priv(dev), qidx); + ret = nicvf_qset_sq_reclaim(nic, qidx); if (ret) - PMD_INIT_LOG(ERR, "Failed to reclaim sq %d %d", qidx, ret); + PMD_INIT_LOG(ERR, "Failed to reclaim sq VF%d %d %d", + nic->vf_id, qidx, ret); - txq = dev->data->tx_queues[qidx]; + txq = dev->data->tx_queues[nicvf_netdev_qidx(nic, qidx)]; nicvf_tx_queue_release_mbufs(txq); nicvf_tx_queue_reset(txq); - dev->data->tx_queue_state[qidx] = RTE_ETH_QUEUE_STATE_STOPPED; + dev->data->tx_queue_state[nicvf_netdev_qidx(nic, qidx)] = + RTE_ETH_QUEUE_STATE_STOPPED; return ret; } @@ -1002,30 +1012,34 @@ config_rq_error: } static inline int -nicvf_stop_rx_queue(struct rte_eth_dev *dev, uint16_t qidx) +nicvf_vf_stop_rx_queue(struct rte_eth_dev *dev, struct nicvf *nic, + uint16_t qidx) { - struct nicvf *nic = nicvf_pmd_priv(dev); struct nicvf_rxq *rxq; int ret, other_error; - if (dev->data->rx_queue_state[qidx] == RTE_ETH_QUEUE_STATE_STOPPED) + if (dev->data->rx_queue_state[nicvf_netdev_qidx(nic, qidx)] == + RTE_ETH_QUEUE_STATE_STOPPED) return 0; ret = nicvf_qset_rq_reclaim(nic, qidx); if (ret) - PMD_INIT_LOG(ERR, "Failed to reclaim rq %d %d", qidx, ret); + PMD_INIT_LOG(ERR, "Failed to reclaim rq VF%d %d %d", + nic->vf_id, qidx, ret); other_error = ret; - rxq = dev->data->rx_queues[qidx]; + rxq = dev->data->rx_queues[nicvf_netdev_qidx(nic, qidx)]; nicvf_rx_queue_release_mbufs(dev, rxq); nicvf_rx_queue_reset(rxq); ret = nicvf_qset_cq_reclaim(nic, qidx); if (ret) - PMD_INIT_LOG(ERR, "Failed to reclaim cq %d %d", qidx, ret); + PMD_INIT_LOG(ERR, "Failed to reclaim cq VF%d %d %d", + nic->vf_id, qidx, ret); other_error |= ret; - dev->data->rx_queue_state[qidx] = RTE_ETH_QUEUE_STATE_STOPPED; + dev->data->rx_queue_state[nicvf_netdev_qidx(nic, qidx)] = + RTE_ETH_QUEUE_STATE_STOPPED; return other_error; } @@ -1057,8 +1071,14 @@ static int nicvf_dev_rx_queue_stop(struct rte_eth_dev *dev, uint16_t qidx) { int ret; + struct nicvf *nic = nicvf_pmd_priv(dev); - ret = nicvf_stop_rx_queue(dev, qidx); + if (qidx >= MAX_SND_QUEUES_PER_QS) + nic = nic->snicvf[(qidx / MAX_SND_QUEUES_PER_QS - 1)]; + + qidx = qidx % MAX_RCV_QUEUES_PER_QS; + + ret = nicvf_vf_stop_rx_queue(dev, nic, qidx); ret |= nicvf_configure_cpi(dev); ret |= nicvf_configure_rss_reta(dev); return ret; @@ -1073,7 +1093,14 @@ nicvf_dev_tx_queue_start(struct rte_eth_dev *dev, uint16_t qidx) static int nicvf_dev_tx_queue_stop(struct rte_eth_dev *dev, uint16_t qidx) { - return nicvf_stop_tx_queue(dev, qidx); + struct nicvf *nic = nicvf_pmd_priv(dev); + + if (qidx >= MAX_SND_QUEUES_PER_QS) + nic = nic->snicvf[(qidx / MAX_SND_QUEUES_PER_QS - 1)]; + + qidx = qidx % MAX_SND_QUEUES_PER_QS; + + return nicvf_vf_stop_tx_queue(dev, nic, qidx); } @@ -1449,10 +1476,10 @@ qset_rss_error: nicvf_rss_term(nic); start_txq_error: for (qidx = 0; qidx < dev->data->nb_tx_queues; qidx++) - nicvf_stop_tx_queue(dev, qidx); + nicvf_vf_stop_tx_queue(dev, nic, qidx); start_rxq_error: for (qidx = 0; qidx < dev->data->nb_rx_queues; qidx++) - nicvf_stop_rx_queue(dev, qidx); + nicvf_vf_stop_rx_queue(dev, nic, qidx); qset_rbdr_reclaim: nicvf_qset_rbdr_reclaim(nic, 0); nicvf_rbdr_release_mbufs(dev, nic); @@ -1467,32 +1494,74 @@ qset_reclaim: } static void -nicvf_dev_stop(struct rte_eth_dev *dev) +nicvf_dev_stop_cleanup(struct rte_eth_dev *dev, bool cleanup) { + size_t i; int ret; - uint16_t qidx; struct nicvf *nic = nicvf_pmd_priv(dev); PMD_INIT_FUNC_TRACE(); - /* Let PF make the BGX's RX and TX switches to OFF position */ - nicvf_mbox_shutdown(nic); + /* Teardown secondary vf first */ + for (i = 0; i < nic->sqs_count; i++) { + if (!nic->snicvf[i]) + continue; + + nicvf_vf_stop(dev, nic->snicvf[i], cleanup); + } + + /* Stop the primary VF now */ + nicvf_vf_stop(dev, nic, cleanup); /* Disable loopback */ ret = nicvf_loopback_config(nic, 0); if (ret) PMD_INIT_LOG(ERR, "Failed to disable loopback %d", ret); + /* Reclaim CPI configuration */ + ret = nicvf_mbox_config_cpi(nic, 0); + if (ret) + PMD_INIT_LOG(ERR, "Failed to reclaim CPI config %d", ret); +} + +static void +nicvf_dev_stop(struct rte_eth_dev *dev) +{ + PMD_INIT_FUNC_TRACE(); + + nicvf_dev_stop_cleanup(dev, false); +} + +static void +nicvf_vf_stop(struct rte_eth_dev *dev, struct nicvf *nic, bool cleanup) +{ + int ret; + uint16_t qidx; + uint16_t tx_start, tx_end; + uint16_t rx_start, rx_end; + + PMD_INIT_FUNC_TRACE(); + + if (cleanup) { + /* Let PF make the BGX's RX and TX switches to OFF position */ + nicvf_mbox_shutdown(nic); + } + /* Disable VLAN Strip */ nicvf_vlan_hw_strip(nic, 0); - /* Reclaim sq */ - for (qidx = 0; qidx < dev->data->nb_tx_queues; qidx++) - nicvf_stop_tx_queue(dev, qidx); + /* Get queue ranges for this VF */ + nicvf_tx_range(dev, nic, &tx_start, &tx_end); + + for (qidx = tx_start; qidx <= tx_end; qidx++) + nicvf_vf_stop_tx_queue(dev, nic, qidx % MAX_SND_QUEUES_PER_QS); + + /* Get queue ranges for this VF */ + nicvf_rx_range(dev, nic, &rx_start, &rx_end); /* Reclaim rq */ - for (qidx = 0; qidx < dev->data->nb_rx_queues; qidx++) - nicvf_stop_rx_queue(dev, qidx); + for (qidx = rx_start; qidx <= rx_end; qidx++) + nicvf_vf_stop_rx_queue(dev, nic, qidx % MAX_RCV_QUEUES_PER_QS); /* Reclaim RBDR */ ret = nicvf_qset_rbdr_reclaim(nic, 0); @@ -1503,15 +1572,8 @@ nicvf_dev_stop(struct rte_eth_dev *dev) if (nic->rbdr != NULL) nicvf_rbdr_release_mbufs(dev, nic); - /* Reclaim CPI configuration */ - if (!nic->sqs_mode) { - ret = nicvf_mbox_config_cpi(nic, 0); - if (ret) - PMD_INIT_LOG(ERR, "Failed to reclaim CPI config"); - } - /* Disable qset */ - ret = nicvf_qset_config(nic); + ret = nicvf_qset_reclaim(nic); if (ret) PMD_INIT_LOG(ERR, "Failed to disable qset %d", ret); @@ -1528,10 +1590,20 @@ nicvf_dev_stop(struct rte_eth_dev *dev) static void nicvf_dev_close(struct rte_eth_dev *dev) { + size_t i; + struct nicvf *nic = nicvf_pmd_priv(dev); + PMD_INIT_FUNC_TRACE(); - nicvf_dev_stop(dev); + nicvf_dev_stop_cleanup(dev, true); nicvf_periodic_alarm_stop(nicvf_interrupt, dev); + + for (i = 0; i < nic->sqs_count; i++) { + if (!nic->snicvf[i]) + continue; + + nicvf_periodic_alarm_stop(nicvf_vf_interrupt, nic->snicvf[i]); + } } static int -- 1.9.1