Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp3989702pxb; Mon, 4 Oct 2021 14:34:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3JZ51Xdpj/8QVJ0KjaUMT9jZrTNCWrcVrqt0x5kdBVox82JDKULEVCtK5MDTM+YWYVI5g X-Received: by 2002:a17:906:948:: with SMTP id j8mr18925621ejd.371.1633383288116; Mon, 04 Oct 2021 14:34:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633383288; cv=none; d=google.com; s=arc-20160816; b=dFdKBprcnieOZ0swdOiEFGkcNaP6ZYnkMo7ucmGAMWuM8Lt0tg/SmWLvdC6QQeRyHW g7dqcOqepJzs7XjpryGnZN6jOD8GxFzNc9z1ZyHt6KdAX7S7tUFLosVYUz+EnRrp2/fq 6YZxCvGD7Nz6sbMgRR6Dm+93WOLM+UwdKt6lvqntimmqOgwcu1OIUR0JmfTtTvLYJ3fl NVwasdvnUyEPcpevMCeKWLFWbnVN6v8IXIIK9KszP6BD49ZzEL0TGMc7Itk59lN/u70a 8ytBTjO/6j6W4EmY6glOFf26bA1+k6FsMaFHZOLTQIToDuZeCZb6I6j1SEaav/0P03hn kxiw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=XUfczXqlYyAAarEGivdxY6Qind1cd7UrmOOieE8KNyA=; b=0LjReupc4HCen9CUp7m6DJwWTKxehkOLXx3oj66U54PAwGCzBKkDGj5uxEIPdrmyQT mlJ5q7KGYCWx8s/nPVdUI4ANBm72+bSkcYe/JYyJmhmYVtFO6o88j+GlR9JrhaTzxg72 HZSm7U9+m743ONmt7EGgKIHlfoapWhQQGY/4q9+s08bXxb//XJkEb3Q1DGfdMgDPdepO jaIFN4/lSyUBK1m9/Xz2C0htDjyW1JjGE+siNiquTvC3KiDmS6GOo/WT8bw0nOS+2xhI uZ4EQSjjMgD9FS40pGT2JcXdfBpmyT9wYmVejTfpeGGoL+pvudRCA9URn/VtEEQXNxiy r3Vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eKFEa4SR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jr12si11257935ejb.335.2021.10.04.14.34.24; Mon, 04 Oct 2021 14:34:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eKFEa4SR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237737AbhJDNiy (ORCPT + 99 others); Mon, 4 Oct 2021 09:38:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:51592 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237668AbhJDNgm (ORCPT ); Mon, 4 Oct 2021 09:36:42 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D4C7261053; Mon, 4 Oct 2021 13:16:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1633353395; bh=Xz0TUOjXF0iUnwdvQFRiT9f0vxgEg38Ef9OUoCkHeck=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eKFEa4SRFAiRbLxkH3H1lQGSCN/347+jhy2yipd7hoUeqOxn/gc9srlQrMxzUEWTF hNCeTjQTVh5Y58Wokaj4s7G5sKbg2qHG7B+xx781LhP6m3kSG7kS1shx/EbKTYe++6 gcw8pyJfhNB0LFoIN3xdVU3O25m7E/htRT3zWW3Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Wenpeng Liang , Jason Gunthorpe , Sasha Levin Subject: [PATCH 5.14 112/172] RDMA/hns: Fix the size setting error when copying CQE in clean_cq() Date: Mon, 4 Oct 2021 14:52:42 +0200 Message-Id: <20211004125048.601056832@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211004125044.945314266@linuxfoundation.org> References: <20211004125044.945314266@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wenpeng Liang [ Upstream commit cc26aee100588a3f293921342a307b6309ace193 ] The size of CQE is different for different versions of hardware, so the driver needs to specify the size of CQE explicitly. Fixes: 09a5f210f67e ("RDMA/hns: Add support for CQE in size of 64 Bytes") Link: https://lore.kernel.org/r/20210927125557.15031-2-liangwenpeng@huawei.com Signed-off-by: Wenpeng Liang Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c index 6cb4a4e10837..0ccb0c453f6a 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c @@ -3306,7 +3306,7 @@ static void __hns_roce_v2_cq_clean(struct hns_roce_cq *hr_cq, u32 qpn, dest = get_cqe_v2(hr_cq, (prod_index + nfreed) & hr_cq->ib_cq.cqe); owner_bit = hr_reg_read(dest, CQE_OWNER); - memcpy(dest, cqe, sizeof(*cqe)); + memcpy(dest, cqe, hr_cq->cqe_size); hr_reg_write(dest, CQE_OWNER, owner_bit); } } -- 2.33.0