summaryrefslogtreecommitdiff
path: root/drivers/net/failsafe
diff options
context:
space:
mode:
authorMatan Azrad <matan@mellanox.com>2018-05-22 12:38:47 +0000
committerFerruh Yigit <ferruh.yigit@intel.com>2018-05-23 00:35:01 +0200
commit602c5623c8a884036aa81712f89542159a243a58 (patch)
treeb4e9d6eedb31a588d1360aefcccacdc8a4174a04 /drivers/net/failsafe
parent0545c580fc377d33711786eaed665ee60e801bbd (diff)
downloaddpdk-next-eventdev-602c5623c8a884036aa81712f89542159a243a58.zip
dpdk-next-eventdev-602c5623c8a884036aa81712f89542159a243a58.tar.gz
dpdk-next-eventdev-602c5623c8a884036aa81712f89542159a243a58.tar.xz
net/failsafe: fix duplicate event registration
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> Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Diffstat (limited to 'drivers/net/failsafe')
-rw-r--r--drivers/net/failsafe/failsafe_ops.c4
1 files 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_dev_configure(struct rte_eth_dev *dev)
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 @@ fs_dev_configure(struct rte_eth_dev *dev)
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,