net/iavf: fix application reset callback calls

Message ID 20240117115410.3984237-1-david.marchand@redhat.com (mailing list archive)
State Rejected, archived
Delegated to: Qi Zhang
Headers
Series net/iavf: fix application reset callback calls |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/github-robot: build success github build: passed
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/iol-sample-apps-testing success Testing PASS

Commit Message

David Marchand Jan. 17, 2024, 11:54 a.m. UTC
  Don't trigger an application reset callback if the port is not started.

Bugzilla ID: 1337
Fixes: 675a104e2e94 ("net/iavf: fix abnormal disable HW interrupt")
Cc: stable@dpdk.org

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 drivers/net/iavf/iavf_vchnl.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
  

Comments

David Marchand Feb. 1, 2024, 8:58 a.m. UTC | #1
On Wed, Jan 17, 2024 at 12:54 PM David Marchand
<david.marchand@redhat.com> wrote:
>
> Don't trigger an application reset callback if the port is not started.
>
> Bugzilla ID: 1337
> Fixes: 675a104e2e94 ("net/iavf: fix abnormal disable HW interrupt")
> Cc: stable@dpdk.org
>
> Signed-off-by: David Marchand <david.marchand@redhat.com>

I am withdrawing this patch.
As I mentionned in the bugzilla, this patch is probably introducing races.

I don't have the time/expertise to look deeper into this driver, and
it does not seem like Intel will invest in fixing this.

Fyi, I sent a patch on the ethdev API recommending not to use locks in
application event callbacks.
Reviews welcome.

Thanks.
  

Patch

diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c
index 0a3e1d082c..14dfe313b7 100644
--- a/drivers/net/iavf/iavf_vchnl.c
+++ b/drivers/net/iavf/iavf_vchnl.c
@@ -88,7 +88,10 @@  iavf_dev_event_handle(void *param __rte_unused)
 				continue;
 			}
 
-			rte_eth_dev_callback_process(pos->dev, pos->event, pos->param);
+			/* Don't invoke an application reset callback if not started yet. */
+			if (pos->event != RTE_ETH_EVENT_INTR_RESET ||
+					pos->dev->data->dev_started != 0)
+				rte_eth_dev_callback_process(pos->dev, pos->event, pos->param);
 			rte_free(pos);
 		}
 	}