Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp6553223ybx; Mon, 11 Nov 2019 10:50:55 -0800 (PST) X-Google-Smtp-Source: APXvYqzNQqrQSHFEE6mieef4u2KijidU0luhhcjUUnHys040IcSOqi3lp8YAhbk+pKQJC8HmLh/F X-Received: by 2002:a17:906:2e81:: with SMTP id o1mr24121825eji.284.1573498254961; Mon, 11 Nov 2019 10:50:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573498254; cv=none; d=google.com; s=arc-20160816; b=i73VGE4Ozpo6Hbm6jHwozDWMjVWpw3biHz2r9rWuRIB1Q+thjRQe7CuNcSnChb+kus BIWBV4fKv7qUNz167bcJ3Y2zfTCNdlzXYw9HBL+opd4CLPYP0AH3c7v11MAPWQx9DtQ4 5faj6llTrElt1IPFdrm27ImiHp6MH4PdteW6VLIcJitAC449x4cznbr1W+sGntHkmHL6 TtXhEEWszC1Difk8EPZhuQVmwkZ1FVUGPP0WbHh5zxoS/UV1+HPREvtQxwJ4KO6RG4Jv GCslTCnRYtH4SRVp5TKWk8mEDXidKZ76d74EWOqaeYP69+llNk7iUX0dAet9Hvr3ChzN fG9w== 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=o8VKlJ2LpxstNT7NTBzaV04IEuvYdvk5+cw+4bV2IRg=; b=nzeMdXUG1wyPcUbu6Rpcd99AdDIeZqRvWKF+UonPH1AmPC/hQAGBb23HTBcNsUKMb2 guodZj/JTFD8PmOWk6nMe8GzoG3J63UKBrC1T57w9EGF2JbSVVeAwVsTL4qFd3Af1Phs ZTpcD82lOE5uxklJuffUclmCAYKNTvbLxwdmBdBWfRAUWimqsG0Rn9AEOPTgA0D42ahf 7ypIWlwA/8gPsdup/MdAwisfvPl4AGYDwt8INQg7B3MdtvnAOthvm6FhkeunP1smTh+v U5RIMIbNGoSCu8ehDTaC8R3IgIpMpJ8u5BjVwQ3WdJaiQ5lIee8MvbJb1Tjr35ra/QwK DqWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="W1DQIu/w"; 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 o10si11602987edc.39.2019.11.11.10.50.31; Mon, 11 Nov 2019 10:50:54 -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="W1DQIu/w"; 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 S1730077AbfKKSrM (ORCPT + 99 others); Mon, 11 Nov 2019 13:47:12 -0500 Received: from mail.kernel.org ([198.145.29.99]:39830 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730072AbfKKSrK (ORCPT ); Mon, 11 Nov 2019 13:47:10 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.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 4AE8420659; Mon, 11 Nov 2019 18:47:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573498028; bh=kTmUC/kT/1UyJ9+YbANHS2wxCM4gFA/irWodXxNT4e4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W1DQIu/w8DkDRVP7JUPUcupmaodhB+8a87+5BdEPAfRuhI1UqxXAdZcENJIHajL4e UYesyl6gopIp4IFcS5Nt/Tlg7ci1A3FOvNt3LmO3AqyfVVDfmHOASfIR2aMMtwNp/V RwPIPkzn0fninhQpNFbzipFcU8DokrXcZ3054v2s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tariq Toukan , Saeed Mahameed , Sasha Levin Subject: [PATCH 4.19 077/125] net/mlx5e: TX, Fix consumer index of error cqe dump Date: Mon, 11 Nov 2019 19:28:36 +0100 Message-Id: <20191111181450.396864099@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191111181438.945353076@linuxfoundation.org> References: <20191111181438.945353076@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Tariq Toukan [ Upstream commit 61ea02d2c13106116c6e4916ac5d9dd41151c959 ] The completion queue consumer index increments upon a call to mlx5_cqwq_pop(). When dumping an error CQE, the index is already incremented. Decrease one for the print command. Fixes: 16cc14d81733 ("net/mlx5e: Dump xmit error completions") Signed-off-by: Tariq Toukan Signed-off-by: Saeed Mahameed Signed-off-by: Sasha Levin --- drivers/net/ethernet/mellanox/mlx5/core/en_tx.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c index 0b03d65474e93..73dce92c41c44 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c @@ -462,7 +462,10 @@ netdev_tx_t mlx5e_xmit(struct sk_buff *skb, struct net_device *dev) static void mlx5e_dump_error_cqe(struct mlx5e_txqsq *sq, struct mlx5_err_cqe *err_cqe) { - u32 ci = mlx5_cqwq_get_ci(&sq->cq.wq); + struct mlx5_cqwq *wq = &sq->cq.wq; + u32 ci; + + ci = mlx5_cqwq_ctr2ix(wq, wq->cc - 1); netdev_err(sq->channel->netdev, "Error cqe on cqn 0x%x, ci 0x%x, sqn 0x%x, syndrome 0x%x, vendor syndrome 0x%x\n", -- 2.20.1