stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Aya Levin <ayal@mellanox.com>,
	Tariq Toukan <tariqt@mellanox.com>,
	Saeed Mahameed <saeedm@mellanox.com>,
	Sasha Levin <sashal@kernel.org>
Subject: [PATCH 5.2 24/94] net/mlx5e: Fix error flow of CQE recovery on tx reporter
Date: Sun,  8 Sep 2019 13:41:20 +0100	[thread overview]
Message-ID: <20190908121151.131522925@linuxfoundation.org> (raw)
In-Reply-To: <20190908121150.420989666@linuxfoundation.org>

[ Upstream commit 276d197e70bcc47153592f4384675b51c7d83aba ]

CQE recovery function begins with test and set of recovery bit. Add an
error flow which ensures clearing of this bit when leaving the recovery
function, to allow further recoveries to take place. This allows removal
of clearing recovery bit on sq activate.

Fixes: de8650a82071 ("net/mlx5e: Add tx reporter support")
Signed-off-by: Aya Levin <ayal@mellanox.com>
Reviewed-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 .../net/ethernet/mellanox/mlx5/core/en/reporter_tx.c | 12 ++++++++----
 drivers/net/ethernet/mellanox/mlx5/core/en_main.c    |  1 -
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c
index c1caf14bc3346..c7f86453c6384 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c
@@ -80,17 +80,17 @@ static int mlx5e_tx_reporter_err_cqe_recover(struct mlx5e_txqsq *sq)
 	if (err) {
 		netdev_err(dev, "Failed to query SQ 0x%x state. err = %d\n",
 			   sq->sqn, err);
-		return err;
+		goto out;
 	}
 
 	if (state != MLX5_SQC_STATE_ERR)
-		return 0;
+		goto out;
 
 	mlx5e_tx_disable_queue(sq->txq);
 
 	err = mlx5e_wait_for_sq_flush(sq);
 	if (err)
