[dpdk-dev] [PATCH] net/failsafe: fix Rx interrupt reinstallation
Matan Azrad
matan at mellanox.com
Tue Feb 13 23:59:32 CET 2018
Fail-safe dev_start() operation can be called by both the application
and the hot-plug alarm mechanism.
The installation of Rx interrupt are triggered from dev_start() in any
time it is called while actually the Rx interrupt should be installed
only by the application calls.
So, each plug-in event causes reinstallation which causes memory leak.
Trigger the Rx interrupt installation only for application calls.
Fixes: 9e0360aebf23 ("net/failsafe: register as Rx interrupt mode")
Signed-off-by: Matan Azrad <matan at mellanox.com>
---
drivers/net/failsafe/failsafe_ops.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/net/failsafe/failsafe_ops.c b/drivers/net/failsafe/failsafe_ops.c
index 057e435..bbbd335 100644
--- a/drivers/net/failsafe/failsafe_ops.c
+++ b/drivers/net/failsafe/failsafe_ops.c
@@ -181,10 +181,12 @@
int ret;
fs_lock(dev, 0);
- ret = failsafe_rx_intr_install(dev);
- if (ret) {
- fs_unlock(dev, 0);
- return ret;
+ if (PRIV(dev)->alarm_lock == 0) {
+ ret = failsafe_rx_intr_install(dev);
+ if (ret) {
+ fs_unlock(dev, 0);
+ return ret;
+ }
}
FOREACH_SUBDEV(sdev, i, dev) {
if (sdev->state != DEV_ACTIVE)
--
1.9.5
More information about the dev
mailing list