From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.3 required=3.0 tests=DATE_IN_PAST_24_48, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78894C433E0 for ; Thu, 21 May 2020 17:59:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 578D1207FB for ; Thu, 21 May 2020 17:59:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729326AbgEUR7U (ORCPT ); Thu, 21 May 2020 13:59:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:59168 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727883AbgEUR7U (ORCPT ); Thu, 21 May 2020 13:59:20 -0400 Received: from localhost (unknown [213.57.247.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7864520759; Thu, 21 May 2020 17:59:19 +0000 (UTC) Date: Wed, 20 May 2020 12:32:26 +0300 From: Leon Romanovsky To: Yamin Friedman Cc: Devesh Sharma , Jason Gunthorpe , Sagi Grimberg , Or Gerlitz , linux-rdma Subject: Re: [PATCH V3 2/4] RDMA/core: Introduce shared CQ pool API Message-ID: <20200520093226.GC331541@unreal> References: <1589892216-39283-1-git-send-email-yaminf@mellanox.com> <1589892216-39283-3-git-send-email-yaminf@mellanox.com> <1e4eeb19-17a2-d281-24f1-fd79d34c7df2@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1e4eeb19-17a2-d281-24f1-fd79d34c7df2@mellanox.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org On Wed, May 20, 2020 at 12:23:01PM +0300, Yamin Friedman wrote: > > On 5/20/2020 9:19 AM, Devesh Sharma wrote: > > > > > + > > > +static int ib_alloc_cqs(struct ib_device *dev, int nr_cqes, > > > + enum ib_poll_context poll_ctx) > > > +{ > > > + LIST_HEAD(tmp_list); > > > + struct ib_cq *cq; > > > + unsigned long flags; > > > + int nr_cqs, ret, i; > > > + > > > + /* > > > + * Allocated at least as many CQEs as requested, and otherwise > > > + * a reasonable batch size so that we can share CQs between > > > + * multiple users instead of allocating a larger number of CQs. > > > + */ > > > + nr_cqes = min(dev->attrs.max_cqe, max(nr_cqes, IB_MAX_SHARED_CQ_SZ)); > > > + nr_cqs = min_t(int, dev->num_comp_vectors, num_online_cpus()); > > No WARN() or return with failure as pointed by Leon and me. Has > > anything else changes elsewhere? > > Hey Devesh, > > I am not sure what you are referring to, could you please clarify? He is saying that dev->num_comp_vectors can be 0. Thanks