From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com [74.125.82.51]) by dpdk.org (Postfix) with ESMTP id 483A71B23B for ; Fri, 6 Oct 2017 09:03:37 +0200 (CEST) Received: by mail-wm0-f51.google.com with SMTP id b189so5704676wmd.4 for ; Fri, 06 Oct 2017 00:03:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=Ldde6oJabIXpjnMh/izNXKRPDqJBETR/6Io6KxRvfhc=; b=VwEgbmOePJLrKGRsg61jY9jw0K3E5BvJzlZBH49sbqSG4ekxDgXbctqemhfbLDFqB2 /PtuWxyzzdyQZ8XrSNUjHjzXVxbQYUOSO6iCHRWtwziG9vzgrFuThjugflPpDZGasMyV nNwCUxTD/ky9IxpwRLuH5x57/lHwl8kDBVazR/ZMfdB48kWqf3dh9YM2PTpNdIMGYrUK G+S/LHVy9GXchhs3rPnyxV3qZjVPiSKRuwC37FzDalMjBlpPUoUx7V5KGRVt0+URfpHr zSljenS7RwY3dYGOTO+dd1cH1Nwo5n614BIAplO+8JMcbu0pOA4FQUADJpFqDSM14iyb R6/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=Ldde6oJabIXpjnMh/izNXKRPDqJBETR/6Io6KxRvfhc=; b=XKerp9acgJZ1LIjJ1Kmq8bF7lLJ9h3QTpLwrseWJ4xQdOG2PC6G1xIXdgHder9FfxY e64Kp0t4h2I9OVQKbc46Fdpzc97qusV35rFmk6jCwLiFlqqtMLujzFTtSV6NA9tHO2y2 by8MvThpVqEPFmxh1y3kEDpv+zAF0/8k9BhKNKlzGqZ1cslbvUl2QQu0EQ95sX34DD0Z OquISmgQ25jKz+j0HK4PwYPYD0dUcIMD976/hDoJ5YjwZa9uSYps4oyqXb96bvBejiTN KTOZHu0ehcS+yxoNvkr2MfO9/9hkInjYogRbMLMoirFRuoxVbbAGqASW55Q1O3Zvuuf5 lMqw== X-Gm-Message-State: AMCzsaUmh1UUxNIpU8EVXSfsE1T313wKyQFvoRkqLHJa98+05ivce8wS ip275TTl2G6V59YiVGxKWVAH X-Google-Smtp-Source: AOwi7QBJ4+ML36MM9IHKSqaPOTosbcqB5XEyBxZqHFKK7PhINNF9C7oHDLYJsUOVguhn2c8kA2ck3Q== X-Received: by 10.80.155.8 with SMTP id o8mr2106634edi.39.1507273416999; Fri, 06 Oct 2017 00:03:36 -0700 (PDT) Received: from autoinstall.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id c36sm735720eda.14.2017.10.06.00.03.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 00:03:36 -0700 (PDT) Date: Fri, 6 Oct 2017 09:03:25 +0200 From: =?iso-8859-1?Q?N=E9lio?= Laranjeiro To: Yongseok Koh Cc: dev@dpdk.org, adrien.mazarguil@6wind.com, ferruh.yigit@intel.com Message-ID: <20171006070325.GI15330@autoinstall.dev.6wind.com> References: <20171006045956.GF19330@yongseok-MBP.local> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20171006045956.GF19330@yongseok-MBP.local> User-Agent: Mutt/1.5.23 (2014-03-12) 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 07:03:37 -0000 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. > However, it is logically flawless, so > Acked-by: Yongseok Koh Thanks, -- Nélio Laranjeiro 6WIND