Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1989114lqa; Tue, 30 Apr 2024 05:37:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVS/2v416X+LJ59jkMnu/E3/oqmkUJ4+cDjxeluIJ2czyQynhKm0xW7FX8xLEl0zHg059xt5K6Mzas4Dfoe99Vxil+hcUBWtO/tzr67hw== X-Google-Smtp-Source: AGHT+IEJnPPrvucrIZdw5WE2fa96a10fK16lCmQ7vc5lXlhhCztAyuPgEvXar3Q5b71H7qBj8+oE X-Received: by 2002:ac8:7d84:0:b0:43a:b9c9:a25c with SMTP id c4-20020ac87d84000000b0043ab9c9a25cmr2586444qtd.38.1714480650403; Tue, 30 Apr 2024 05:37:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714480650; cv=pass; d=google.com; s=arc-20160816; b=Ug/O+Jx5pZX/gUDznFL6YzEjXVtvi47UxELx3GytmmFi64onfXXdG+eNoMLGWSOgrF sSQoOQ2W2vwCJaWcx2Z14vLW1cGv3Ur/Nc605aG0NvcPnx859Jk8tD86W1Dn8P3owGP0 tCEQvBHY74Ew2kLFfWe98FmJeNdSb0QIpelVrTuBMjMyh/O4qawnEyI5q7exRQBXhyaB yAFL9XKFz2V4unrMP7R9hQHZK8lbyDJJvzhcCxZ9Jys1jN7B0VmxG7PIntHx9N2U0OkQ rTJVgZ88Se9e7g4YgnJzxeLxAVtSU3k7qaXQleBai3SrV06wajst188YJem9ba/+HpDo 5pgA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=H2yCmQoeof/URxlnRVs/uIOvu6lBM885Pbl6Js72Jvs=; fh=eKILSZDHlIy/WeISv/rX9hRWFh0SQiziRxTQKCIP3Kk=; b=KCqzNr4a5KWuRMYx3dTxpJRvM6tbfdPL/vphCxScwNypazHkzGLrWt1F4kIfbIcenm WyYIBQiv/MdGonzCDsh1RXz3Iuidw9aRMJWDNVFWFyKR9hXDzuRfc9EE+zEfZg6UdfFk 4iVOfMsd9p+zZRXi3iqn97D5/9T09KXqpEQ1feGqXdSy7/qADMpaeL1xJus+5DWVrsqp 0gp74lFyfnIKWdm5fTZ0P2oK3EhvSmZML5SnW3Zj9vZa+78x/HeW+sp65tvnszcUawAx omaNHeXgu1SppMX3UgqqK7EfAQ0pg+fQmwSSnUMQhArkO/1VaShobST5klTBWhTbL9lG DAgQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WdjjzBZ3; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-163919-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163919-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id ep16-20020a05622a549000b0043478a22ab0si26146245qtb.549.2024.04.30.05.37.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 05:37:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-163919-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=WdjjzBZ3; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-163919-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-163919-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 1540A1C21FDC for ; Tue, 30 Apr 2024 12:37:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4C15C17108E; Tue, 30 Apr 2024 12:37:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WdjjzBZ3" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6F67F1CD3A; Tue, 30 Apr 2024 12:37:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714480641; cv=none; b=XRSTIhXTQ4sisvZJP5jFN8Vm3V6a1JirIF5c15BlFSse62uDHiqcKQiptz2X1Ohq84UduK/Y7dUJivMXUCkp5+0U/t/ZqDI2NysUYQjp+Se6cd+Nk/cNd+LC6QSVy8Tt5A/niFYWAHepkF9Iq/KVHJ4Mxbl0TDPAR+MM1e66VO0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714480641; c=relaxed/simple; bh=FPqMx5f5x4wqvVTHLCGW9lKxGr2DBWjDBToiIp6l0BM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=UH1JRG7gn6A5MlnxXZ9LOHxPJNZgVCCoIdb7H5tkPFI2qjt1KqjCj43XS2L5Lym5b2kMuUO1uDHGnjhGe2jmaaB8M446yjdI2YRyD7/og669YBW73Z6tVt3ra5VesZI7TksmKIrGb2ILiyLYZ7agrDYgpxIyK6Z6Bn85cFqMOLA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WdjjzBZ3; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 78F89C2BBFC; Tue, 30 Apr 2024 12:37:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714480640; bh=FPqMx5f5x4wqvVTHLCGW9lKxGr2DBWjDBToiIp6l0BM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WdjjzBZ3K2zK0UKxydaWJFrBQR9CORpACDdDKYLcgpADpGBuG96OPWsWRVBM3G4nJ XZJTelMyIsNu5HSShlcf71Rlsko/PDS3wfFBjXnwfd0znOfSIYhC5g1sXNCHD8LrFZ 6bWxSQSHd0xd230gi8JKa1XrqncBPtJEoL7BVhKTYH1L7B2V2yFEtBDgxoiTUSbPqc OFZs/TgRwsgMDIT1o2NtPwnqiA5qUWGptZMPF7ZRNBvrVEzbffHw/W84sp9KsKrERf QRgnTftlB7j5CG4IPtjx5wuZ8yfUW4JmTZF+7kUZQTVwo/34C8nZMpQe/qEddFxzv5 /f/Gz94vtF4ZQ== Date: Tue, 30 Apr 2024 15:37:15 +0300 From: Leon Romanovsky To: Long Li Cc: Konstantin Taranov , Konstantin Taranov , "sharmaajay@microsoft.com" , "jgg@ziepe.ca" , "linux-rdma@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH rdma-next 6/6] RDMA/mana_ib: implement uapi for creation of rnic cq Message-ID: <20240430123715.GD100414@unreal> References: <1713459125-14914-1-git-send-email-kotaranov@linux.microsoft.com> <1713459125-14914-7-git-send-email-kotaranov@linux.microsoft.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Tue, Apr 23, 2024 at 11:57:53PM +0000, Long Li wrote: > > Subject: [PATCH rdma-next 6/6] RDMA/mana_ib: implement uapi for creation > > of rnic cq > > > > From: Konstantin Taranov > > > > Enable users to create RNIC CQs. > > With the previous request size, an ethernet CQ is created. > > Use the cq_buf_size from the user to create an RNIC CQ and return its ID. > > > > Signed-off-by: Konstantin Taranov > > --- > > drivers/infiniband/hw/mana/cq.c | 56 ++++++++++++++++++++++++++++++--- > > include/uapi/rdma/mana-abi.h | 7 +++++ > > 2 files changed, 59 insertions(+), 4 deletions(-) > > > > diff --git a/drivers/infiniband/hw/mana/cq.c > > b/drivers/infiniband/hw/mana/cq.c index 8323085..a62bda7 100644 > > --- a/drivers/infiniband/hw/mana/cq.c > > +++ b/drivers/infiniband/hw/mana/cq.c > > @@ -9,17 +9,25 @@ int mana_ib_create_cq(struct ib_cq *ibcq, const struct > > ib_cq_init_attr *attr, > > struct ib_udata *udata) > > { > > struct mana_ib_cq *cq = container_of(ibcq, struct mana_ib_cq, ibcq); > > + struct mana_ib_create_cq_resp resp = {}; > > + struct mana_ib_ucontext *mana_ucontext; > > struct ib_device *ibdev = ibcq->device; > > struct mana_ib_create_cq ucmd = {}; > > struct mana_ib_dev *mdev; > > + bool is_rnic_cq = true; > > + u32 doorbell; > > int err; > > > > mdev = container_of(ibdev, struct mana_ib_dev, ib_dev); > > > > - if (udata->inlen < sizeof(ucmd)) > > + cq->comp_vector = attr->comp_vector % ibdev->num_comp_vectors; > > + cq->cq_handle = INVALID_MANA_HANDLE; > > + > > + if (udata->inlen < offsetof(struct mana_ib_create_cq, cq_buf_size)) > > return -EINVAL; > > > > - cq->comp_vector = attr->comp_vector % ibdev->num_comp_vectors; > > + if (udata->inlen == offsetof(struct mana_ib_create_cq, cq_buf_size)) > > + is_rnic_cq = false; > > I think it's okay with checking on offset in uapi message to decide if this is a newer/updated RNIC uverb. > > But increasing MANA_IB_UVERBS_ABI_VERSION may make the code simpler. I have a feeling that you may need to increase it anyway, because a new uapi message "mana_ib_create_cq_resp" is introduced. > > Jason or Leon may have a better idea on this. You should really try to avoid changing MANA_IB_UVERBS_ABI_VERSION as it usually means that backward compatibility will be broken after such change. Thanks