From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00081.outbound.protection.outlook.com [40.107.0.81]) by dpdk.org (Postfix) with ESMTP id 7FFA01AEE9 for ; Sat, 7 Oct 2017 00:57:34 +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=sQzl56TOvf4NdxKT72jr61O3Am1PxHDuCMHKVxpetIw=; b=hhu9C8W3/5AdeAt7BS9MYVpRCitsIOQ1iaj+ia/DpM2X6xGlAV1HX5/mfe0Rhs0NiirtsPoiGZUwOooQXsmlgv0WPA7MEoTHbVR3IP3XlkzUBw+nVigIZClfRwsYa4ZHnYT93M3xy00CsfqdR8ols03Xa1gjfhUPS1ASJFkYaN4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=yskoh@mellanox.com; Received: from yongseok-MBP.local (209.116.155.178) by DB6PR0501MB2037.eurprd05.prod.outlook.com (2603:10a6:4:6::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 22:57:32 +0000 Date: Fri, 6 Oct 2017 15:57:08 -0700 From: Yongseok Koh To: =?iso-8859-1?Q?N=E9lio?= Laranjeiro Cc: dev@dpdk.org, adrien.mazarguil@6wind.com, ferruh.yigit@intel.com Message-ID: <20171006225708.GB20117@yongseok-MBP.local> References: <473a992610787eb996537bf2384cc314561f45f8.1507207731.git.nelio.laranjeiro@6wind.com> <20171006032637.GA19330@yongseok-MBP.local> <20171006085238.GP15330@autoinstall.dev.6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20171006085238.GP15330@autoinstall.dev.6wind.com> User-Agent: Mutt/1.7.2 (2016-11-26) X-Originating-IP: [209.116.155.178] X-ClientProxiedBy: MWHPR22CA0035.namprd22.prod.outlook.com (2603:10b6:300:69::21) To DB6PR0501MB2037.eurprd05.prod.outlook.com (2603:10a6:4:6::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 15683592-8ce3-4e46-4b96-08d50d0da115 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(48565401081)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:DB6PR0501MB2037; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0501MB2037; 3:/9+nAG5BDCPVcY7wVIsZ7OVMY760vcjACrlIS/i873BEizFqEGYw085/sYNeHGy+SOxmu319XDOGAJ/ZvSAMNO8LIcbRkJgVRzyGHe2EZMCioiRfWqnCVxDIcRPr4VR3cotn5mmt/tnFfFInH7CJzJWUbHiuknsKNPVA04eC4Y1ppIp+5LoOAUak3P3nxW6oPRDwzqhncw67dAA8YsnEGt9AReNFp308M2OJ8lKRO8qPd3kjoTUPzubZ/6Fme1s3; 25:lEA61LoiMI9OHX11fz0yy+Zubvm3om0Aq2qGI/4XPDMi93TbgYTgV+3/aQstbva7SONw7MoW/qKoh2xzski+ArkQLvRXo2hIRLHqIOb0D26jlqLl+XtQGPUYVwzpfSkZ9R/HowXZPSi7zEECsm5krwHxiolwGIHH7lhbfhVrMsgH65eJFFgyOJTGjyCbK4h7vZR4B8VbMY/vIxNQadqXrHrTdXcKxvaRmE7hYpNIswR8l+8yZGWIrg5PAB3gSDD1GA0ECFdm23zeJ0yCN16oRnNUYmySY5e/b4MZWC47bKyryD0fyaYGGUDTjtNClpJ0CfK1mrnx94yJ6BVFIRdrOA==; 31:coJ4hjux0ZqyvajXQLflqDwxc00ebXken3pBgVa9IfZfsF9HY7/dHu0Jiw5trlgdEvZOW5WbT/0fXOtn0B77kqW948LkbK4Ta6E73SpJqZ1YAI8R1u/pyd2QpX1xYCIZvwWzHuizVYOz4JrXvvSwZxbM1K3y+cGIN4cGHlxbvgWhm618t/bxmJ+7IwEhckYDv1KyIn5m9a8nW9viLPBrAD07MjY8rFmVpjIMqn+kv6w= X-MS-TrafficTypeDiagnostic: DB6PR0501MB2037: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; DB6PR0501MB2037; 20:zA1vHxCZNpSIswhYOgVa8FtY8QqjiEQWvzWmEmKSxHN6/MhtyhDYSa83+nwbOmTsar2JGRz7IYuZYx3OmCuUl2AHGphWkzQhWDPDybN0HD83xFCj8g1fShPj9IVKDjGPtMoSTRiZpQ73w+YihjGbYsb40K2nhQs4ZRePrOzBimhy7fQ4DQZhbtxR6gjnhZA27Ki/hbYRzQm+haZbSMSNRmVej1Ev4+bG8NFzJrOF8cGDZEDj5f1uuIevKaJ5gH7ZDGqGg8fg4zqHbs+fF2qTWsFyAWHQ2CMpzJt7s4ez27fUv0RizciZPR8jjcQJKiBqp7U2gSopUcQhZJ4Yo0CxGC22BWX9eU27ouOyuOdASCUdeZXT2b3UqWrCAPO/ZwQVgpaluhYlinHH66Hgy4pZ6OYPabrrRU+7vdwwhRVVMQ+A1HdZCZn9UE/5624b/EPyJPay6ddt1v0BDXHAY4mJYZdRLLOt0+KZ2AsaTSM5dy/i2QuMJWhwOxCHYfN1Bxps; 4:X3SWAF2RyV3N6Sy2stWFK62d/IBs+HMTfGzeDYRMs04/lcS3f5Rt9GIULfxAmZmX0KlDszpWbNr2D6lkdchUVLNm5FlFmCSsLIO0kDVoFUrZoklzbLJzjDhtUN5TWLbl5HdS9Y3X2KGatV2iSY6meLLu8MJXXsUlInKSH4dNKSRRMjqT6zfvho1BEAb06qchjBqbdVzsK8l6rxeDhm4YbY6OP9+N3gqEWp4y9L9Ojy+leCFyCsPhV4LieZv/EtM0 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)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(3002001)(6055026)(6041248)(20161123562025)(20161123560025)(20161123558100)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DB6PR0501MB2037; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DB6PR0501MB2037; X-Forefront-PRVS: 0452022BE1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(376002)(346002)(199003)(189002)(24454002)(93886005)(58126008)(189998001)(50466002)(25786009)(2950100002)(47776003)(66066001)(6666003)(68736007)(478600001)(16526018)(6916009)(106356001)(105586002)(6506006)(86362001)(6116002)(3846002)(305945005)(7736002)(9686003)(33656002)(50986999)(76176999)(54356999)(6246003)(1076002)(101416001)(81166006)(81156014)(53936002)(8936002)(8676002)(2870700001)(98436002)(23756003)(4326008)(229853002)(316002)(83506001)(55016002)(2906002)(5660300001)(97736004)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0501MB2037; 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; DB6PR0501MB2037; 23:rqFiJNLhlKVuQTqsoPhU3aswPRKLfEQw2a/7T?= =?iso-8859-1?Q?Y6R+OeN28CCX7yTWMPFSPh+fdZgBpJhBzrg61AoE44PA0yGePe2CKKbtOQ?= =?iso-8859-1?Q?qOrWejFX3EWgREezltNa7tirdtxt+vcNj9XLfePy6dxjVyCEPOytgpZgoj?= =?iso-8859-1?Q?HD4gXWAw+M4eTv1uqemp07P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67g0TsGO/U0uPjodhkCL4Fmi0nQWyCjXX3GzuLnQrPBT7fdd9w6vLqv/ioUb7rf5ZfxwFRX6no= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Oct 2017 22:57:32.1368 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0501MB2037 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 22:57:34 -0000 On Fri, Oct 06, 2017 at 10:52:38AM +0200, Nélio Laranjeiro wrote: > On Thu, Oct 05, 2017 at 08:26:38PM -0700, Yongseok Koh wrote: > > 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. > >[...] > > But on MP can be shared among several queues, (see eth_rx_queue_setup() > and eth_tx_queue_setup()), which means that a queue is not the single > owner of the Memory pool and thus the memory region. > > As the Memory region can be shared among several queues, it is necessary > to increase/decrease the ref count accordingly. Here again, as mr->refcnt is increased when it firstly referenced/created in mlx5_priv_rxq_ibv_new(), I thought it was redundant. If so, priv_mr_release() can also be called once when rxq_ibv is really destroyed. Thanks, Yongseok