Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3539111imu; Mon, 7 Jan 2019 05:18:21 -0800 (PST) X-Google-Smtp-Source: ALg8bN4lNDkuG6goo3SvVryHNqmEowCdTnWsw0z3cG/+EnXjadz62S9EtkNHeRZGCxb+THWXgz8M X-Received: by 2002:a63:2263:: with SMTP id t35mr10862030pgm.69.1546867101836; Mon, 07 Jan 2019 05:18:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546867101; cv=none; d=google.com; s=arc-20160816; b=f/YzHW2HwZfkIqxymiI0FmwIBfuJIWPZTIHZw1y2kJ5+cEYXBW+EbDw+aLRZUr9A32 rJOusJSxeuh8ALaItNOrmn9RuUpFweeAEn86rQ0GqbpBjyeJt5mmlHiDg0g+dI88GJp4 10w5K8zaGr/+/jVODoB6s8SuWwEZWGOVRrccR/BRmkbXCTFjSroJA5rd+5xHJHrTdN3f dsg32wl//gOPTpsj/HCvfV2MyxQzzifl7t2tnZ05H2o5urJ1FWH95FytD+UcZQx/jMXY Oej6FszkUD8LXsQG2f9lYVvYnUG+v/pVOlW+jR0cuNZk2UYZr+jUyfPW5SJ3KEAovoN7 ucbw== 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=f1N39gJoOCI2glEsEq4+K2RGGCCqyhJSNS1XugaRdOI=; b=qqFtn6GaCnHURl3ttpjEa942B+xZ/4Yxs7hXAuXmFdLF+Y5oicxNe/gb/kX5fqDLyS az9BQ6OMyld3FfWcPpTkKr/9/uKiJ0Gku438ZiHMjpEFQnZOUZe0LlmLHV+5DZfOTgvO IpbJI5BnH1roQV6KVuykm/YAIc8MzfG36pPbkSLopupfaR957H2cx/0RnRAfALrfh2Ki P80nzbysestIVXz6+teLBe8f7iQ5IlUaJVb/Uzef4/c2h2onzZTHfshFtTwSsSgY8Bf8 cD3ddlfi8JnAm1fqzljPIx4RVI955XsUwb17jF5vc5D/Icori9dkJTqK6U0XACfiY+GQ 83jA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=sZfTWgZi; 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 r2si11244556pgo.483.2019.01.07.05.18.06; Mon, 07 Jan 2019 05:18:21 -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=sZfTWgZi; 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 S1730466AbfAGNQa (ORCPT + 99 others); Mon, 7 Jan 2019 08:16:30 -0500 Received: from mail.kernel.org ([198.145.29.99]:48286 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730276AbfAGNAs (ORCPT ); Mon, 7 Jan 2019 08:00:48 -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 A5ECD2089F; Mon, 7 Jan 2019 13:00:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1546866048; bh=HuISApKfbACKKP0WuGwY7RuVmvRE/6r8XikO9LgIal4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sZfTWgZi0fM5GNOHgTbUUoVMncLzBekuPXP1UB/NGdC3Y+WLzLu3putq5RG9ZuikU LZTaFvrQCEIVXfQBH7qsaofx9B8G9eEuQ+VBS5gzjMC0HXxOUDuQJGn2gTmvDYbCK/ bDAtZnxux9OdRzOjruOavHKz/wueaowRpUe2bdEI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tariq Toukan , Eran Ben Elisha , Saeed Mahameed Subject: [PATCH 4.14 028/101] net/mlx5e: RX, Fix wrong early return in receive queue poll Date: Mon, 7 Jan 2019 13:32:16 +0100 Message-Id: <20190107105334.450169310@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190107105330.372621917@linuxfoundation.org> References: <20190107105330.372621917@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.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tariq Toukan [ Upstream commit bfc698254ba97b3e3e4ebbfae0ffa1f7e2fa0717 ] When the completion queue of the RQ is empty, do not immediately return. If left-over decompressed CQEs (from the previous cycle) were processed, need to go to the finalization part of the poll function. Bug exists only when CQE compression is turned ON. This solves the following issue: mlx5_core 0000:82:00.1: mlx5_eq_int:544:(pid 0): CQ error on CQN 0xc08, syndrome 0x1 mlx5_core 0000:82:00.1 p4p2: mlx5e_cq_error_event: cqn=0x000c08 event=0x04 Fixes: 4b7dfc992514 ("net/mlx5e: Early-return on empty completion queues") Signed-off-by: Tariq Toukan Reviewed-by: Eran Ben Elisha Signed-off-by: Saeed Mahameed Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c @@ -1072,7 +1072,7 @@ mpwrq_cqe_out: int mlx5e_poll_rx_cq(struct mlx5e_cq *cq, int budget) { struct mlx5e_rq *rq = container_of(cq, struct mlx5e_rq, cq); - struct mlx5e_xdpsq *xdpsq; + struct mlx5e_xdpsq *xdpsq = &rq->xdpsq; struct mlx5_cqe64 *cqe; int work_done = 0; @@ -1083,10 +1083,11 @@ int mlx5e_poll_rx_cq(struct mlx5e_cq *cq work_done += mlx5e_decompress_cqes_cont(rq, cq, 0, budget); cqe = mlx5_cqwq_get_cqe(&cq->wq); - if (!cqe) + if (!cqe) { + if (unlikely(work_done)) + goto out; return 0; - - xdpsq = &rq->xdpsq; + } do { if (mlx5_get_cqe_format(cqe) == MLX5_COMPRESSED) { @@ -1101,6 +1102,7 @@ int mlx5e_poll_rx_cq(struct mlx5e_cq *cq rq->handle_rx_cqe(rq, cqe); } while ((++work_done < budget) && (cqe = mlx5_cqwq_get_cqe(&cq->wq))); +out: if (xdpsq->db.doorbell) { mlx5e_xmit_xdp_doorbell(xdpsq); xdpsq->db.doorbell = false;