From patchwork Tue Dec 6 13:01:57 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: 30288 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2808534wrr; Tue, 6 Dec 2022 05:07:27 -0800 (PST) X-Google-Smtp-Source: AA0mqf6F9MR205/f41fQRcfgIcpfyUMq6lDATVNb3ZLySkczmPh0FK3ozSxWKArGw7XYNXZIeD4C X-Received: by 2002:a17:906:6681:b0:7ae:732d:bc51 with SMTP id z1-20020a170906668100b007ae732dbc51mr11010044ejo.549.1670332047145; Tue, 06 Dec 2022 05:07:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670332047; cv=none; d=google.com; s=arc-20160816; b=jhuZdzcz2e+YPqI0/xLpUUgPt/ySBseiNtTvp6sB88cuPpzZvxN2zppZfrKw/0VOJN X5NIMuiBBGb12PXVhqziuqrjfx0r7k33tmgWU68OmYK7/z7jKAbwFqrL/atJryqfXx9A y6XohuW5A09k5Djl1qZO1kg405ij2tI5a4OD3rgftOJ+qzQWren2egfXeDU4AJXSrfFZ xhdkFfNQwrETBgOXELv/19GMXcEdE7gXCYgsP6X08OPJr7wpHDSxTxqG8j1oOn8aQiNe z/akyeKRCpmGuHhW+o80EzUxSmTIBjckH0rrvX+tB0qgbij6uDEidOzkWF7o0I0ZYBgu q+eg== 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=waHFjYTC2Eo3Nt40EQzC6MHK9tNYlrwepBb+FphjFf4=; b=mNF/8dd8BU5Y1JaRr7QkEX/sJeW0Id0n8gRRr5/Kl1BRZzvs6KvzZ9/8ZfsE1xu8GG 79ukOr1x3IhSxJPFugx8XGPoRxM+zuBZpvDfQetOUzsiTb5n/dDk+i2zZjYRCkPTgBVT woHM+OJ3+3ihkBA5HpoY3qveU3KpIPIUMlft8Ac9PV/RI9IZC/GaOOJkBtLQH/SFBVLr V3RHbm6HX8vZ+LCVxapJmShz2B0O8DmAUz4LQRIiev2sfsVhKrlxW1dyzNGGvIfGxz7D TMeEsc5TrhxMu3YRQNlOx3pi9heJ8vl/xJNUZjlE+rkzaQp0s8Fmw4s4E/E8ZUIohO/J otGQ== 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 ji22-20020a170907981600b007c118b2d91dsi104774ejc.248.2022.12.06.05.06.50; Tue, 06 Dec 2022 05:07:27 -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 S234267AbiLFNDq (ORCPT + 99 others); Tue, 6 Dec 2022 08:03:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234771AbiLFNCV (ORCPT ); Tue, 6 Dec 2022 08:02:21 -0500 Received: from esa11.hc1455-7.c3s2.iphmx.com (esa11.hc1455-7.c3s2.iphmx.com [207.54.90.137]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 15B47BF6C; Tue, 6 Dec 2022 05:02:18 -0800 (PST) X-IronPort-AV: E=McAfee;i="6500,9779,10552"; a="78294256" X-IronPort-AV: E=Sophos;i="5.96,222,1665414000"; d="scan'208";a="78294256" Received: from unknown (HELO yto-r1.gw.nic.fujitsu.com) ([218.44.52.217]) by esa11.hc1455-7.c3s2.iphmx.com with ESMTP; 06 Dec 2022 22:02:18 +0900 Received: from yto-m3.gw.nic.fujitsu.com (yto-nat-yto-m3.gw.nic.fujitsu.com [192.168.83.66]) by yto-r1.gw.nic.fujitsu.com (Postfix) with ESMTP id DA72CD66A6; Tue, 6 Dec 2022 22:02:16 +0900 (JST) Received: from kws-ab2.gw.nic.fujitsu.com (kws-ab2.gw.nic.fujitsu.com [192.51.206.12]) by yto-m3.gw.nic.fujitsu.com (Postfix) with ESMTP id 248C2D9690; Tue, 6 Dec 2022 22:02:16 +0900 (JST) Received: from FNSTPC.g08.fujitsu.local (unknown [10.167.226.45]) by kws-ab2.gw.nic.fujitsu.com (Postfix) with ESMTP id 11B8B234090F; Tue, 6 Dec 2022 22:02:15 +0900 (JST) From: Li Zhijian To: Bob Pearson , Leon Romanovsky , Jason Gunthorpe , linux-rdma@vger.kernel.org Cc: Zhu Yanjun , yangx.jy@fujitsu.com, y-goto@fujitsu.com, mbloch@nvidia.com, tom@talpey.com, tomasz.gromadzki@intel.com, dan.j.williams@intel.com, linux-kernel@vger.kernel.org, Li Zhijian Subject: [for-next PATCH 06/10] RDMA/rxe: Implement RC RDMA FLUSH service in requester side Date: Tue, 6 Dec 2022 21:01:57 +0800 Message-Id: <20221206130201.30986-7-lizhijian@fujitsu.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221206130201.30986-1-lizhijian@fujitsu.com> References: <20221206130201.30986-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-27306.007 X-TM-AS-User-Approved-Sender: Yes X-TMASE-Version: IMSS-9.1.0.1408-9.0.1002-27306.007 X-TMASE-Result: 10--9.008700-10.000000 X-TMASE-MatchedRID: HCSAtt429UxlJTodqNqEzqoXHZz/dXlxTfK5j0EZbyuOGDxcvp6O0NRO 61VnsdOoe+eZU8eiw0YoSJ1XMXiioS/7QU2czuUNA9lly13c/gH5UnqVnIHSz3d17Y6gGqDC6e5 QS/V7c1m06G7pnRwyhvAdrFuuWv7h0iwpZ2mlIeyeAiCmPx4NwBnUJ0Ek6yhjxEHRux+uk8h+IC quNi0WJHzGZ8sz4uTMFxZF9ulC9QnHrbBmxvdoqpEnyERxit6tftwZ3X11IV0= 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?1751470096875230988?= X-GMAIL-MSGID: =?utf-8?q?1751470096875230988?= 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 2713e9058922..899c8779f800 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; @@ -425,11 +428,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); @@ -488,6 +498,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; } if (pkt->mask & RXE_ATOMIC_WRITE_MASK) {