From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 549CCC43331 for ; Mon, 11 Nov 2019 18:47:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 234FA21655 for ; Mon, 11 Nov 2019 18:47:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573498035; bh=kTmUC/kT/1UyJ9+YbANHS2wxCM4gFA/irWodXxNT4e4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=m9PS+ShCJT6zofJzdroacr1LZhGhfdptXzZWDlOMkmliftSZi4U63229hT1FqZ8Am oJLZAsJf4K/Zj0Hcg6rSlDck9GqsxPuM4FZpM/dzzbh31o6/KlpN/yHvAktGihGWld 5zmvm1zDslQ9lr8nHu+te4v0B9hCwIlThkkVVLqY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730083AbfKKSrN (ORCPT ); Mon, 11 Nov 2019 13:47:13 -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