Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp2804074iob; Mon, 16 May 2022 06:40:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwD3eNwwDFGTvpQB7hjsF0qA/Z7LSNsmBELq+jeNToixaOzIi1CgGtFKkUro/gF6UKv0YWI X-Received: by 2002:a17:906:a10e:b0:6f3:e70b:b572 with SMTP id t14-20020a170906a10e00b006f3e70bb572mr14975949ejy.546.1652708407875; Mon, 16 May 2022 06:40:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652708407; cv=none; d=google.com; s=arc-20160816; b=kD8sT9D2fJWaV+KftbDIEST5Xv9qkwlk2cCv0ArQml81fLRhBfJz296scRk4J/Ft3z ZKNBmrvkZ4V/ktG3TV4/cd1hUX3/VXmZuD1ZVjni2uJHozNVDOfrebNmFwQhcU4qyKfV HuApw1pAP52oucOFaDNsJNFr/DzP0yPV//4W475oNd2sdx59dhxQ+xTYM5aDtNivAFSG W8cbG64Men3cY3deXGw221L8EkZRrWpPpDrAuJz3QNrcFv9QDoP/Oi8sjwrxem0KH376 cPawfCJL3YpwWMW1uNWyLSjvuFWGS9HH1iHk5Ve20g40rsFjOuOdrWy+1vkUIGHi+flV LzpA== 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 :ironport-hdrordr:ironport-data; bh=OqNDdiqdi7uzHrGbo0Xel/SgnEx7oEWZtrvOMgD9BzI=; b=JVcQkUSmQAibhFoj904qSKRrn4usTyxj2o4SFytfrAi0XyqEbGe3BGIDT7QgWtJOba Uvhx9RhT4/hD6rh4igJlmIZaHDx/+raPcBdLtbtAVVaPuZAK6w4SdONgKUkxldFs1ReY xOHOIywlTIpBl+xHmdbXc0pp2jzaCZoOO8/FoqXn+mXIO/JYhMFtVM4EF/uTl0z6l7Ow y6qrMAAKBLOPjLColxdZ40HoLzd/aOVXJ+cRWPtsORjG8YfaPKUqN7wFHr58vAMkfCam l0hqgkSLuWRopy3DqcZkViO1C4roLWGVmusDafoO9Q9o24bRT3zFWisPjkHWZ/dVEg/7 KYSg== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gu15-20020a170906f28f00b006f3997f2199si9705793ejb.328.2022.05.16.06.39.39; Mon, 16 May 2022 06:40:07 -0700 (PDT) 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 S239139AbiEPBrB (ORCPT + 99 others); Sun, 15 May 2022 21:47:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239111AbiEPBq4 (ORCPT ); Sun, 15 May 2022 21:46:56 -0400 Received: from heian.cn.fujitsu.com (mail.cn.fujitsu.com [183.91.158.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 32886389E; Sun, 15 May 2022 18:46:54 -0700 (PDT) IronPort-Data: =?us-ascii?q?A9a23=3AM+o5x6/wV6F32GYsfiaPDrUDFHyTJUtcMsCJ2f8?= =?us-ascii?q?bfWQNrUp3hD0CmzdLWGjUafjca2LyKY12OYi3/BsC7ZLdx4I2GldlrnsFo1Bi8?= =?us-ascii?q?5ScXYvDRqvT04J+FuWaFQQ/qZx2huDodKjYdVeB4Ef9WlTdhSMkj/vQHOKlULe?= =?us-ascii?q?s1h1ZHmeIdg9w0HqPpMZp2uaEsfDha++8kYuaT//3YTdJ6BYoWo4g0J9vnTs01?= =?us-ascii?q?BjEVJz0iXRlDRxDlAe2e3D4l/vzL4npR5fzatE88uJX24/+IL+FEmPxp3/BC/u?= =?us-ascii?q?ulPD1b08LXqXPewOJjxK6WYD72l4b+HN0if19aZLwam8O49mNt9Rw2tVMt525T?= =?us-ascii?q?y8nI6/NhP8AFRJfFkmSOIUfouOdfCDj75f7I0ruNiGEL+9VJEo2MIsX6+FqKWV?= =?us-ascii?q?P8+EIbjkJbxqKjevwy7W+IsF9j8IhMc+tLoMCknVhyyzJS/orX/jrQ6zD5them?= =?us-ascii?q?j0tic9DNfHEbsEdZHxkaxGoSxlOPEoHTZEzhuGlglHhfDBC7lGYv6w65y7U1gM?= =?us-ascii?q?Z+LzsNsfFP8aGQMx9gEmVvCTF8n7/DxVcM8aQoRKH/X2ElO7ChS69U4t6KVES3?= =?us-ascii?q?paGm3XKnipKVkJQDgD9/JGEZoeFc4o3AyQpFuAG98DeLHCWc+Q=3D?= IronPort-HdrOrdr: =?us-ascii?q?A9a23=3A7YLr76ph+apSaKbcm3opM9IaV5oXeYIsimQD?= =?us-ascii?q?101hICG9E/bo8/xG+c536faaslgssQ4b8+xoVJPgfZq+z+8R3WByB8bAYOCOgg?= =?us-ascii?q?LBQ72KhrGSoQEIdRefysdtkY9kc4VbTOb7FEVGi6/BizWQIpINx8am/cmT6dvj?= =?us-ascii?q?8w=3D=3D?= X-IronPort-AV: E=Sophos;i="5.88,333,1635177600"; d="scan'208";a="124250463" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 16 May 2022 09:46:50 +0800 Received: from G08CNEXMBPEKD04.g08.fujitsu.local (unknown [10.167.33.201]) by cn.fujitsu.com (Postfix) with ESMTP id DFD334D68A24; Mon, 16 May 2022 09:46:45 +0800 (CST) Received: from G08CNEXCHPEKD07.g08.fujitsu.local (10.167.33.80) by G08CNEXMBPEKD04.g08.fujitsu.local (10.167.33.201) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Mon, 16 May 2022 09:46:47 +0800 Received: from localhost.localdomain (10.167.225.141) by G08CNEXCHPEKD07.g08.fujitsu.local (10.167.33.209) with Microsoft SMTP Server id 15.0.1497.23 via Frontend Transport; Mon, 16 May 2022 09:46:47 +0800 From: Li Zhijian To: Yanjun Zhu , Jason Gunthorpe , "Haakon Bugge" , Cheng Xu , CC: , Li Zhijian Subject: [PATCH v3 2/2] RDMA/rxe: Generate error completion for error requester QP state Date: Mon, 16 May 2022 09:53:29 +0800 Message-ID: <20220516015329.445474-3-lizhijian@fujitsu.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220516015329.445474-1-lizhijian@fujitsu.com> References: <20220516015329.445474-1-lizhijian@fujitsu.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-yoursite-MailScanner-ID: DFD334D68A24.AF984 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: lizhijian@fujitsu.com X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 As per IBTA specification, all subsequent WQEs while QP is in error state should be completed with a flush error. Here we check QP_STATE_ERROR after req_next_wqe() so that rxe_completer() has chance to be called where it will set CQ state to FLUSH ERROR and the completion can associate with its WQE. Signed-off-by: Li Zhijian --- V3: unlikely() optimization # Cheng Xu update commit log # Haakon Bugge --- drivers/infiniband/sw/rxe/rxe_req.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/sw/rxe/rxe_req.c b/drivers/infiniband/sw/rxe/rxe_req.c index 8bdd0b6b578f..c1f1c19f26b2 100644 --- a/drivers/infiniband/sw/rxe/rxe_req.c +++ b/drivers/infiniband/sw/rxe/rxe_req.c @@ -624,7 +624,7 @@ int rxe_requester(void *arg) rxe_get(qp); next_wqe: - if (unlikely(!qp->valid || qp->req.state == QP_STATE_ERROR)) + if (unlikely(!qp->valid)) goto exit; if (unlikely(qp->req.state == QP_STATE_RESET)) { @@ -646,6 +646,14 @@ int rxe_requester(void *arg) if (unlikely(!wqe)) goto exit; + if (unlikely(qp->req.state == QP_STATE_ERROR)) { + /* + * Generate an error completion so that user space is able to + * poll this completion. + */ + goto err; + } + if (wqe->mask & WR_LOCAL_OP_MASK) { ret = rxe_do_local_ops(qp, wqe); if (unlikely(ret)) -- 2.31.1