From patchwork Wed Nov 16 08:19:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhijian Li (Fujitsu)" X-Patchwork-Id: 20797 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp23013wru; Wed, 16 Nov 2022 00:28:04 -0800 (PST) X-Google-Smtp-Source: AA0mqf5XZIod4Tx7B16rMlvpUn0zV8h+0bHgL+P3JP6A93xsayF5hx3pQ/m3RIug9Snge0+OmAW2 X-Received: by 2002:a17:902:a515:b0:186:c958:64f with SMTP id s21-20020a170902a51500b00186c958064fmr7933175plq.33.1668587284436; Wed, 16 Nov 2022 00:28:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668587284; cv=none; d=google.com; s=arc-20160816; b=ZqyB7lB3NdZ2WcaNuDIVabH5k0qaVM/4RUaaNAXbTpZG0oNTOe5x22qD2qsuYVpwfH PkGaE8UUEsQyX9g7R9e7Tsi9uvzrGCufIb8cfI/KXXNVQM2NaEUHYYRGIpr8tQQdVBof vmcBjnv2WRs16hl2LxA2xeseVkZMd9Y0xi5dOF/4Z0jcX2twr345jHToHjcKPofolkgS qmdOv6jS+kTDt8EPwV0+fsbTnr1aSU1lVtfNbikOJ8tM8+ZjSFK0tztHkGrJwA+viggs nKBvjBjl5hCApQhME6FbodV7LHDh5pUqpl1QHstnz6Uv4a2EIXmRjTMS1bsvkl3r6EBS e4nA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=rJt8lNqt/aeP6e+lv7mngwCGYf2SxQm8lEwZcjYYw6A=; b=z2A6J1dCcTeNJHMljfnGGv2bAs4ZQ2u2asuOMn8AhIkOX+fCEyrDn8DLk3LAQyko5K MJDHXjfXpLEXgYW9JKsVt0eNNUmUt6A6XLufg7tMwtV55zLpAob+doE3hifBs+BiZYiY 8P9btqFYSBO0LZ53z+Iq/uOf2PlY5Uh+gPlg3cWI+vXy5sqZc97Ad/rnH/ZxPnKtmW3i cDQ5ES0VNinqt5LGOGHmxe1EPIZyHrMuxE+kyH28bpJRdRXKrIdRIOMbXUcp7Eqh81aJ ffJ4fcmc5XHCHnT7ibPMwev7XrtYjqKuh8jF0lhNzNG+ewbC58eskTfQL+LhMb8zvY2b W0KA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=fujitsu.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pq1-20020a17090b3d8100b00212e91e621csi1301766pjb.144.2022.11.16.00.27.51; Wed, 16 Nov 2022 00:28:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=fujitsu.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232657AbiKPIVi (ORCPT + 99 others); Wed, 16 Nov 2022 03:21:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232762AbiKPIUa (ORCPT ); Wed, 16 Nov 2022 03:20:30 -0500 Received: from esa1.hc1455-7.c3s2.iphmx.com (esa1.hc1455-7.c3s2.iphmx.com [207.54.90.47]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58D16DEE; Wed, 16 Nov 2022 00:20:25 -0800 (PST) X-IronPort-AV: E=McAfee;i="6500,9779,10532"; a="96201646" X-IronPort-AV: E=Sophos;i="5.96,167,1665414000"; d="scan'208";a="96201646" Received: from unknown (HELO oym-r4.gw.nic.fujitsu.com) ([210.162.30.92]) by esa1.hc1455-7.c3s2.iphmx.com with ESMTP; 16 Nov 2022 17:20:23 +0900 Received: from oym-m2.gw.nic.fujitsu.com (oym-nat-oym-m2.gw.nic.fujitsu.com [192.168.87.59]) by oym-r4.gw.nic.fujitsu.com (Postfix) with ESMTP id 04CC77C06D; Wed, 16 Nov 2022 17:20:23 +0900 (JST) Received: from kws-ab2.gw.nic.fujitsu.com (kws-ab2.gw.nic.fujitsu.com [192.51.206.12]) by oym-m2.gw.nic.fujitsu.com (Postfix) with ESMTP id 3D646BF4BE; Wed, 16 Nov 2022 17:20:22 +0900 (JST) Received: from FNSTPC.g08.fujitsu.local (unknown [10.167.226.45]) by kws-ab2.gw.nic.fujitsu.com (Postfix) with ESMTP id 1A1C72340D44; Wed, 16 Nov 2022 17:20:21 +0900 (JST) From: Li Zhijian To: zyjzyj2000@gmail.com, jgg@ziepe.ca, leon@kernel.org, Bob Pearson , linux-rdma@vger.kernel.org Cc: Mark Bloch , Tom Talpey , tomasz.gromadzki@intel.com, Dan Williams , Xiao Yang , y-goto@fujitsu.com, linux-kernel@vger.kernel.org, Li Zhijian Subject: [for-next PATCH v6 06/10] RDMA/rxe: Implement RC RDMA FLUSH service in requester side Date: Wed, 16 Nov 2022 16:19:47 +0800 Message-Id: <20221116081951.32750-7-lizhijian@fujitsu.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221116081951.32750-1-lizhijian@fujitsu.com> References: <20221116081951.32750-1-lizhijian@fujitsu.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-TM-AS-Product-Ver: IMSS-9.1.0.1408-9.0.0.1002-27266.006 X-TM-AS-User-Approved-Sender: Yes X-TMASE-Version: IMSS-9.1.0.1408-9.0.1002-27266.006 X-TMASE-Result: 10--10.252600-10.000000 X-TMASE-MatchedRID: HCSAtt429UxlJTodqNqEzqoXHZz/dXlxTfK5j0EZbyuOGDxcvp6O0NRO 61VnsdOoe+eZU8eiw0YoSJ1XMXiioS/7QU2czuUNA9lly13c/gH5UnqVnIHSz3d17Y6gGqDC6e5 QS/V7c1m06G7pnRwyhvAdrFuuWv7hGAdnzrnkM48URSScn+QSXhhJCIHRlO51+gtHj7OwNO2+Ij sEEOIzYjL84OLhkMCxZ0euVv0fkqCRvdpWl/qzTr+bH/d4eRAT X-TMASE-SNAP-Result: 1.821001.0001-0-1-22:0,33:0,34:0-0 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749640579957414910?= X-GMAIL-MSGID: =?utf-8?q?1749640579957414910?= Implement FLUSH request operation in the requester. Reviewed-by: Zhu Yanjun Signed-off-by: Li Zhijian --- V4: Remove flush union for legecy API, add WR_FLUSH_MASK V3: Fix sparse: incorrect type in assignment; Reported-by: kernel test robot V2: extend flush to include length field. --- drivers/infiniband/sw/rxe/rxe_req.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/sw/rxe/rxe_req.c b/drivers/infiniband/sw/rxe/rxe_req.c index 41f1d84f0acb..b4e098298f25 100644 --- a/drivers/infiniband/sw/rxe/rxe_req.c +++ b/drivers/infiniband/sw/rxe/rxe_req.c @@ -241,6 +241,9 @@ static int next_opcode_rc(struct rxe_qp *qp, u32 opcode, int fits) IB_OPCODE_RC_SEND_ONLY_WITH_IMMEDIATE : IB_OPCODE_RC_SEND_FIRST; + case IB_WR_FLUSH: + return IB_OPCODE_RC_FLUSH; + case IB_WR_RDMA_READ: return IB_OPCODE_RC_RDMA_READ_REQUEST; @@ -421,11 +424,18 @@ static struct sk_buff *init_req_packet(struct rxe_qp *qp, /* init optional headers */ if (pkt->mask & RXE_RETH_MASK) { - reth_set_rkey(pkt, ibwr->wr.rdma.rkey); + if (pkt->mask & RXE_FETH_MASK) + reth_set_rkey(pkt, ibwr->wr.flush.rkey); + else + reth_set_rkey(pkt, ibwr->wr.rdma.rkey); reth_set_va(pkt, wqe->iova); reth_set_len(pkt, wqe->dma.resid); } + /* Fill Flush Extension Transport Header */ + if (pkt->mask & RXE_FETH_MASK) + feth_init(pkt, ibwr->wr.flush.type, ibwr->wr.flush.level); + if (pkt->mask & RXE_IMMDT_MASK) immdt_set_imm(pkt, ibwr->ex.imm_data); @@ -484,6 +494,9 @@ static int finish_packet(struct rxe_qp *qp, struct rxe_av *av, memset(pad, 0, bth_pad(pkt)); } + } else if (pkt->mask & RXE_FLUSH_MASK) { + /* oA19-2: shall have no payload. */ + wqe->dma.resid = 0; } return 0;