Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2663659pxa; Mon, 17 Aug 2020 15:56:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2HX4HGC1RDgHnXIvjypODQgDMWXfurTNwtcue2r/icnZxe86SxbJr4CSkQSM4NcwfeWcw X-Received: by 2002:a05:6402:308e:: with SMTP id de14mr16854485edb.344.1597704960117; Mon, 17 Aug 2020 15:56:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597704960; cv=none; d=google.com; s=arc-20160816; b=d64r8R3HB0B+w5T+EmI0vhIEcQsUB35D7UORugYWRumYwn7r0co3nL0bd6TfYewFdn MYkn/ApeQAS2gEV8ghU55D0ipXl0XExSc68cF3RwAcIukbaUQQk+nshxVXJcGK7Znnm7 CFjI6xAcyoLpurqf4DPtBUlBAr5Thk3+WgQVy33GErEO1Vo40TC01ujNapIsDxnpPnTA hOLzwPjSvkbe9RCnZIOX2jorxogrcZEtk/0lcUMtMH1L9XGQDa20+OiLS2qS8FK/ciMP YwNGCPO+l7i5WHZ2gyvys/8a/JSOEc2377RQY73zrY4WJQS+d6/KKKqfSc/3V+xNc/PK RT1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Rz0qNz7qfFd6X11Gz3srGkTD4b9nTz8isv6h97E05kk=; b=Z1ZqfBiXKsVbmA2K7FlGcLU149MNGgjAjL7mwwGcvV6ZbR2XH1nwV/2nn8Vni4F++l 16FfEYxtY+xWOEEb1b32u7E9P3L1YO8A23IoHIF4mJKw/n/VsN8KQ3rQU7SKGnkiKuyo y/kX7x2tmnZLOvLQGUuB5+aN9h+yTpOf2l6IdOYE7nMCrM0ZCwnrX6oGHMKFjI2tIjNk gGFkIzhmU1norsBOY09WPPlODOTvOi4+7ecnnzfBBfVGkeR+zeSNC/y4LqkreBPkUKBw kwykyJzAf59Y6WJ61HqMOHCzqAbwPygMAV5xMzUcSF70DHNsZX7esnyu8YxKz/aaRDP8 WTXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nPyWv+yo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bc16si11640439edb.394.2020.08.17.15.55.37; Mon, 17 Aug 2020 15:56:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=nPyWv+yo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732356AbgHQTfe (ORCPT + 99 others); Mon, 17 Aug 2020 15:35:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:47264 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730056AbgHQP3S (ORCPT ); Mon, 17 Aug 2020 11:29:18 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 3402923BCA; Mon, 17 Aug 2020 15:29:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597678156; bh=Iroj//ok0sYdykOMbb8YRqc18apoV8M5/XXPiKlsvpQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nPyWv+yormBQhO2bi8RR7FIoiqWjwJcIZ8bluV4BTSWcJLEKNkLS5Kb9x3wdyxOUJ XtwFsY+bSydLNPvC+k9DoxHl/dfgaIEFCGLaBRUIOKlnWxQl5jjep9QrYp9r9AMfVx m/hOJLJe8EQYk6b3y6A8jisewEJUmRRampmWKOIM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ariel Elior , Michal Kalderon , Jason Gunthorpe , Sasha Levin Subject: [PATCH 5.8 237/464] RDMA/qedr: Add EDPM max size to alloc ucontext response Date: Mon, 17 Aug 2020 17:13:10 +0200 Message-Id: <20200817143845.151375509@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143833.737102804@linuxfoundation.org> References: <20200817143833.737102804@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Michal Kalderon [ Upstream commit eb7f84e379daad69b4c92538baeaf93bbf493c14 ] User space should receive the maximum edpm size from kernel driver, similar to other edpm/ldpm related limits. Add an additional parameter to the alloc_ucontext_resp structure for the edpm maximum size. In addition, pass an indication from user-space to kernel (and not just kernel to user) that the DPM sizes are supported. This is for supporting backward-forward compatibility between driver and lib for everything related to DPM transaction and limit sizes. This should have been part of commit mentioned in Fixes tag. Link: https://lore.kernel.org/r/20200707063100.3811-3-michal.kalderon@marvell.com Fixes: 93a3d05f9d68 ("RDMA/qedr: Add kernel capability flags for dpm enabled mode") Signed-off-by: Ariel Elior Signed-off-by: Michal Kalderon Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/hw/qedr/verbs.c | 9 ++++++--- include/uapi/rdma/qedr-abi.h | 6 +++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/infiniband/hw/qedr/verbs.c b/drivers/infiniband/hw/qedr/verbs.c index bddd85e1c8c77..1a7f1f805be3e 100644 --- a/drivers/infiniband/hw/qedr/verbs.c +++ b/drivers/infiniband/hw/qedr/verbs.c @@ -320,9 +320,12 @@ int qedr_alloc_ucontext(struct ib_ucontext *uctx, struct ib_udata *udata) QEDR_DPM_TYPE_ROCE_LEGACY | QEDR_DPM_TYPE_ROCE_EDPM_MODE; - uresp.dpm_flags |= QEDR_DPM_SIZES_SET; - uresp.ldpm_limit_size = QEDR_LDPM_MAX_SIZE; - uresp.edpm_trans_size = QEDR_EDPM_TRANS_SIZE; + if (ureq.context_flags & QEDR_SUPPORT_DPM_SIZES) { + uresp.dpm_flags |= QEDR_DPM_SIZES_SET; + uresp.ldpm_limit_size = QEDR_LDPM_MAX_SIZE; + uresp.edpm_trans_size = QEDR_EDPM_TRANS_SIZE; + uresp.edpm_limit_size = QEDR_EDPM_MAX_SIZE; + } uresp.wids_enabled = 1; uresp.wid_count = oparams.wid_count; diff --git a/include/uapi/rdma/qedr-abi.h b/include/uapi/rdma/qedr-abi.h index b261c9fca07bb..bf7333b2b5d71 100644 --- a/include/uapi/rdma/qedr-abi.h +++ b/include/uapi/rdma/qedr-abi.h @@ -40,7 +40,8 @@ /* user kernel communication data structures. */ enum qedr_alloc_ucontext_flags { QEDR_ALLOC_UCTX_EDPM_MODE = 1 << 0, - QEDR_ALLOC_UCTX_DB_REC = 1 << 1 + QEDR_ALLOC_UCTX_DB_REC = 1 << 1, + QEDR_SUPPORT_DPM_SIZES = 1 << 2, }; struct qedr_alloc_ucontext_req { @@ -50,6 +51,7 @@ struct qedr_alloc_ucontext_req { #define QEDR_LDPM_MAX_SIZE (8192) #define QEDR_EDPM_TRANS_SIZE (64) +#define QEDR_EDPM_MAX_SIZE (ROCE_REQ_MAX_INLINE_DATA_SIZE) enum qedr_rdma_dpm_type { QEDR_DPM_TYPE_NONE = 0, @@ -77,6 +79,8 @@ struct qedr_alloc_ucontext_resp { __u16 ldpm_limit_size; __u8 edpm_trans_size; __u8 reserved; + __u16 edpm_limit_size; + __u8 padding[6]; }; struct qedr_alloc_pd_ureq { -- 2.25.1