From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0069.outbound.protection.outlook.com [104.47.1.69]) by dpdk.org (Postfix) with ESMTP id 29A141AEE9 for ; Sat, 7 Oct 2017 00:50:22 +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=DZsPeNPfYIIkFJUXe/HnXnz9TcjLwtJwrxKrGsxAcPY=; b=JEWLUwuoqwxG+eA6l0zfcZVIEeTKD7WoZVNnvkcBAZoJ3XiDd51qRilaGTjgLGaqq/g0jh8+BvrsYk4I2M+FAOUzxAPxYrODBVX9GeAB40bl7pA4AA7+y6yLGpdk7DbdbuxiP+xRgJlL0VRiiBsKHOxKmuNt2+Z8xc0g6jEVAlY= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=yskoh@mellanox.com; Received: from yongseok-MBP.local (209.116.155.178) by DB6PR0501MB2039.eurprd05.prod.outlook.com (2603:10a6:4:6::21) 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:50:19 +0000 Date: Fri, 6 Oct 2017 15:50:06 -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: <20171006225005.GA20117@yongseok-MBP.local> References: <20171006045956.GF19330@yongseok-MBP.local> <20171006070325.GI15330@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: <20171006070325.GI15330@autoinstall.dev.6wind.com> User-Agent: Mutt/1.7.2 (2016-11-26) X-Originating-IP: [209.116.155.178] X-ClientProxiedBy: MWHPR02CA0030.namprd02.prod.outlook.com (2603:10b6:301:60::19) To DB6PR0501MB2039.eurprd05.prod.outlook.com (2603:10a6:4:6::21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ca79add6-2fed-492b-093a-08d50d0c9f6b X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(48565401081)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:DB6PR0501MB2039; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0501MB2039; 3:Kgx3+AzbpKR61Q2qwnndPSfXxH3jkk61Vtkmrfa0x6Qmrusc38Pzmc8zYn2vPogD15XdUgwJGe1rIy4qlVxwMnnauSIPNnN0BP/VgMnh/YYQesjNIWMr+vFkalV/508hOoMRk219Obpjnzd0VKHtK0Bciv46OSFFeuFZlbbcOkIxgTVCxvuFc1RMHHdPLZkuGRQxHKK2oGybBmpIACli2hk4/AFjVyq93MpQNUIgjNarkVZAWPcUkMIJI1ii5p5t; 25:7r8ZFYYODbsDNFHWoehF55IMJ90IVAcTCePMuG/2es6RjYn+zzvOUOZVhDBhsIEaondrhNC7sOWK4u6tRQ2+8F8w2hSwHkKgYJT4gPsih0SjsksiSXVXsjYgL2LT5Zr1QB083hIFIBDi2SSxlTKVNTMpBEw/xsOQduqGX3VMRTGpW9EG2PVuLX2B9/68qiX1Qum5jCtbshm64ykdMG7S+zS1+cZ261WRBm3DqP5AMhj0GPAsCeoTgrzAuvZTNyfBHwENcWNZfy/+Aiu2rOqSjq7erRXmbH+XQR/fDPQRqpx/zqYrlPzQWayWDV4dWuAZTgEz+YF/bAlbSP8h+TnUpg==; 31:7zKS01vJNkZg1fid0gdapZ8OTI6lBeVooAmF+ciqIF155wbqm8iqe+CQSgy6z0JJg1sHgVM1qAI6H/xASLjPqZHutjuDHEN8993Xfr6mK4Y1ezB5UwY51eFmKThuR3xZR9YYlQtTBJIYP5N3Ey3kNVi6nNJ/a6MYcWy9KxAPwoTsXB9VAREyjOPQL8E2qXnt/WJBu6SYwwhj/L3SSaGcSSl30vnkqW8jRaaURFtMRbA= X-MS-TrafficTypeDiagnostic: DB6PR0501MB2039: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; DB6PR0501MB2039; 20:Z2tK0o+DYMZhxI299atz/g/vyMr11SWRO6fu/eUIYTbKqn22K4nNmUqgvWSpjZ9kMkhhZg2aYir8L9tjC4hBSAnHwfM8suhVD5kXQUwUZ/h4yPSdRze6M6PKD6HMDhJsn+kPk8pam8cJ3eE7fOjL0OvkFoogg8mAaKHm8mVPVNBFZ3/yIBiX+Iw52aC29DunBfI+b/6l6pUAHB8axfr4XcBH85Mwjmc60Untt3VfTw10bXPAqmgbqp6zOIvFIwnocODAQ9VslVvE+DfBOUE1FaMbS1BNQGhFQ2wTpkOBS6CzAazxi49h1VkJO2TL7N2Gmtoly93G8GMsZEjEkKl6dwf0MP0pK0g1a8xl8pWeDpYAXeQUcARSfKDzWs8G6jhNEjKNPOhEU2QgoZnte+u5psN1wGuYLI1/SVK9h8yL0YGEvSxPWc1g4XId2M/4M1+YdJyzqV/aOdr8T4HGwvt2iOwz6Sb7bnJioHOE7JD2J9XQc1/RdtSDPmsnUduIPTnF; 4:kkLH5TSLQCRN4AwqWr8e7LSEEZYmJ4Hs42myO4dF5iMCYgQqTBYJsg1bIEQ1zWWaDM6o+cZhKtiJLAEWJvsvBZlxWPtWFwf7B4BDkZLz3r6TFhHB7/Q0gyxdKYHTtrr9yvr7Mw9Fe0nRqQm3rLHKCHGeguJD7rN2GXeYnvBan/WuGFO8Ddr7t64TG0/DVG7Ts1Afqo002gK4EtHGKyl7nhZYCMHq55MnEkqCQYqcWuWiwUbeLZsQxKzJW3I2cpF7 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)(93006095)(93001095)(10201501046)(3002001)(100000703101)(100105400095)(6055026)(6041248)(20161123564025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123558100)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DB6PR0501MB2039; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DB6PR0501MB2039; X-Forefront-PRVS: 0452022BE1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(346002)(376002)(199003)(24454002)(189002)(83506001)(25786009)(4326008)(2950100002)(6916009)(105586002)(106356001)(229853002)(189998001)(81156014)(8676002)(6246003)(81166006)(86362001)(8936002)(68736007)(66066001)(47776003)(16526018)(316002)(53936002)(50466002)(1076002)(93886005)(5660300001)(76176999)(23756003)(3846002)(50986999)(2906002)(2870700001)(6116002)(54356999)(98436002)(7736002)(6506006)(55016002)(101416001)(9686003)(478600001)(58126008)(97736004)(305945005)(6666003)(33656002)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0501MB2039; 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; DB6PR0501MB2039; 23:mG5IF6hBFIcaBqRUJibY8tCeIGC2NVrUi2gQK?= =?iso-8859-1?Q?wXtjAPXE6T9m5EJCWvcNaXLqZox+M0Dn7KgmY+M/4UGdU5NeFxfCdYBgae?= =?iso-8859-1?Q?vsS5/R+ctxwKyK3DHmsDl5UdvkSsn0WQ6yjtOmuMG5ONSXp+EYznG7qKF8?= =?iso-8859-1?Q?E68hv7GRSjkf41ht/Um7ylT5SzzatpP0fypuuBQFWiG8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LMqhNKCuSmGiLStRz8wQIhSK7iyk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Oct 2017 22:50:19.8466 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0501MB2039 Subject: Re: [dpdk-dev] [PATCH v2 15/30] net/mlx5: add Hash Rx queue object 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:50:23 -0000 On Fri, Oct 06, 2017 at 09:03:25AM +0200, Nélio Laranjeiro wrote: > On Thu, Oct 05, 2017 at 09:59:58PM -0700, Yongseok Koh wrote: > > On Thu, Oct 05, 2017 at 02:49:47PM +0200, Nelio Laranjeiro wrote: > > [...] > > > +struct mlx5_hrxq* > > > +mlx5_priv_hrxq_get(struct priv *priv, uint8_t *rss_key, uint8_t rss_key_len, > > > + uint64_t hash_fields, uint16_t queues[], uint16_t queues_n) > > > +{ > > > + struct mlx5_hrxq *hrxq; > > > + > > > + LIST_FOREACH(hrxq, &priv->hrxqs, next) { > > > + struct mlx5_ind_table_ibv *ind_tbl; > > > + > > > + if (hrxq->rss_key_len != rss_key_len) > > > + continue; > > > + if (memcmp(hrxq->rss_key, rss_key, rss_key_len)) > > > + continue; > > > + if (hrxq->hash_fields != hash_fields) > > > + continue; > > > + ind_tbl = mlx5_priv_ind_table_ibv_get(priv, queues, queues_n); > > > + if (!ind_tbl) > > > + continue; > > > + if (ind_tbl != hrxq->ind_table) { > > > + mlx5_priv_ind_table_ibv_release(priv, ind_tbl); > > > > As one hrxq can have only one ind_tbl, it looks unnecessary to increment refcnt > > of ind_tbl. As long as a hrxq exist, its ind_tbl can't be destroyed. So, it's > > safe. How about moving up this _release() outside of this if-clause and remove > > _release() in _hrxq_release()? > > This is right, but in the other side, an indirection table can be used > by several hash rx queues, that is the main reason why they have their > own reference counter. > > > +-------+ +-------+ > | Hrxq | | Hrxq | > | r = 1 | | r = 1 | > +-------+ +-------+ > | | > v v > +-------------------+ > | indirection table | > | r = 2 | > +-------------------+ > > Seems logical to make the Indirection table counter evolve the same way > as the hash rx queue, otherwise a second hash rx queue using this > indirection may release it whereas it is still in use by another hash rx > queue. Whenever a hash Rx queue is created, it gets to have a ind_tbl either by mlx5_priv_ind_table_ibv_get() or by mlx5_priv_ind_table_ibv_new(). So, the refcnt of the ind_tbl is already increased. So, even if other hash RxQ which have had the ind_tbl releases it, it is safe. That's why I don't think ind_tbl->refcnt needs to get increased on calling mlx5_priv_hrxq_get(). Makes sense? Thanks, Yongseok