From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from bombadil.infradead.org ([198.137.202.133]:51836 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752539AbeENOYf (ORCPT ); Mon, 14 May 2018 10:24:35 -0400 Date: Mon, 14 May 2018 07:24:34 -0700 From: "hch@infradead.org" To: Bart Van Assche Cc: "hch@infradead.org" , "jgg@ziepe.ca" , "linux-rdma@vger.kernel.org" , "dledford@redhat.com" , "swise@opengridcomputing.com" , "stable@vger.kernel.org" Subject: Re: [PATCH] IB/srpt: Increase port count Message-ID: <20180514142434.GA3233@infradead.org> References: <20180510223209.10277-1-bart.vanassche@wdc.com> <20180514120328.GA5081@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: stable-owner@vger.kernel.org List-ID: On Mon, May 14, 2018 at 02:23:16PM +0000, Bart Van Assche wrote: > > > WARN_ON(sdev->device->phys_port_cnt > ARRAY_SIZE(sdev->port)); > > > > Should we add a IB_MAX_PORTS define that ULPs can rely on in the core? > > How many drivers would benefit from the introduction of such a constant? > A third possible alternative is that I change the port array in the ib_srpt > driver such that it is allocated dynamically. That would allow to eliminate > the WARN_ON() statement mentioned above. No idea how many benefit. But either we have an upper limit, or ULPs should be able to deal with any possible number, e.g. by using your dynamic allocation idea.