DPDK patches and discussions
 help / color / mirror / Atom feed
From: Matan Azrad <matan@mellanox.com>
To: Gaetan Rivet <gaetan.rivet@6wind.com>
Cc: dev@dpdk.org, Ophir Munk <ophirmu@mellanox.com>, stable@dpdk.org
Subject: [dpdk-dev] [PATCH v2 2/2] net/failsafe: fix duplicate event registration
Date: Mon, 21 May 2018 19:48:04 +0000	[thread overview]
Message-ID: <1526932084-1120-2-git-send-email-matan@mellanox.com> (raw)
In-Reply-To: <1526932084-1120-1-git-send-email-matan@mellanox.com>

When the fail-safe device is reconfigured, it attempts to register
again for the sub-devices LSC and RMV events.

Prevent an event registration if it is already done.

Fixes: 598fb8aec6f6 ("net/failsafe: support device removal")
Cc: stable@dpdk.org

Signed-off-by: Matan Azrad <matan@mellanox.com>
---
 drivers/net/failsafe/failsafe_ops.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/failsafe/failsafe_ops.c b/drivers/net/failsafe/failsafe_ops.c
index e0570b6..24e91c9 100644
--- a/drivers/net/failsafe/failsafe_ops.c
+++ b/drivers/net/failsafe/failsafe_ops.c
@@ -138,7 +138,7 @@
 			fs_unlock(dev, 0);
 			return ret;
 		}
-		if (rmv_interrupt) {
+		if (rmv_interrupt && sdev->rmv_callback == 0) {
 			ret = rte_eth_dev_callback_register(PORT_ID(sdev),
 					RTE_ETH_EVENT_INTR_RMV,
 					failsafe_eth_rmv_event_callback,
@@ -150,7 +150,7 @@
 				sdev->rmv_callback = 1;
 		}
 		dev->data->dev_conf.intr_conf.rmv = 0;
-		if (lsc_interrupt) {
+		if (lsc_interrupt && sdev->lsc_callback == 0) {
 			ret = rte_eth_dev_callback_register(PORT_ID(sdev),
 						RTE_ETH_EVENT_INTR_LSC,
 						failsafe_eth_lsc_event_callback,
-- 
1.9.5

  reply	other threads:[~2018-05-21 19:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-17 18:52 [dpdk-dev] [PATCH 1/2] net/failsafe: fix removed sub-device cleanup Matan Azrad
2018-05-17 18:52 ` [dpdk-dev] [PATCH 2/2] net/failsafe: fix duplicate event registraton Matan Azrad
2018-05-21 18:13 ` [dpdk-dev] [PATCH 1/2] net/failsafe: fix removed sub-device cleanup Ophir Munk
2018-05-21 19:48 ` [dpdk-dev] [PATCH v2 " Matan Azrad
2018-05-21 19:48   ` Matan Azrad [this message]
2018-05-22  8:56   ` Gaëtan Rivet
2018-05-22 10:19     ` Matan Azrad
2018-05-22 11:53       ` Gaëtan Rivet
2018-05-22 12:09         ` Matan Azrad
2018-05-22 12:38   ` [dpdk-dev] [PATCH v3 " Matan Azrad
2018-05-22 12:38     ` [dpdk-dev] [PATCH v3 2/2] net/failsafe: fix duplicate event registration Matan Azrad
2018-05-22 13:15       ` Gaëtan Rivet
2018-05-22 13:14     ` [dpdk-dev] [PATCH v3 1/2] net/failsafe: fix removed sub-device cleanup Gaëtan Rivet
2018-05-22 13:59       ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit

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=1526932084-1120-2-git-send-email-matan@mellanox.com \
    --to=matan@mellanox.com \
    --cc=dev@dpdk.org \
    --cc=gaetan.rivet@6wind.com \
    --cc=ophirmu@mellanox.com \
    --cc=stable@dpdk.org \
    /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).