patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH 20.11] net/nfp: cancel delayed LSC work in port close logic
@ 2021-11-12  6:51 heinrich.kuhn
  2021-11-27 14:34 ` Xueming(Steven) Li
  0 siblings, 1 reply; 2+ messages in thread
From: heinrich.kuhn @ 2021-11-12  6:51 UTC (permalink / raw)
  To: stable; +Cc: Heinrich Kuhn, Simon Horman

From: Heinrich Kuhn <heinrich.kuhn@corigine.com>

[ upstream commit 851f03e1eab7d29a81078832b49f2977e9562524 ]

The link state change interrupt handler of the NFP PMD will delay the
actual LSC work for a short period to ensure the link is stable. If the
link of the port changes state and the port is closed immediately after
the link event then a segmentation fault will occur. This happens
because the delayed LSC work eventually triggers and this logic will try
to access private port data that had been released when the port was
closed.

Fixes: 6c53f87b3497 ("nfp: add link status interrupt")
Cc: stable@dpdk.org

Signed-off-by: Heinrich Kuhn <heinrich.kuhn@corigine.com>
Signed-off-by: Simon Horman <simon.horman@corigine.com>
---
 drivers/net/nfp/nfp_net.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
index 91c6678c7..39a6d3f57 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -907,6 +907,10 @@ nfp_net_close(struct rte_eth_dev *dev)
 				     nfp_net_dev_interrupt_handler,
 				     (void *)dev);
 
+	/* Cancel possible impending LSC work here before releasing the port*/
+	rte_eal_alarm_cancel(nfp_net_dev_interrupt_delayed_handler,
+			     (void *)dev);
+
 	/*
 	 * The ixgbe PMD driver disables the pcie master on the
 	 * device. The i40e does not...
-- 
2.30.1 (Apple Git-130)


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-stable] [PATCH 20.11] net/nfp: cancel delayed LSC work in port close logic
  2021-11-12  6:51 [dpdk-stable] [PATCH 20.11] net/nfp: cancel delayed LSC work in port close logic heinrich.kuhn
@ 2021-11-27 14:34 ` Xueming(Steven) Li
  0 siblings, 0 replies; 2+ messages in thread
From: Xueming(Steven) Li @ 2021-11-27 14:34 UTC (permalink / raw)
  To: heinrich.kuhn, stable; +Cc: simon.horman

On Fri, 2021-11-12 at 08:51 +0200, heinrich.kuhn@corigine.com wrote:
> From: Heinrich Kuhn <heinrich.kuhn@corigine.com>
> 
> [ upstream commit 851f03e1eab7d29a81078832b49f2977e9562524 ]
> 
> The link state change interrupt handler of the NFP PMD will delay the
> actual LSC work for a short period to ensure the link is stable. If the
> link of the port changes state and the port is closed immediately after
> the link event then a segmentation fault will occur. This happens
> because the delayed LSC work eventually triggers and this logic will try
> to access private port data that had been released when the port was
> closed.
> 
> Fixes: 6c53f87b3497 ("nfp: add link status interrupt")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Heinrich Kuhn <heinrich.kuhn@corigine.com>
> Signed-off-by: Simon Horman <simon.horman@corigine.com>
> ---

Applied to 20.11.4 list, thanks!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-27 14:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-12  6:51 [dpdk-stable] [PATCH 20.11] net/nfp: cancel delayed LSC work in port close logic heinrich.kuhn
2021-11-27 14:34 ` Xueming(Steven) Li

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git