Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp647951imu; Fri, 11 Jan 2019 06:46:23 -0800 (PST) X-Google-Smtp-Source: ALg8bN6nGsMCi0ZWjgkrbwWhBgfsXNMNIumkHzomMCzQXvWXNbNH830DIZbSEgjKYgZ4m44ozukt X-Received: by 2002:a63:3e05:: with SMTP id l5mr12760822pga.96.1547217983293; Fri, 11 Jan 2019 06:46:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547217983; cv=none; d=google.com; s=arc-20160816; b=mj0vMyXCLedZhlgkgIbduVco3aKle93GmOu68eyfstyM1IWUfxWCUobyq4i+UYj7pw 299yMzKc1M8XHBTqkwpXjFnWgV1sivvKN5HSsAlNqcctHD9FIkU9Hc3McCN5odo2DLv2 loZAeS7A7cyvkK4RxCaCYXxetVyS/xA92tUgVJmfy0SbclY4WwFzWrJ8dp+/jYb/MyrW 5cl1e24zHboEucQGUAbDHDzLKQg3a2KP31kCkEph91Y0xi1NJV50Z4WR9sSVFMvcgVVQ CB51afobNtYb5pguBjVGDx4aVpAlStW7wWwNcygjj5cWChRXnMYIZtUPjYL7GoEl4/W1 YLEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Py1v1acVAmVTczcoli3oFiEdM0uhex7vBoRa3LpLOXo=; b=PIISO+8w3uPpGbuT9HsR8Rf+JI2GpeDwgL/f7pzsV10VdJfzhrj9GcX6zOqVmdmMw/ 8bWhd4HVTV7JeT1TSElY0Og8LMqythHsK2w3DFxFK+Hqf4qOG4xfQxlp/PFLwLYPuPGt dzg1Z6/CJZWTLu4XhtlEF6RPcWe/lQBIMIdc0ZY6mLaR3zHOg7yXdnIssyRGH7EyU7IJ 1qOMz494pd4oZninK/lagcwVLnpgJ+FR4uq+3Npx8PzEPpL2cdrVZWBosa6fHB/1h3Kz lgKWiyKhK9/0yKCZP8bEB2ZIFbCbhpCZaj4iGgJ/QbGUSNsDcfLFW2Bit6TAJ7Nh2b7D y3Kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bTzHiVhg; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t9si1854228pfk.35.2019.01.11.06.46.08; Fri, 11 Jan 2019 06:46:23 -0800 (PST) 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=@kernel.org header.s=default header.b=bTzHiVhg; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404356AbfAKOnX (ORCPT + 99 others); Fri, 11 Jan 2019 09:43:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:36216 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391233AbfAKOnU (ORCPT ); Fri, 11 Jan 2019 09:43:20 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2515E206B6; Fri, 11 Jan 2019 14:43:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1547217799; bh=2FKYDrv2RvWzwH1z43V3xN215TqJ5H87Tw6aOTxO3x0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bTzHiVhgQ42P8hyDHizrLgWv3gnynchf2cp2RISD61QE10B2fspKUEmFkrZ5BNJma T2GsP5chUQMDQ2X3tZ/IyjuWSIlGU3GpuxBY1SdF5DkmuQDRjHA12J7rImYcOGDJ1J xzeMdAdKG9AGYMQiKApSMLfBbhy0IVBUysqbXZBw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Walker Benjamin , Sagi Grimberg , Zhu Yanjun , Doug Ledford Subject: [PATCH 4.20 46/65] rxe: fix error completion wr_id and qp_num Date: Fri, 11 Jan 2019 15:15:32 +0100 Message-Id: <20190111131102.638135073@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190111131055.331350141@linuxfoundation.org> References: <20190111131055.331350141@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sagi Grimberg commit e48d8ed9c6193502d849b35767fd18e20bbd7ba2 upstream. Error completions must still contain a valid wr_id and qp_num such that the consumer can rely on. Correctly fill these fields in receive error completions. Reported-by: Walker Benjamin Cc: stable@vger.kernel.org Signed-off-by: Sagi Grimberg Reviewed-by: Zhu Yanjun Tested-by: Zhu Yanjun Signed-off-by: Doug Ledford Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/sw/rxe/rxe_resp.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) --- a/drivers/infiniband/sw/rxe/rxe_resp.c +++ b/drivers/infiniband/sw/rxe/rxe_resp.c @@ -844,11 +844,16 @@ static enum resp_states do_complete(stru memset(&cqe, 0, sizeof(cqe)); - wc->wr_id = wqe->wr_id; - wc->status = qp->resp.status; - wc->qp = &qp->ibqp; + if (qp->rcq->is_user) { + uwc->status = qp->resp.status; + uwc->qp_num = qp->ibqp.qp_num; + uwc->wr_id = wqe->wr_id; + } else { + wc->status = qp->resp.status; + wc->qp = &qp->ibqp; + wc->wr_id = wqe->wr_id; + } - /* fields after status are not required for errors */ if (wc->status == IB_WC_SUCCESS) { wc->opcode = (pkt->mask & RXE_IMMDT_MASK && pkt->mask & RXE_WRITE_MASK) ?