From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0050.outbound.protection.outlook.com [104.47.0.50]) by dpdk.org (Postfix) with ESMTP id 2C4501B214 for ; Fri, 6 Oct 2017 05:26:55 +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=h6SdejGa1XhNjDalTXsxs0m93qaTvraCmT8Yo4rUYWQ=; b=tJ1bZum9yWOFVgFLUvcb/Dy3qV99omy7Au0Fp8geihL23OWjN08a510hb83/vfXB53icUycgI7iuQGgexJunjms+3MSUatqDUfo40GFt+fGF2gP+TivqxGJyqnMuIAY7m/mvWm1p/oAR1WUzpGg+5xkfvhu1WpsClgHrhYB0Wdg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=yskoh@mellanox.com; Received: from yongseok-MBP.local (73.222.116.174) by HE1PR0501MB2041.eurprd05.prod.outlook.com (2603:10a6:3:35::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Fri, 6 Oct 2017 03:26:52 +0000 Date: Thu, 5 Oct 2017 20:26:38 -0700 From: Yongseok Koh To: Nelio Laranjeiro Cc: dev@dpdk.org, adrien.mazarguil@6wind.com, ferruh.yigit@intel.com Message-ID: <20171006032637.GA19330@yongseok-MBP.local> References: <473a992610787eb996537bf2384cc314561f45f8.1507207731.git.nelio.laranjeiro@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <473a992610787eb996537bf2384cc314561f45f8.1507207731.git.nelio.laranjeiro@6wind.com> User-Agent: Mutt/1.7.2 (2016-11-26) X-Originating-IP: [73.222.116.174] X-ClientProxiedBy: MWHPR17CA0077.namprd17.prod.outlook.com (2603:10b6:300:c2::15) To HE1PR0501MB2041.eurprd05.prod.outlook.com (2603:10a6:3:35::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: debfca97-b35d-4be4-84aa-08d50c6a172f X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(48565401081)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:HE1PR0501MB2041; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0501MB2041; 3:LHHBeKmJ/SxUv3BevbgLccDOlougCOhmfxoz7gv9C/3wZBNTdJbd9iE5oR3nVfCEko1yCBs2eS59O/lPSLf5iNcsomVcQz45mbjU4uLFKMPK8jkOyOY64gW4rXdvCbXo+LcjSXiIM8adBcAI8MhACGfyV5u+WIC58gBbNBaPGtaV1o4qwmYUxTTMa4fJOzykJRF4snaajkfXfbRxxZsOFNodQXBZ0s5l9cbZFA0Gon7V7GSNdefqp4BZ+d20PdUm; 25:6eHoOjO0Q1M086k0oXcUHSoyZ95jh/WJJcDLmvwfWUdKFEPdLF2izv936zO/E3Nn2KVgnD8mkP1IG4Yemv8lppBo/OV/YfoJUvP3Nr9uj4e9XX3ArEz17JMCVF4ITC9MEklJGyANNreiBzNmN4ANR2NcY6lbxJq32FM+AA8D4IumPeVDy+wM2g1/ttEMkFU4c9FZxqyU/zNzxhpjdeMjpA4WxTEAYTSxfnH10uvzgsZDfdvHZ5czUzz2xrWiiGr1qOX6QCCse/M0J37aRKAsJmSOOhAA0qvmMdUdHwypOSghGqG8HZc2YGLlRx3cfz++q6XsPuL+oiPjjyNo/AS2Mg==; 31:qRFmvzYLUn5B1D2K4JAEyFb0/POA9ia+lb7YBskXbZq8zDQblhdA7d3xuyvK22d5yS9fU0FoJ2ONDQEo41DOcLJeJVW9t1sushxWW2dsGyO0ya/s8Sq/gtILOTUpOUfbCnPn33q1ARmIYh6m8KzHuUGLqaCiwTOY+iNkglChEx2HhF5GpYiYsLvvaTvE0v/HkJoumFtwg3fPOIcsqLFVfXDp7fkSFfGN1vTJcosLQ90= X-MS-TrafficTypeDiagnostic: HE1PR0501MB2041: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; HE1PR0501MB2041; 20:CResQSvYzkkmLtwZ9GcrP08drUq5ndZvA/BESeEIrePtXsfYyyp2LXFtbTSaG4Avymt0dJov5e65Zwrz8B4MZVp8ziX940/MVZ1ZwjfH+Ul3F1cIHEln46msqzatA8PSXmH6IFr47/iQq0ehdqeKmYaGwir08k42bbnyUujRxAR5PG/vlHyizqlSw5rC266i9B/decUp2gImBqwEYjbmGc8H/2QOaaLKDSBcQ/D5UFsJzp0+nVH/7/wKnyjpX2aOIxw5k0FflvQvZGXspl8A1HJkPN+pSOQU6AEVOSbxcL8rEOYu/2sNferHiCaG5HSC3fEOX1w2PrfG0FaI07psBqa84AhckiEFAutY6X+w6kMh5MFfsqRAWnpoied+6QRlDU3fMraQ/pBPLs5m1RPW2643gNc4wt0DTVArVao+EdakREi4A6DbYNcb+d4C0Aum4H3iP+JG2DjC/uIFfCx0JltoNzx4TDiVmg/WyNdD+klCbHe9YFNd4Pb92hVp/8im; 4:ICO2NawoEYMO3mlUrQH+oCpWku016irONsAnbuoDBfGgYDTIBap+uJLHUdUHdPxK9dP9j3tR8H6t10FvgCQjxpG/Okkxn4xrZ4a20ou+4EgE+cFAPB30Q4G5go+uwvViTJjZ+MwnRnJsk3kyqoJkh2rSxMTBqQr7OtHoTo36J1ACSwnz9LDNoFYHsj7ff1Z3HaOAhyM9mqYX3svjidE6MiFd7cacLn6rXavfzQzE5n8LWfYl4lVyj3c+brGIL6TFil+ER++E8ptqgfvHhbinIyTn2y/ocID0rCK4orreVsI= X-Exchange-Antispam-Report-Test: UriScan:(17755550239193); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(93006095)(93001095)(100000703101)(100105400095)(3002001)(10201501046)(6055026)(6041248)(20161123560025)(20161123562025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:HE1PR0501MB2041; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:HE1PR0501MB2041; X-Forefront-PRVS: 0452022BE1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(39860400002)(376002)(346002)(199003)(24454002)(189002)(3846002)(6116002)(1076002)(105586002)(6666003)(316002)(58126008)(8936002)(68736007)(6246003)(6916009)(55016002)(25786009)(53936002)(23756003)(4326008)(5660300001)(106356001)(47776003)(7736002)(478600001)(305945005)(33656002)(9686003)(2870700001)(2950100002)(50466002)(8676002)(81156014)(6506006)(66066001)(81166006)(229853002)(101416001)(2906002)(83506001)(98436002)(86362001)(54356999)(97736004)(76176999)(50986999)(189998001)(16526018)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0501MB2041; H:yongseok-MBP.local; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?iso-8859-1?Q?1; HE1PR0501MB2041; 23:xYhZ0VNm+0Z2nt8lFxVacKfa1m0eC2vYbcqlL?= =?iso-8859-1?Q?9RVO6K7ENbXfOf/XFcRFLRB0/FTypMuuw+0KCn1LjVxaCpPcR9Gajzx2Nq?= =?iso-8859-1?Q?E1lk+6QbtMqCsN3QKBvUgcaGzdWBWTwW7bHrBGrfzhUjmhZJYYGIlZd5R1?= =?iso-8859-1?Q?ZUf2COdexoQLNZRoDNzU088wHnJQa/H6fj/2g/nNie+b6DZ9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kfrrVxwzuoNuJAedN5bQm4Gx+2jytpHL8EN4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Oct 2017 03:26:52.4880 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0501MB2041 Subject: Re: [dpdk-dev] [PATCH v2 10/30] net/mlx5: separate DPDK from Verbs Rx queue objects 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: Fri, 06 Oct 2017 03:26:55 -0000 On Thu, Oct 05, 2017 at 02:49:42PM +0200, Nelio Laranjeiro wrote: [...] > +struct mlx5_rxq_ibv* > +mlx5_priv_rxq_ibv_get(struct priv *priv, uint16_t idx) > +{ > + struct mlx5_rxq_data *rxq_data = (*priv->rxqs)[idx]; > + struct mlx5_rxq_ctrl *rxq_ctrl; > + > + if (idx >= priv->rxqs_n) > + return NULL; > + if (!rxq_data) > + return NULL; > + rxq_ctrl = container_of(rxq_data, struct mlx5_rxq_ctrl, rxq); > + if (rxq_ctrl->ibv) { > + priv_mr_get(priv, rxq_data->mp); One rxq_ibv has one mr as one rxq has one mp. As long as rxq_ibv exist, the mr can't be released. So, it looks unnecessary to increase refcnt of the mr here. > + rte_atomic32_inc(&rxq_ctrl->ibv->refcnt); > + DEBUG("%p: Verbs Rx queue %p: refcnt %d", (void *)priv, > + (void *)rxq_ctrl->ibv, > + rte_atomic32_read(&rxq_ctrl->ibv->refcnt)); > + } > + return rxq_ctrl->ibv; > +} > + > +/** > + * Release an Rx verbs queue object. > + * > + * @param priv > + * Pointer to private structure. > + * @param rxq_ibv > + * Verbs Rx queue object. > + * > + * @return > + * 0 on success, errno value on failure. > + */ > +int > +mlx5_priv_rxq_ibv_release(struct priv *priv, struct mlx5_rxq_ibv *rxq_ibv) > +{ > + int ret; > + > + assert(rxq_ibv); > + assert(rxq_ibv->wq); > + assert(rxq_ibv->cq); > + assert(rxq_ibv->mr); > + ret = priv_mr_release(priv, rxq_ibv->mr); Like I mentioned above, this can be moved inside the following destruction part. As current code is logically flawless, Acked-by: Yongseok Koh   Thanks