From patchwork Tue Jan 14 00:41:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shoaib Rao X-Patchwork-Id: 11331143 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D26246C1 for ; Tue, 14 Jan 2020 00:41:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B07C9207FD for ; Tue, 14 Jan 2020 00:41:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="m9wqUdYP" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727382AbgANAlr (ORCPT ); Mon, 13 Jan 2020 19:41:47 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:41174 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728778AbgANAlr (ORCPT ); Mon, 13 Jan 2020 19:41:47 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id 00E0d6d2101644; Tue, 14 Jan 2020 00:41:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2019-08-05; bh=dbOTCt1Jy/5ixH1+zM/4jFaSoET4MFpcc6Ziu6cX3kI=; b=m9wqUdYP0zqcgh7R1HUt2GTLRmrs1z8mH+1+K0qTKkrVFtEG3lmczT1YssEuwapmmP24 22ZRxvRZ4IzhbZYOqtiUzjZydtq1wEUBWDld5Npvgbv+Z8ya6s9aYFj6YtJQSRdHYNo2 BOEboORTtBSrccw5Z+m4SaQcc4qpNqm72FdYHkud0Q4+Roa7KuNcxb8sBAsPV/Fjvmw9 lU++4IEdjQlW76bpLEW6Op7pMOsRxE+cVQh4trkncxTlgPikxY25aK0KMytUFZvJroDm 1pxrlEFMR/nMxvMEeEN1xKolyrrliV80A589b/MlpSkd7tIHW1KnZAEvT9Rn5fsaJYrk Sg== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2130.oracle.com with ESMTP id 2xf74s2h35-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 14 Jan 2020 00:41:39 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id 00E0d7eT057238; Tue, 14 Jan 2020 00:41:38 GMT Received: from pps.reinject (localhost [127.0.0.1]) by userp3020.oracle.com with ESMTP id 2xfrgjmaet-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 14 Jan 2020 00:41:38 +0000 Received: from userp3020.oracle.com (userp3020.oracle.com [127.0.0.1]) by pps.reinject (8.16.0.27/8.16.0.27) with SMTP id 00E0fbfj067024; Tue, 14 Jan 2020 00:41:38 GMT Received: from ca-dev107.us.oracle.com (ca-dev107.us.oracle.com [10.129.135.36]) by userp3020.oracle.com with ESMTP id 2xfrgjmae0-2; Tue, 14 Jan 2020 00:41:38 +0000 From: rao Shoaib To: linux-rdma@vger.kernel.org Cc: jgg@ziepe.ca, monis@mellanox.com, dledford@redhat.com, sean.hefty@intel.com, hal.rosenstock@gmail.com, linux-kernel@vger.kernel.org, Rao Shoaib Subject: [PATCH v3 1/2] Introduce maximum WQE size to check limits Date: Mon, 13 Jan 2020 16:41:19 -0800 Message-Id: <1578962480-17814-2-git-send-email-rao.shoaib@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1578962480-17814-1-git-send-email-rao.shoaib@oracle.com> References: <1578962480-17814-1-git-send-email-rao.shoaib@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9499 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=945 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-2001140003 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Rao Shoaib Introduce maximum WQE size to impose limits on max SGE's and inline data Signed-off-by: Rao Shoaib --- drivers/infiniband/sw/rxe/rxe_param.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/sw/rxe/rxe_param.h b/drivers/infiniband/sw/rxe/rxe_param.h index 1b596fb..a0e4075 100644 --- a/drivers/infiniband/sw/rxe/rxe_param.h +++ b/drivers/infiniband/sw/rxe/rxe_param.h @@ -34,6 +34,8 @@ #ifndef RXE_PARAM_H #define RXE_PARAM_H +#include + static inline enum ib_mtu rxe_mtu_int_to_enum(int mtu) { if (mtu < 256) @@ -68,7 +70,6 @@ enum rxe_device_param { RXE_HW_VER = 0, RXE_MAX_QP = 0x10000, RXE_MAX_QP_WR = 0x4000, - RXE_MAX_INLINE_DATA = 400, RXE_DEVICE_CAP_FLAGS = IB_DEVICE_BAD_PKEY_CNTR | IB_DEVICE_BAD_QKEY_CNTR | IB_DEVICE_AUTO_PATH_MIG @@ -80,6 +81,10 @@ enum rxe_device_param { | IB_DEVICE_SRQ_RESIZE | IB_DEVICE_MEM_MGT_EXTENSIONS, RXE_MAX_SGE = 32, + RXE_MAX_WQE_SIZE = sizeof(struct rxe_send_wqe) + + sizeof(struct ib_sge) * RXE_MAX_SGE, + RXE_MAX_INLINE_DATA = RXE_MAX_WQE_SIZE - + sizeof(struct rxe_send_wqe), RXE_MAX_SGE_RD = 32, RXE_MAX_CQ = 16384, RXE_MAX_LOG_CQE = 15, From patchwork Tue Jan 14 00:41:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shoaib Rao X-Patchwork-Id: 11331145 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 08EA313A0 for ; Tue, 14 Jan 2020 00:41:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DB873207FD for ; Tue, 14 Jan 2020 00:41:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="DSyB6CaJ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728778AbgANAlv (ORCPT ); Mon, 13 Jan 2020 19:41:51 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:41182 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728794AbgANAlr (ORCPT ); Mon, 13 Jan 2020 19:41:47 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id 00E0cNcu101197; Tue, 14 Jan 2020 00:41:39 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2019-08-05; bh=zVxnaaKeWVK8xTlHdQcAlC/MGkBhYpWpwvLSipskm4I=; b=DSyB6CaJFK9jRq/AIJe4lLP4CADSMKhAXdf72SGP56oP4vkNNcaQ5Uu594u9fjYE8fzt NL4lCy+wfvJr3pD1GsFsKbl7xAvhm4tb/AWjfQJJaaKoXhRRU+cMyxaaQ5tYhiqJgmaO CKY4hDuH9fCXyASNk+NQ1lclXwL4lr3LNT7NSOsIRp45yu78dL9GFdVPbUBnJKQXWw4k XK0HJfyktvHDjrAFinKfo6PivbcOUVpiJJFuUCM4hdyr4HWj2m8Ow0DosjqDHZGGnoli 39/c9THN//hXn5huN5djhH/iircOtsJD+S7ZK5fT+btratRwEWDyZXi2w14EeBjgmCtN DQ== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2130.oracle.com with ESMTP id 2xf74s2h37-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 14 Jan 2020 00:41:39 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id 00E0d5HQ057174; Tue, 14 Jan 2020 00:41:39 GMT Received: from pps.reinject (localhost [127.0.0.1]) by userp3020.oracle.com with ESMTP id 2xfrgjmaey-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 14 Jan 2020 00:41:39 +0000 Received: from userp3020.oracle.com (userp3020.oracle.com [127.0.0.1]) by pps.reinject (8.16.0.27/8.16.0.27) with SMTP id 00E0fbfl067024; Tue, 14 Jan 2020 00:41:38 GMT Received: from ca-dev107.us.oracle.com (ca-dev107.us.oracle.com [10.129.135.36]) by userp3020.oracle.com with ESMTP id 2xfrgjmae0-3; Tue, 14 Jan 2020 00:41:38 +0000 From: rao Shoaib To: linux-rdma@vger.kernel.org Cc: jgg@ziepe.ca, monis@mellanox.com, dledford@redhat.com, sean.hefty@intel.com, hal.rosenstock@gmail.com, linux-kernel@vger.kernel.org, Rao Shoaib Subject: [PATCH v3 2/2] SGE buffer and max_inline data must have same size Date: Mon, 13 Jan 2020 16:41:20 -0800 Message-Id: <1578962480-17814-3-git-send-email-rao.shoaib@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1578962480-17814-1-git-send-email-rao.shoaib@oracle.com> References: <1578962480-17814-1-git-send-email-rao.shoaib@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9499 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-2001140003 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Rao Shoaib SGE buffer size and max_inline data should be same. Maximum of the two values requested is used. Signed-off-by: Rao Shoaib --- drivers/infiniband/sw/rxe/rxe_qp.c | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/drivers/infiniband/sw/rxe/rxe_qp.c b/drivers/infiniband/sw/rxe/rxe_qp.c index aeea994..41c669c 100644 --- a/drivers/infiniband/sw/rxe/rxe_qp.c +++ b/drivers/infiniband/sw/rxe/rxe_qp.c @@ -235,18 +235,17 @@ static int rxe_qp_init_req(struct rxe_dev *rxe, struct rxe_qp *qp, return err; qp->sk->sk->sk_user_data = qp; - qp->sq.max_wr = init->cap.max_send_wr; - qp->sq.max_sge = init->cap.max_send_sge; - qp->sq.max_inline = init->cap.max_inline_data; - - wqe_size = max_t(int, sizeof(struct rxe_send_wqe) + - qp->sq.max_sge * sizeof(struct ib_sge), - sizeof(struct rxe_send_wqe) + - qp->sq.max_inline); - - qp->sq.queue = rxe_queue_init(rxe, - &qp->sq.max_wr, - wqe_size); + wqe_size = max_t(int, init->cap.max_send_sge * sizeof(struct ib_sge), + init->cap.max_inline_data); + qp->sq.max_sge = wqe_size/sizeof(struct ib_sge); + qp->sq.max_inline = wqe_size; + + wqe_size += sizeof(struct rxe_send_wqe); + + qp->sq.max_wr = init->cap.max_send_wr; + + qp->sq.queue = rxe_queue_init(rxe, &qp->sq.max_wr, wqe_size); + if (!qp->sq.queue) return -ENOMEM;