From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50063.outbound.protection.outlook.com [40.107.5.63]) by dpdk.org (Postfix) with ESMTP id 74E082A62 for ; Thu, 3 May 2018 01:17:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=BRYpo1GKQTftzuETc7cUcAGy9J560CuIIn3hq2bu9hU=; b=o3IvgR2MSD+8OtGiWoUapWOhb9CF6ClyOVFBCx71KE3NOEL1A3hn0+yuk+7GEA6eEG8XJKzfTbIuMlXhSFo2SzrJOoWF7ydE916kuDlSUDWWNT2qZVXuPuSRBU3+8AD73imSlu77aBzkC/o1yNN3fRJqu4OGGndF+YyUuKueUuM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=yskoh@mellanox.com; Received: from mellanox.com (209.116.155.178) by VI1PR0501MB2048.eurprd05.prod.outlook.com (2603:10a6:800:36::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.715.20; Wed, 2 May 2018 23:17:10 +0000 From: Yongseok Koh To: adrien.mazarguil@6wind.com, nelio.laranjeiro@6wind.com Cc: dev@dpdk.org, Yongseok Koh Date: Wed, 2 May 2018 16:16:50 -0700 Message-Id: <20180502231654.7596-2-yskoh@mellanox.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180502231654.7596-1-yskoh@mellanox.com> References: <20180502231654.7596-1-yskoh@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [209.116.155.178] X-ClientProxiedBy: BYAPR03CA0026.namprd03.prod.outlook.com (2603:10b6:a02:a8::39) To VI1PR0501MB2048.eurprd05.prod.outlook.com (2603:10a6:800:36::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(48565401081)(2017052603328)(7153060)(7193020); SRVR:VI1PR0501MB2048; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0501MB2048; 3:0leeCXf5CbVgtP0ykXGs+iJWrJs+9tH6f9qWfzEceef/qNV5uhlU2zwaVvMwAyfNfwp1nV0OGVJN6jrvJ9012MO8kZAMewLgTshtKEApK1tLQb4x8ParszjG4gqzxLyGpgLqBIH3TqYsRWj8TnAbYGGNLsZEX14r2SXtbWtBuYnPQ3XHAXzbW228ZHZQ51Dxwqz6XGPxmmF+f+0yhxJwns4LeTQYjD1oAiW2bEhX610jRFjtqy0+kgErUC+hrsI5; 25:cWsxwh+JCsk2HWDkoSqE6xw1cW0+e1k8ozLZk06MW0X+kUqapfGsLEK+xdtayjfWfDEBSqNI7mHZY6i0zebsgsTKX8XaASjCfDRPwbbApCcdi/O4YcowtfHZ4vNduPDEfidtXf0p1nUDhRsY8OiSOLC0gaYhCzG1xKVtr08onsO4oierYFQ5g7Hx6u9k5Heo7KHI5I+tn9vaRgAWsagma0+JCZ1XM6CHZ/zNZzSn2RVt1Xki1ruBUY9HTERt8A/16IRGbLGyec5y3MnpDr0tMZ20W+E8wM2501shkRrtOIgVg4R7z1Z/x0NIYJDQPgzPIrvl8NypxEETjJectnoQ+A==; 31:gJIcqp3Z1L+o06t3Zcc6hyDxg8MT8pbYe/MpD6iCGu4QkRgfD0x+1HTN+toOg5u0VTWniSURT73oH7JqnqkgOeYepEQk9DzJTzOi76ZkvVYtftpVWVq3Ibp+PtfbodOINd4s9YmC+JBHXdQ6ffBXxlNVf9zUzQjKpDut+k4OKkJc7TR18dWgeeQaA5gkCRrjhGxuAaftN6NwBvE1uOHaA7g4GJDxXZo39t0F/W23rrQ= X-MS-TrafficTypeDiagnostic: VI1PR0501MB2048: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; VI1PR0501MB2048; 20:OXMvPF7eT/1sBEgjEp5yeELN25tX+vqh7cOF4waW2zUDnayXFvTTrpUWd5EqwUI8xaI250vTDWKNg4ovVzu5V2HdoIj+iO+x1i2Hi6zUC6thYG/fwEdOGVaaf7otUJLr0frv5BrpsRGmcI6m9KuFoPrxZos8Nx38x0Q+sxp5fTTJQtVLrcLygzgDuvZSbu/bhnQvodW1kx9suJ/ABUsgCn/eG11uHTiHJtrdvvP5RpJxoxZz8rT+y5Z4jiAkoaGILTbWnoj6Wi+4TxKvqokUI4dXcS0iyCpZbqeim4tvPXN0QOFwy/zyv405MJMtlSpAAyHYDTF41/Fk56UamW6TUNI+4BJXsntjP3Kr9lWM1K0/y2MZALnRxbyRx6HkGZllF9ilkCvxc0wFXVhmY0sT10vZ9IXyFI3x9mCnxl/DaqKqmMx53ov5fmdVNClFC+CoN+t+8a1elDOP+Q7uwA41E2RKWpetUs/7YnSB0fNAHKrYduO+YA1bxrJ04AIeJySZ; 4:V/tD8vBGWLJ13gE0OLNE/YHiKqxs83M01+Xfjght9dxejSu0x43mdhO/U51A3WjIf/Au54/QGX0+9ZRB07BPD1webtIgxsmKgc4pEjf8H4cnj7y6gXHt7vup5JJkN5BfZb7JtmuTJv0/ICYpsyIRxk4WqVI8hqk0pEToEIjiHgR1Pf3nfPkV8YzHVcQjyoD0A9t/DoEgM2DAbTuYTp321jYvfXAf3FK90fNlWwa1jd/05wnU9IZ1q8MMu2tzCe3DbAWqwwZrS9hNV/BOhxqwAg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3002001)(3231254)(944501410)(52105095)(6055026)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123560045)(20161123564045)(6072148)(201708071742011); SRVR:VI1PR0501MB2048; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0501MB2048; X-Forefront-PRVS: 06607E485E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(366004)(39860400002)(376002)(396003)(39380400002)(189003)(199004)(6116002)(81156014)(8676002)(81166006)(3846002)(6666003)(50466002)(1076002)(50226002)(16586007)(8936002)(25786009)(2906002)(478600001)(68736007)(97736004)(106356001)(21086003)(47776003)(5660300001)(69596002)(316002)(53936002)(15650500001)(66066001)(305945005)(76176011)(36756003)(105586002)(16526019)(107886003)(51416003)(26005)(4326008)(52116002)(7696005)(7736002)(48376002)(486006)(186003)(2616005)(86362001)(575784001)(446003)(55016002)(956004)(476003)(11346002)(386003)(59450400001); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0501MB2048; H:mellanox.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR0501MB2048; 23:aWlz9gEm2Ca+aooFDcgwXjm/tNoSHqkmGO78CHB?= =?us-ascii?Q?rSAivwhTHeyFInZOssIV0WqMjUwomguabwWHamkPo4lmLOKLeeLcsN/jN3Z3?= =?us-ascii?Q?KwqmXdjL4dfO8tM7nHwpkMGza7Q6f61RFWNWHTWhw8WIkbLfvxnDze32CRBf?= =?us-ascii?Q?PLnkl6K7ZoDefREf2zbjwFZGWgEKami1QkcHnxF+0fPnWrT2rJwBy4jhvup6?= =?us-ascii?Q?OrPjE1nxk3emXGrwTPD+QL20FsI/5HUC0ljBjTppX2jWQKR6txb577+jhaV8?= =?us-ascii?Q?mHX6bVUk60UvihNqdOmLnVzuj8KIl4gzO9okQfMmrXHRHnIH7jzvO3ACOJbI?= =?us-ascii?Q?a2P5omtDoga1jxUgMj9YSsKu12yyEVEktoPKP+e0op8SAwGr9NTivQwXPF4s?= =?us-ascii?Q?MqvwNNr81+UfJoxrwvUE4PzKkEs6LJjl07itH+Z4NpG/cLUL0ikfRpI6pSgi?= =?us-ascii?Q?RRqm5FpuZ4maDyAdTZkJg814Ix4EAt7ThHocTHcT8VM8c4AgvfbS+X2kKDW2?= =?us-ascii?Q?P2XYYXIXq+ssUN3Hi9r2BMi0sS/R+a0FNfzimyAiVunzephEn9kURUOrJ3zL?= =?us-ascii?Q?zLXmNo1HfWegBR7ipszIhOTkjHPQj2vPZCM9f2rDmpWUKq+0+MkucIhrDHdf?= =?us-ascii?Q?NLXFbuBJdL4HZxGjwVbWVPtQn/z4aDZMZRQfVZy7tET/yHNtC/xGGVaINfZY?= =?us-ascii?Q?mZ7c7g+FCnyW09Dfimy8HqcSrOH/pZrTIPRgR4B1BBrOUYGNTsikxOBdas9U?= =?us-ascii?Q?G8MFNloEkQ19exhfGmLlDaX5sjmR3BIMsi6hEvuQyqAYcLO1WBQ7sYlqFIfh?= =?us-ascii?Q?NLTvzPNVHj8uLQ4SSnIN7LXjtTo4f4ZXFlscxaa/GmrfAdrEKmprlFxdAZzs?= =?us-ascii?Q?g+bMgy7JQuZALK2B+a+EXdr8X4VPMO8aWFFanU+WmLiHoZ/+SNixwvJEo+T+?= =?us-ascii?Q?KBEhPAAaofEoOk8twaJqf9ryaDFgypAZHeEC6E+WLpJkoh3qjsm3Tc7xvAHN?= =?us-ascii?Q?mIHpFXEYvXR/uoPecZ/AL+YvJXFixr/mjr7WuHOci9zzLN1Def2G+EPrCRi5?= =?us-ascii?Q?MsqPWoLfdgfaOP66uiRIBsx+6TL/6s3UjTEYWGj1OqkmtDtHUf7kNwY7tnb2?= =?us-ascii?Q?aae8ha74P7WywjLOARCx744/noxi+l7SPjjOdQi87zf1ui2mNzHKYDayXpLr?= =?us-ascii?Q?/+mk/qhWBTQV5gk+1/d3PSSPl7yXn0nwG98dHdWOnZhs9M2U3jI6TxORm/dn?= =?us-ascii?Q?Lq9dZrGVzD3DXz4641dnv5VLMSfO9aEysQguG9TGcScHmFd30HGMr23R3KCA?= =?us-ascii?Q?RDoAmcFfEr9C+FX6AgeKprBI=3D?= X-Microsoft-Antispam-Message-Info: FCrVmXu4R2M5QNHEqBPnEUkOCAo80MksHn23tI+FV61zVs7Q89hrjj/Mi4dY0apLiESV8uTwFajSwDNcuCVCs+9oy6kx5s8P1g8Yl1bAgpTSfwZZxEoYjCISdpV1LT91AeLwquK5zaryoMJ4ofP4tmYE7QMKfIbmmGv9z7c6jaX4Okln+QUbkLNoKD/54sDz X-Microsoft-Exchange-Diagnostics: 1; VI1PR0501MB2048; 6:8gpqijV8jCFi8VErkeob87Folo2p20PpJh3IQuMIAZkTtBFe2QEFxMCi+OM5WZRiBO8o7baQjnf+1BNK6TdK8YjguHpeIs/qaYdvkYNMHE+gWwiJV84/ynLSWvsRay3wnakqvnaSO08r6hnHE+oXK1eaJ2VH3wn9MPw1faCfVFKhb1g4qBrOvWKBWEzGiVbUPSdTUaRd1YOTF9up/3y1aP/cfheSlUaX+z9JUnNO1VqOG//phFX4RFDWE4z9y59VL1drvz0JA1kwQ30SUVHLdr5jAZCKgkxw2iZRB++wIf/MCmy3u+lPzhHoXUczmuFHppEUVdoENxib8SPGelyMC08ak73s4sA9bogFB4zDBc/4lFIJZtKv4Dwu5KjxEn65yXglmeMMX6ijSkyWnI7GwV4WV1vonhxqoGh17vujzcaSVK0RFtIrs83ZD0yfI5bpK/vWOIm7ymYFPj0omLV8FQ==; 5:y6pP5p0jqir/Jx9ppDYjtG+EjKkPr3RMWEpi7oRZwRgRo8MTQJ/6BDo5xk0ev6w8O33u0GuGVGPgs+5a0DL1kroiiO0eNjvuS0w3PjG79OUhO+iJ85E0d5g2jxgKLosA7FsHHb+xPcJRV0/DeURk+v4Z5QyTSANXtM7CFb75Q+w=; 24:InchpUVBNVev1swSf/AqEB+G4wy1TPq5Rbh4AGpMFcHIde9Gsyvzwd28ya7JrEKkHRC8lYEZOUtpUsZNjVewy64r6dvYLFiTm5N5IDLmjHQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR0501MB2048; 7:9AQxWNkXrLMLnv9HbmQqGCgQj0a7J31DJ7KMzhyNAo8xqn2uFdRkc5dNom7LfoLT4Ww5zWXwUqwyl5idqpESnLFD1EOlzUsA2SX5NjWhtzyPCOZLMAsOSemH4Z+yB12CGmxHihGDmNx+K1ux/RQOUQVm8de39vf8sW4loXM4QiWXlpdfPhvZmSFImZRblQEHAQYdqQDc2nF2cITX7uSp3UhIIFSO5Ta0VyLx5AKvWaoKfuCgHZlvRNhKbYWStPPF X-MS-Office365-Filtering-Correlation-Id: 5c15f8fb-8755-460f-1eda-08d5b082d52f X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 May 2018 23:17:10.1821 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5c15f8fb-8755-460f-1eda-08d5b082d52f X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0501MB2048 Subject: [dpdk-dev] [PATCH 1/5] net/mlx5: trim debug messages for reference counters 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: Wed, 02 May 2018 23:17:14 -0000 Remove debug messages when getting an object. When releasing an object, debug message will be printed only if the object is really freed. Signed-off-by: Yongseok Koh --- drivers/net/mlx5/mlx5_mr.c | 7 ++----- drivers/net/mlx5/mlx5_rxq.c | 36 +++++++++++++----------------------- drivers/net/mlx5/mlx5_txq.c | 21 ++++++++------------- 3 files changed, 23 insertions(+), 41 deletions(-) diff --git a/drivers/net/mlx5/mlx5_mr.c b/drivers/net/mlx5/mlx5_mr.c index 7a337d0c3..6613bd6b9 100644 --- a/drivers/net/mlx5/mlx5_mr.c +++ b/drivers/net/mlx5/mlx5_mr.c @@ -308,9 +308,6 @@ mlx5_mr_get(struct rte_eth_dev *dev, struct rte_mempool *mp) LIST_FOREACH(mr, &priv->mr, next) { if (mr->mp == mp) { rte_atomic32_inc(&mr->refcnt); - DRV_LOG(DEBUG, "port %u memory region %p refcnt: %d", - dev->data->port_id, (void *)mr, - rte_atomic32_read(&mr->refcnt)); return mr; } } @@ -330,9 +327,9 @@ int mlx5_mr_release(struct mlx5_mr *mr) { assert(mr); - DRV_LOG(DEBUG, "memory region %p refcnt: %d", (void *)mr, - rte_atomic32_read(&mr->refcnt)); if (rte_atomic32_dec_and_test(&mr->refcnt)) { + DRV_LOG(DEBUG, "memory region %p refcnt: %d", (void *)mr, + rte_atomic32_read(&mr->refcnt)); claim_zero(mlx5_glue->dereg_mr(mr->mr)); LIST_REMOVE(mr, next); rte_free(mr); diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c index a85b628fe..d993e3846 100644 --- a/drivers/net/mlx5/mlx5_rxq.c +++ b/drivers/net/mlx5/mlx5_rxq.c @@ -868,9 +868,6 @@ mlx5_rxq_ibv_get(struct rte_eth_dev *dev, uint16_t idx) if (rxq_ctrl->ibv) { mlx5_mr_get(dev, rxq_data->mp); rte_atomic32_inc(&rxq_ctrl->ibv->refcnt); - DRV_LOG(DEBUG, "port %u Verbs Rx queue %u: refcnt %d", - dev->data->port_id, rxq_ctrl->idx, - rte_atomic32_read(&rxq_ctrl->ibv->refcnt)); } return rxq_ctrl->ibv; } @@ -896,10 +893,11 @@ mlx5_rxq_ibv_release(struct mlx5_rxq_ibv *rxq_ibv) ret = mlx5_mr_release(rxq_ibv->mr); if (!ret) rxq_ibv->mr = NULL; - DRV_LOG(DEBUG, "port %u Verbs Rx queue %u: refcnt %d", - port_id(rxq_ibv->rxq_ctrl->priv), - rxq_ibv->rxq_ctrl->idx, rte_atomic32_read(&rxq_ibv->refcnt)); if (rte_atomic32_dec_and_test(&rxq_ibv->refcnt)) { + DRV_LOG(DEBUG, "port %u Verbs Rx queue %u: refcnt %d", + port_id(rxq_ibv->rxq_ctrl->priv), + rxq_ibv->rxq_ctrl->idx, + rte_atomic32_read(&rxq_ibv->refcnt)); rxq_free_elts(rxq_ibv->rxq_ctrl); claim_zero(mlx5_glue->destroy_wq(rxq_ibv->wq)); claim_zero(mlx5_glue->destroy_cq(rxq_ibv->cq)); @@ -1111,9 +1109,6 @@ mlx5_rxq_get(struct rte_eth_dev *dev, uint16_t idx) rxq); mlx5_rxq_ibv_get(dev, idx); rte_atomic32_inc(&rxq_ctrl->refcnt); - DRV_LOG(DEBUG, "port %u Rx queue %u: refcnt %d", - dev->data->port_id, rxq_ctrl->idx, - rte_atomic32_read(&rxq_ctrl->refcnt)); } return rxq_ctrl; } @@ -1141,9 +1136,10 @@ mlx5_rxq_release(struct rte_eth_dev *dev, uint16_t idx) assert(rxq_ctrl->priv); if (rxq_ctrl->ibv && !mlx5_rxq_ibv_release(rxq_ctrl->ibv)) rxq_ctrl->ibv = NULL; - DRV_LOG(DEBUG, "port %u Rx queue %u: refcnt %d", dev->data->port_id, - rxq_ctrl->idx, rte_atomic32_read(&rxq_ctrl->refcnt)); if (rte_atomic32_dec_and_test(&rxq_ctrl->refcnt)) { + DRV_LOG(DEBUG, "port %u Rx queue %u: refcnt %d", + dev->data->port_id, rxq_ctrl->idx, + rte_atomic32_read(&rxq_ctrl->refcnt)); LIST_REMOVE(rxq_ctrl, next); rte_free(rxq_ctrl); (*priv->rxqs)[idx] = NULL; @@ -1301,9 +1297,6 @@ mlx5_ind_table_ibv_get(struct rte_eth_dev *dev, const uint16_t *queues, unsigned int i; rte_atomic32_inc(&ind_tbl->refcnt); - DRV_LOG(DEBUG, "port %u indirection table %p: refcnt %d", - dev->data->port_id, (void *)ind_tbl, - rte_atomic32_read(&ind_tbl->refcnt)); for (i = 0; i != ind_tbl->queues_n; ++i) mlx5_rxq_get(dev, ind_tbl->queues[i]); } @@ -1327,9 +1320,6 @@ mlx5_ind_table_ibv_release(struct rte_eth_dev *dev, { unsigned int i; - DRV_LOG(DEBUG, "port %u indirection table %p: refcnt %d", - ((struct priv *)dev->data->dev_private)->port, - (void *)ind_tbl, rte_atomic32_read(&ind_tbl->refcnt)); if (rte_atomic32_dec_and_test(&ind_tbl->refcnt)) { claim_zero(mlx5_glue->destroy_rwq_ind_table (ind_tbl->ind_table)); @@ -1339,6 +1329,9 @@ mlx5_ind_table_ibv_release(struct rte_eth_dev *dev, for (i = 0; i != ind_tbl->queues_n; ++i) claim_nonzero(mlx5_rxq_release(dev, ind_tbl->queues[i])); if (!rte_atomic32_read(&ind_tbl->refcnt)) { + DRV_LOG(DEBUG, "port %u indirection table %p: refcnt %d", + ((struct priv *)dev->data->dev_private)->port, + (void *)ind_tbl, rte_atomic32_read(&ind_tbl->refcnt)); LIST_REMOVE(ind_tbl, next); rte_free(ind_tbl); return 0; @@ -1566,9 +1559,6 @@ mlx5_hrxq_get(struct rte_eth_dev *dev, continue; } rte_atomic32_inc(&hrxq->refcnt); - DRV_LOG(DEBUG, "port %u hash Rx queue %p: refcnt %d", - dev->data->port_id, (void *)hrxq, - rte_atomic32_read(&hrxq->refcnt)); return hrxq; } return NULL; @@ -1588,10 +1578,10 @@ mlx5_hrxq_get(struct rte_eth_dev *dev, int mlx5_hrxq_release(struct rte_eth_dev *dev, struct mlx5_hrxq *hrxq) { - DRV_LOG(DEBUG, "port %u hash Rx queue %p: refcnt %d", - ((struct priv *)dev->data->dev_private)->port, - (void *)hrxq, rte_atomic32_read(&hrxq->refcnt)); if (rte_atomic32_dec_and_test(&hrxq->refcnt)) { + DRV_LOG(DEBUG, "port %u hash Rx queue %p: refcnt %d", + ((struct priv *)dev->data->dev_private)->port, + (void *)hrxq, rte_atomic32_read(&hrxq->refcnt)); claim_zero(mlx5_glue->destroy_qp(hrxq->qp)); DEBUG("port %u delete QP %p: hash: 0x%" PRIx64 ", tunnel:" " 0x%x, level: %u", diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c index 29959b4c7..3f4b5fea5 100644 --- a/drivers/net/mlx5/mlx5_txq.c +++ b/drivers/net/mlx5/mlx5_txq.c @@ -595,12 +595,8 @@ mlx5_txq_ibv_get(struct rte_eth_dev *dev, uint16_t idx) if (!(*priv->txqs)[idx]) return NULL; txq_ctrl = container_of((*priv->txqs)[idx], struct mlx5_txq_ctrl, txq); - if (txq_ctrl->ibv) { + if (txq_ctrl->ibv) rte_atomic32_inc(&txq_ctrl->ibv->refcnt); - DRV_LOG(DEBUG, "port %u Verbs Tx queue %u: refcnt %d", - dev->data->port_id, txq_ctrl->idx, - rte_atomic32_read(&txq_ctrl->ibv->refcnt)); - } return txq_ctrl->ibv; } @@ -617,10 +613,11 @@ int mlx5_txq_ibv_release(struct mlx5_txq_ibv *txq_ibv) { assert(txq_ibv); - DRV_LOG(DEBUG, "port %u Verbs Tx queue %u: refcnt %d", - port_id(txq_ibv->txq_ctrl->priv), - txq_ibv->txq_ctrl->idx, rte_atomic32_read(&txq_ibv->refcnt)); if (rte_atomic32_dec_and_test(&txq_ibv->refcnt)) { + DRV_LOG(DEBUG, "port %u Verbs Tx queue %u: refcnt %d", + port_id(txq_ibv->txq_ctrl->priv), + txq_ibv->txq_ctrl->idx, + rte_atomic32_read(&txq_ibv->refcnt)); claim_zero(mlx5_glue->destroy_qp(txq_ibv->qp)); claim_zero(mlx5_glue->destroy_cq(txq_ibv->cq)); LIST_REMOVE(txq_ibv, next); @@ -860,9 +857,6 @@ mlx5_txq_get(struct rte_eth_dev *dev, uint16_t idx) ctrl->txq.mp2mr[i]->mp)); } rte_atomic32_inc(&ctrl->refcnt); - DRV_LOG(DEBUG, "port %u Tx queue %u refcnt %d", - dev->data->port_id, - ctrl->idx, rte_atomic32_read(&ctrl->refcnt)); } return ctrl; } @@ -889,8 +883,6 @@ mlx5_txq_release(struct rte_eth_dev *dev, uint16_t idx) if (!(*priv->txqs)[idx]) return 0; txq = container_of((*priv->txqs)[idx], struct mlx5_txq_ctrl, txq); - DRV_LOG(DEBUG, "port %u Tx queue %u: refcnt %d", dev->data->port_id, - txq->idx, rte_atomic32_read(&txq->refcnt)); if (txq->ibv && !mlx5_txq_ibv_release(txq->ibv)) txq->ibv = NULL; for (i = 0; i != MLX5_PMD_TX_MP_CACHE; ++i) { @@ -903,6 +895,9 @@ mlx5_txq_release(struct rte_eth_dev *dev, uint16_t idx) munmap((void *)RTE_ALIGN_FLOOR((uintptr_t)txq->txq.bf_reg, page_size), page_size); if (rte_atomic32_dec_and_test(&txq->refcnt)) { + DRV_LOG(DEBUG, "port %u Tx queue %u: refcnt %d", + dev->data->port_id, txq->idx, + rte_atomic32_read(&txq->refcnt)); txq_free_elts(txq); LIST_REMOVE(txq, next); rte_free(txq); -- 2.11.0