From patchwork Wed Nov 16 08:19:49 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: 20794 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp22939wru; Wed, 16 Nov 2022 00:27:53 -0800 (PST) X-Google-Smtp-Source: AA0mqf7Dr4nHc4cFxWVqgYAoDf4Jtamx3jYSmMTmBrbbgljm4n1Iw/EOQ3od2aOcCShUv1ygbhDd X-Received: by 2002:aa7:8656:0:b0:562:d99c:2f66 with SMTP id a22-20020aa78656000000b00562d99c2f66mr21929158pfo.42.1668587273473; Wed, 16 Nov 2022 00:27:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668587273; cv=none; d=google.com; s=arc-20160816; b=Gg55P3vz6yRkX3lIwbNjOm3Wm0Gs4Z/xOuoWoicLvI4q0wGqXQXNh1iAU1GpkCyHLO 2tL0WW5EMiv/5mNCZa3hKhkzT45q3XC9A37WkUQVh4U2XTm5NqFF/7ZAxbVcvwoX4TI8 Hc86TDlPzVO5q+d60cHEN/LqLQGV2VLZuIEI6+p5Z8GLMSTQIwUtTEQ5EQITojcBQaPy a69v8I9vNFBXFVbDVXf+wB0iIs/NbUwse0Vz23+RQJGYGYtsciO+Ot/cA7kT1otmntGw DQUycW/MujP1Z0C8OkIKjIsT483PWm4MyfEpttn/gwX3W+iJGuw7yrFfOJ7j+eFo6PT3 rtkg== 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=obXCrNmMWRHku5qSh/jKpNMFRaLzd4oyqx2trsCIkgA=; b=FI1m63qIXx/TfwoPhOMEhbpk2otEqGrQpTBjbgVjyrK6SJc544BYDMTmaw1cOvv9lB HWAniNH8EgogcFA4EG8PrccrgHjC00EiJwRtKFz/zeN+bwEQ8LSCLmEu6kQKzzm6agNG rN/dJ6pAbLGYnTFmsUx0MGyKLZkFNbM9u59vjCOAe9qhxHgO8xPlhnHXH3OCAMdp2Ss4 ur2vKrnmcy3zESAFHXhu6lfKDb99H0nerw1aMs1HM0ZX6vzKufjr6FVrQEPsEbrEdzHH 2RzNwVsuph8s9ToVmfxHmFJ9ok/koh2GcE89c6PHTHQ982bf69tlMq5wraOpyjW6o/AP 0mow== 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 o10-20020a170902d4ca00b00186f1c070f7si16895747plg.395.2022.11.16.00.27.40; Wed, 16 Nov 2022 00:27:53 -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 S238280AbiKPIVW (ORCPT + 99 others); Wed, 16 Nov 2022 03:21:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232891AbiKPIUa (ORCPT ); Wed, 16 Nov 2022 03:20:30 -0500 Received: from esa5.hc1455-7.c3s2.iphmx.com (esa5.hc1455-7.c3s2.iphmx.com [68.232.139.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2FFA64D8; Wed, 16 Nov 2022 00:20:26 -0800 (PST) X-IronPort-AV: E=McAfee;i="6500,9779,10532"; a="95718119" X-IronPort-AV: E=Sophos;i="5.96,167,1665414000"; d="scan'208";a="95718119" Received: from unknown (HELO yto-r3.gw.nic.fujitsu.com) ([218.44.52.219]) by esa5.hc1455-7.c3s2.iphmx.com with ESMTP; 16 Nov 2022 17:20:26 +0900 Received: from yto-m4.gw.nic.fujitsu.com (yto-nat-yto-m4.gw.nic.fujitsu.com [192.168.83.67]) by yto-r3.gw.nic.fujitsu.com (Postfix) with ESMTP id A84F7E8523; Wed, 16 Nov 2022 17:20:24 +0900 (JST) Received: from kws-ab2.gw.nic.fujitsu.com (kws-ab2.gw.nic.fujitsu.com [192.51.206.12]) by yto-m4.gw.nic.fujitsu.com (Postfix) with ESMTP id DF219F687; Wed, 16 Nov 2022 17:20:23 +0900 (JST) Received: from FNSTPC.g08.fujitsu.local (unknown [10.167.226.45]) by kws-ab2.gw.nic.fujitsu.com (Postfix) with ESMTP id AF3DF2340D44; Wed, 16 Nov 2022 17:20:22 +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 08/10] RDMA/rxe: Implement flush completion Date: Wed, 16 Nov 2022 16:19:49 +0800 Message-Id: <20221116081951.32750-9-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--2.732800-10.000000 X-TMASE-MatchedRID: pif/TqAgu++ojsVP+osNyI4V8tCoXo/SwTlc9CcHMZerwqxtE531VNnf JrUSEbFDd5/rOwjY0ImeLHNUN8SOI5cLewwAa76fzr16YOzjZ119LQinZ4QefCP/VFuTOXUTae6 hIZpj4MuOhzOa6g8KrYhqyxShGnRGx798Plu9yxIE26s1WQHjCSXbKa0srDJrpBEF2/vs3ZUY9z x6kKakIEBcpLkb91UbHI/mIDtwBKhK6rUsKZM+ehXBt/mUREyAj/ZFF9Wfm7hNy7ppG0IjcFQqk 0j7vLVUewMSBDreIdk= 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?1749640568791797280?= X-GMAIL-MSGID: =?utf-8?q?1749640568791797280?= Per IBA SPEC, FLUSH will ack in rdma read response with 0 length. Use IB_WC_FLUSH (aka IB_UVERBS_WC_FLUSH) code to tell userspace a FLUSH completion. Reviewed-by: Zhu Yanjun Signed-off-by: Li Zhijian --- drivers/infiniband/sw/rxe/rxe_comp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/sw/rxe/rxe_comp.c b/drivers/infiniband/sw/rxe/rxe_comp.c index 66f392810c86..12252ac6b5c2 100644 --- a/drivers/infiniband/sw/rxe/rxe_comp.c +++ b/drivers/infiniband/sw/rxe/rxe_comp.c @@ -104,6 +104,7 @@ static enum ib_wc_opcode wr_to_wc_opcode(enum ib_wr_opcode opcode) case IB_WR_LOCAL_INV: return IB_WC_LOCAL_INV; case IB_WR_REG_MR: return IB_WC_REG_MR; case IB_WR_BIND_MW: return IB_WC_BIND_MW; + case IB_WR_FLUSH: return IB_WC_FLUSH; default: return 0xff; @@ -274,7 +275,8 @@ static inline enum comp_state check_ack(struct rxe_qp *qp, */ case IB_OPCODE_RC_RDMA_READ_RESPONSE_MIDDLE: if (wqe->wr.opcode != IB_WR_RDMA_READ && - wqe->wr.opcode != IB_WR_RDMA_READ_WITH_INV) { + wqe->wr.opcode != IB_WR_RDMA_READ_WITH_INV && + wqe->wr.opcode != IB_WR_FLUSH) { wqe->status = IB_WC_FATAL_ERR; return COMPST_ERROR; }