Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp2097397ybg; Thu, 24 Oct 2019 04:48:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqz7DNeSB+nm3WkTGQCk45JUphFPYNSSSn6UlwZHM/PL3XSts/OpBU775afIWTTuD2hipA1K X-Received: by 2002:a05:6402:13c5:: with SMTP id a5mr24017522edx.106.1571917717400; Thu, 24 Oct 2019 04:48:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571917717; cv=none; d=google.com; s=arc-20160816; b=qhCPr/MRe/IozEKB0QsmJoAv0oJYbJXNslabbRKAi9Ao0wJujtD8WeoVTX2u1nNw4z nSuI/Bf5HOfzV86IrHxOlFAn7l2CF/2d3dlOiEuxGgAWr04P4HBRjp00bp1p80kZ3Nm0 WG26hptHJQaG3xASh/p5sr8tsnGz1BhFK2G2iN3swsmMrb/2hkDA4irx8zkcJ+uEeqBG B9cwsT0vximb4BTMJxp1q9Nv7V8j4s7kejsFE1ovYKUeIdo9JITI0xTim1s+zSANBHfT jgmUzrxFflinCOoL4jBj6XtHkcaZk5Bb3h04o/dvccN1MNFGTQSVLqmEuvVGr7QpGKNa P7ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=mHXswdXwjMkjlynu6WoO/JXk1XcXd81Y/XoQ2aJrYlc=; b=xo2SfKMrqG0rVs8dOM8/Xc+vlmJjXeUHhrBIFMJLs7GpmTumslb3kcy2lmMeQfFwpy lTlNhSbdjCNX450GlooZ4Ijfnic8naBrERyhVILyIoiXHOzxF/1MqW3dCbB0cPZCTMhd 4P43D9T8uPKjh9hC1IRPlR6Km0hxEl5sq9hGDCr31YG19EjqCB21VeBn7e+q/kscJn13 3i7MTNRZo/ukS8hCbLuzbxxx/8ImcBLgyi1Qc/FcMTIflAPxzf5ce5xcbko/4oEYtTFk WU7k1MG2IoQI9+wGKgNC9T5z9zirl7UgH3s3dZRu8W+Tl7stRHbonqmcGsSmB4oyO2+R 4cbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2019-08-05 header.b=mMjMJAWP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 19si3776247edz.85.2019.10.24.04.48.13; Thu, 24 Oct 2019 04:48:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2019-08-05 header.b=mMjMJAWP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730407AbfJWReL (ORCPT + 99 others); Wed, 23 Oct 2019 13:34:11 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:59672 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730302AbfJWReK (ORCPT ); Wed, 23 Oct 2019 13:34:10 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x9NHT0MZ190406; Wed, 23 Oct 2019 17:33:58 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=mHXswdXwjMkjlynu6WoO/JXk1XcXd81Y/XoQ2aJrYlc=; b=mMjMJAWPAOGCP7e/Eh0KJ0oLM2GOYPVRUzKsUHf//g0VJ08flrTR0PkKo4ldPUvx1wdm 1xmJ7V0CmnPZDFiYiXyMQSegB8oHt93MBAi6YqL3l6fZEn/cdB7MkTrYastp0NGPc768 pCnlbnvQAbRkFQp5P7zznAX3D1z7QHRa5CWyWnKNwiHIiu0nt7kjBZNTALpfrzMjjngN H7jVzBMhjRsiThJdQDbBjdka3yGnnfZYpchbaFuJ1j2WugWb39nBrXC+Bc83odRKRAWL erPhKb2D3xBDLCq4tfyzK5ONtK6jUp3a7ze5R0LZ9Y/Ytr+q/seVuuUshtZqik2geQ3B /A== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by aserp2120.oracle.com with ESMTP id 2vqtepxv63-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 23 Oct 2019 17:33:58 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x9NHXkwc070018; Wed, 23 Oct 2019 17:33:58 GMT Received: from pps.reinject (localhost [127.0.0.1]) by aserp3030.oracle.com with ESMTP id 2vtm22kxeg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 23 Oct 2019 17:33:58 +0000 Received: from aserp3030.oracle.com (aserp3030.oracle.com [127.0.0.1]) by pps.reinject (8.16.0.27/8.16.0.27) with SMTP id x9NHXnFO070572; Wed, 23 Oct 2019 17:33:57 GMT Received: from ca-dev107.us.oracle.com (ca-dev107.us.oracle.com [10.129.135.36]) by aserp3030.oracle.com with ESMTP id 2vtm22kwep-2; Wed, 23 Oct 2019 17:33:57 +0000 From: rao Shoaib To: monis@mellanox.com, dledford@redhat.com, sean.hefty@intel.com, hal.rosenstock@gmail.com, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Rao Shoaib Subject: [PATCH v1 1/1] rxe: calculate inline data size based on requested values Date: Wed, 23 Oct 2019 10:32:37 -0700 Message-Id: <1571851957-3524-2-git-send-email-rao.shoaib@oracle.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1571851957-3524-1-git-send-email-rao.shoaib@oracle.com> References: <1571851957-3524-1-git-send-email-rao.shoaib@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9419 signatures=668684 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 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-1908290000 definitions=main-1910230167 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rao Shoaib rxe driver has a hard coded value for the size of inline data, where as mlx5 driver calculates number of SGE's and inline data size based on the values in the qp request. This patch modifies rxe driver to do the same so that applications can work seamlessly across drivers. Signed-off-by: Rao Shoaib --- drivers/infiniband/sw/rxe/rxe_param.h | 2 +- drivers/infiniband/sw/rxe/rxe_qp.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/sw/rxe/rxe_param.h b/drivers/infiniband/sw/rxe/rxe_param.h index 1b596fb..657f9303 100644 --- a/drivers/infiniband/sw/rxe/rxe_param.h +++ b/drivers/infiniband/sw/rxe/rxe_param.h @@ -68,7 +68,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 @@ -81,6 +80,7 @@ enum rxe_device_param { | IB_DEVICE_MEM_MGT_EXTENSIONS, RXE_MAX_SGE = 32, RXE_MAX_SGE_RD = 32, + RXE_MAX_INLINE_DATA = RXE_MAX_SGE * sizeof(struct ib_sge), RXE_MAX_CQ = 16384, RXE_MAX_LOG_CQE = 15, RXE_MAX_MR = 2 * 1024, diff --git a/drivers/infiniband/sw/rxe/rxe_qp.c b/drivers/infiniband/sw/rxe/rxe_qp.c index aeea994..45b5da5 100644 --- a/drivers/infiniband/sw/rxe/rxe_qp.c +++ b/drivers/infiniband/sw/rxe/rxe_qp.c @@ -229,6 +229,7 @@ static int rxe_qp_init_req(struct rxe_dev *rxe, struct rxe_qp *qp, { int err; int wqe_size; + unsigned int inline_size; err = sock_create_kern(&init_net, AF_INET, SOCK_DGRAM, 0, &qp->sk); if (err < 0) @@ -244,6 +245,9 @@ static int rxe_qp_init_req(struct rxe_dev *rxe, struct rxe_qp *qp, sizeof(struct rxe_send_wqe) + qp->sq.max_inline); + inline_size = wqe_size - sizeof(struct rxe_send_wqe); + qp->sq.max_inline = inline_size; + init->cap.max_inline_data = inline_size; qp->sq.queue = rxe_queue_init(rxe, &qp->sq.max_wr, wqe_size); -- 1.8.3.1