-		return err;
+		goto out;
 
 	/* At this point, no new packets will arrive from the stack as TXQ is
 	 * marked with QUEUE_STATE_DRV_XOFF. In addition, NAPI cleared all
@@ -99,13 +99,17 @@ static int mlx5e_tx_reporter_err_cqe_recover(struct mlx5e_txqsq *sq)
 
 	err = mlx5e_sq_to_ready(sq, state);
 	if (err)
-		return err;
+		goto out;
 
 	mlx5e_reset_txqsq_cc_pc(sq);
 	sq->stats->recover++;
+	clear_bit(MLX5E_SQ_STATE_RECOVERING, &sq->state);
 	mlx5e_activate_txqsq(sq);
 
 	return 0;
+out:
+	clear_bit(MLX5E_SQ_STATE_RECOVERING, &sq->state);
+	return err;
 }
 
 static int mlx5_tx_health_report(struct devlink_health_reporter *tx_reporter,
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
index 882d26b8095da..bbdfdaf06391a 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -1279,7 +1279,6 @@ err_free_txqsq:
 void mlx5e_activate_txqsq(struct mlx5e_txqsq *sq)
 {
 	sq->txq = netdev_get_tx_queue(sq->channel->netdev, sq->txq_ix);
-	clear_bit(MLX5E_SQ_STATE_RECOVERING, &sq->state);
 	set_bit(MLX5E_SQ_STATE_ENABLED, &sq->state);
 	netdev_tx_reset_queue(sq->txq);
 	netif_tx_start_queue(sq->txq);
-- 
2.20.1




  parent reply	other threads:[~2019-09-08 12:56 UTC|newest]

Thread overview: 104+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-08 12:40 [PATCH 5.2 00/94] 5.2.14-stable review Greg Kroah-Hartman
2019-09-08 12:40 ` [PATCH 5.2 01/94] mld: fix memory leak in mld_del_delrec() Greg Kroah-Hartman
2019-09-08 12:40 ` [PATCH 5.2 02/94] net: fix skb use after free in netpoll Greg Kroah-Hartman
2019-09-08 12:40 ` [PATCH 5.2 03/94] net: sched: act_sample: fix psample group handling on overwrite Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 04/94] net_sched: fix a NULL pointer deref in ipt action Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 05/94] net: stmmac: dwmac-rk: Dont fail if phy regulator is absent Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 06/94] tcp: inherit timestamp on mtu probe Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 07/94] tcp: remove empty skb from write queue in error cases Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 08/94] nfp: flower: prevent ingress block binds on internal ports Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 09/94] nfp: flower: handle neighbour events " Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 10/94] Revert "r8152: napi hangup fix after disconnect" Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 11/94] r8152: remove calling netif_napi_del Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 12/94] taprio: Fix kernel panic in taprio_destroy Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 13/94] taprio: Set default link speed to 10 Mbps in taprio_set_picos_per_byte Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 14/94] net/sched: cbs: Set default link speed to 10 Mbps in cbs_set_port_rate Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 15/94] Add genphy_c45_config_aneg() function to phy-c45.c Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 16/94] net: dsa: tag_8021q: Future-proof the reserved fields in the custom VID Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 17/94] net/sched: pfifo_fast: fix wrong dereference in pfifo_fast_enqueue Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 18/94] net/sched: pfifo_fast: fix wrong dereference when qdisc is reset Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 19/94] net/rds: Fix info leak in rds6_inc_info_copy() Greg Kroah-Hartman
     [not found]   ` <CAFcO6XPJM9gej3N0on-6rdF0CeMu+aBSnyMW5buPde_a7_ViFQ@mail.gmail.com>
2019-09-12  9:40     ` Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 20/94] batman-adv: Fix netlink dumping of all mcast_flags buckets Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 21/94] libbpf: fix erroneous multi-closing of BTF FD Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 22/94] libbpf: set BTF FD for prog only when there is supported .BTF.ext data Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 23/94] netfilter: nf_flow_table: fix offload for flows that are subject to xfrm Greg Kroah-Hartman
2019-09-08 12:41 ` Greg Kroah-Hartman [this message]
2019-09-08 12:41 ` [PATCH 5.2 25/94] clk: samsung: Change signature of exynos5_subcmus_init() function Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 26/94] clk: samsung: exynos5800: Move MAU subsystem clocks to MAU sub-CMU Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 27/94] clk: samsung: exynos542x: Move MSCL subsystem clocks to its sub-CMU Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 28/94] net: tundra: tsi108: use spin_lock_irqsave instead of spin_lock_irq in IRQ context Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 29/94] netfilter: nf_tables: use-after-free in failing rule with bound set Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 30/94] netfilter: nf_flow_table: conntrack picks up expired flows Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 31/94] netfilter: nf_flow_table: teardown flow timeout race Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 32/94] tools: bpftool: fix error message (prog -> object) Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 33/94] ixgbe: fix possible deadlock in ixgbe_service_task() Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 34/94] hv_netvsc: Fix a warning of suspicious RCU usage Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 35/94] net: tc35815: Explicitly check NET_IP_ALIGN is not zero in tc35815_rx Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 36/94] Bluetooth: btqca: Add a short delay before downloading the NVM Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 37/94] Bluetooth: hci_qca: Send VS pre shutdown command Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 38/94] Bluetooth: hidp: Let hidp_send_message return number of queued bytes Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 39/94] s390/qeth: serialize cmd reply with concurrent timeout Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 40/94] ibmveth: Convert multicast list size for little-endian system Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 41/94] gpio: Fix build error of function redefinition Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 42/94] netfilter: nft_flow_offload: skip tcp rst and fin packets Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 43/94] drm/mediatek: use correct device to import PRIME buffers Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 44/94] drm/mediatek: set DMA max segment size Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 45/94] scsi: qla2xxx: Fix gnl.l memory leak on adapter init failure Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 46/94] scsi: target: tcmu: avoid use-after-free after command timeout Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 47/94] cxgb4: fix a memory leak bug Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 48/94] selftests: kvm: do not try running the VM in vmx_set_nested_state_test Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 49/94] selftests: kvm: provide common function to enable eVMCS Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 50/94] selftests: kvm: fix vmx_set_nested_state_test Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 51/94] liquidio: add cleanup in octeon_setup_iq() Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 52/94] net: myri10ge: fix memory leaks Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 53/94] clk: Fix falling back to legacy parent string matching Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 54/94] clk: Fix potential NULL dereference in clk_fetch_parent_index() Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 55/94] lan78xx: Fix memory leaks Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 56/94] vfs: fix page locking deadlocks when deduping files Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 57/94] cx82310_eth: fix a memory leak bug Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 58/94] net: kalmia: fix memory leaks Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 59/94] ibmvnic: Unmap DMA address of TX descriptor buffers after use Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 60/94] net: cavium: fix driver name Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 61/94] wimax/i2400m: fix a memory leak bug Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 62/94] ravb: Fix use-after-free ravb_tstamp_skb Greg Kroah-Hartman
2019-09-08 12:41 ` [PATCH 5.2 63/94] sched/core: Schedule new worker even if PI-blocked Greg Kroah-Hartman
2019-09-08 12:42 ` [PATCH 5.2 64/94] kprobes: Fix potential deadlock in kprobe_optimizer() Greg Kroah-Hartman
2019-09-08 12:42 ` [PATCH 5.2 65/94] HID: intel-ish-hid: ipc: add EHL device id Greg Kroah-Hartman
2019-09-08 12:42 ` [PATCH 5.2 66/94] HID: cp2112: prevent sleeping function called from invalid context Greg Kroah-Hartman
2019-09-08 12:42 ` [PATCH 5.2 67/94] x86/boot/compressed/64: Fix boot on machines with broken E820 table Greg Kroah-Hartman
2019-09-08 12:42 ` [PATCH 5.2 68/94] scsi: lpfc: Mitigate high memory pre-allocation by SCSI-MQ Greg Kroah-Hartman
2019-09-08 12:42 ` [PATCH 5.2 69/94] Input: hyperv-keyboard: Use in-place iterator API in the channel callback Greg Kroah-Hartman
2019-09-08 12:42 ` [PATCH 5.2 70/94] Tools: hv: kvp: eliminate may be used uninitialized warning Greg Kroah-Hartman
2019-09-08 12:42 ` [PATCH 5.2 71/94] nvme-multipath: fix possible I/O hang when paths are updated Greg Kroah-Hartman
2019-09-08 12:42 ` [PATCH 5.2 72/94] nvme: Fix cntlid validation when not using NVMEoF Greg Kroah-Hartman
2019-09-08 12:42 ` [PATCH 5.2 73/94] RDMA/cma: fix null-ptr-deref Read in cma_cleanup Greg Kroah-Hartman
2019-09-08 12:42 ` [PATCH 5.2 74/94] IB/mlx4: Fix memory leaks Greg Kroah-Hartman
2019-09-08 12:42 ` [PATCH 5.2 75/94] infiniband: hfi1: fix a memory leak bug Greg Kroah-Hartman
2019-09-08 12:42 ` [PATCH 5.2 76/94] infiniband: hfi1: fix memory leaks Greg Kroah-Hartman
2019-09-08 12:42 ` [PATCH 5.2 77/94] selftests: kvm: fix state save/load on processors without XSAVE Greg Kroah-Hartman
2019-09-08 12:42 ` [PATCH 5.2 78/94] selftests/kvm: make platform_info_test pass on AMD Greg Kroah-Hartman
2019-09-08 12:42 ` [PATCH 5.2 79/94] drm/amdgpu: prevent memory leaks in AMDGPU_CS ioctl Greg Kroah-Hartman
2019-09-08 12:42 ` [PATCH 5.2 80/94] ceph: fix buffer free while holding i_ceph_lock in __ceph_setxattr() Greg Kroah-Hartman
2019-09-08 12:42 ` [PATCH 5.2 81/94] ceph: fix buffer free while holding i_ceph_lock in __ceph_build_xattrs_blob() Greg Kroah-Hartman
2019-09-08 12:42 ` [PATCH 5.2 82/94] ceph: fix buffer free while holding i_ceph_lock in fill_inode() Greg Kroah-Hartman
2019-09-08 12:42 ` [PATCH 5.2 83/94] KVM: arm/arm64: Only skip MMIO insn once Greg Kroah-Hartman
2019-09-08 12:42 ` [PATCH 5.2 84/94] afs: Fix leak in afs_lookup_cell_rcu() Greg Kroah-Hartman
2019-09-08 12:42 ` [PATCH 5.2 85/94] afs: Fix possible oops in afs_lookup trace event Greg Kroah-Hartman
2019-09-08 12:42 ` [PATCH 5.2 86/94] afs: use correct afs_call_type in yfs_fs_store_opaque_acl2 Greg Kroah-Hartman
2019-09-08 12:42 ` [PATCH 5.2 87/94] RDMA/bnxt_re: Fix stack-out-of-bounds in bnxt_qplib_rcfw_send_message Greg Kroah-Hartman
2019-09-08 12:42 ` [PATCH 5.2 88/94] gpio: Fix irqchip initialization order Greg Kroah-Hartman
2019-09-08 12:42 ` [PATCH 5.2 89/94] KVM: arm/arm64: VGIC: Properly initialise private IRQ affinity Greg Kroah-Hartman
2019-09-08 12:42 ` [PATCH 5.2 90/94] x86/boot/compressed/64: Fix missing initialization in find_trampoline_placement() Greg Kroah-Hartman
2019-09-08 12:42 ` [PATCH 5.2 91/94] libceph: allow ceph_buffer_put() to receive a NULL ceph_buffer Greg Kroah-Hartman
2019-09-08 12:42 ` [PATCH 5.2 92/94] Revert "x86/apic: Include the LDR when clearing out APIC registers" Greg Kroah-Hartman
2019-09-08 12:42 ` [PATCH 5.2 93/94] x86/boot: Preserve boot_params.secure_boot from sanitizing Greg Kroah-Hartman
2019-09-08 12:42 ` [PATCH 5.2 94/94] Revert "mmc: core: do not retry CMD6 in __mmc_switch()" Greg Kroah-Hartman
2019-09-09  5:54 ` [PATCH 5.2 00/94] 5.2.14-stable review Naresh Kamboju
2019-09-09  9:02   ` Greg Kroah-Hartman
2019-09-09 15:00 ` Bharath Vedartham
2019-09-09 16:05   ` Greg Kroah-Hartman
2019-09-09 19:40 ` Guenter Roeck
2019-09-09 22:58   ` Greg Kroah-Hartman
2019-09-10  9:20 ` Jon Hunter
2019-09-10  9:29   ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190908121151.131522925@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=ayal@mellanox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=saeedm@mellanox.com \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tariqt@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).