Skip to contentSkip to conversation

ixgbe: Fix disable interrupt twice

PATCH Superseded Michael Qiu 5 participants 16 messages Jan 29, 2016 – Feb 26, 2016 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ixgbe: Fix disable interrupt twice

Currently, ixgbe vf and pf will disable interrupte twice in stop stage and uninit stage. It will cause an error:

testpmd> quit

Shutting down port 0...
Stopping ports...
Done
Closing ports...
EAL: Error disabling MSI-X interrupts for fd 26 Done

Becasue the interrupt already been disabled in stop stage. Since it is enabled in init stage, better remove from stop stage.

Fixes 0eb609239efd ("ixgbe: enable Rx queue interrupts for PF and VF")
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/net/ixgbe/ixgbe_ethdev.c +0 -6
index 4c4c6df..a561f8d 100644
@@ -2192,9 +2192,6 @@ ixgbe_dev_stop(struct rte_eth_dev *dev)
 	/* disable interrupts */
 	ixgbe_disable_intr(hw);
 
-	/* disable intr eventfd mapping */
-	rte_intr_disable(intr_handle);
-
 	/* reset the NIC */
 	ixgbe_pf_reset_hw(hw);
 	hw->adapter_stopped = 0;
@@ -3898,9 +3895,6 @@ ixgbevf_dev_stop(struct rte_eth_dev *dev)
 
 	ixgbe_dev_clear_queues(dev);
 
-	/* disable intr eventfd mapping */
-	rte_intr_disable(intr_handle);
-
 	/* Clean datapath event and queue/vec mapping */
 	rte_intr_efd_disable(intr_handle);
 	if (intr_handle->intr_vec != NULL) {
Signature · 1 line
1.9.3
#1 lore raw

PATCH v2 1/1 ixgbe: Fix disable interrupt twice

Currently, ixgbe vf and pf will disable interrupt twice in stop stage and uninit stage. It will cause an error:

testpmd> quit

Shutting down port 0...
Stopping ports...
Done
Closing ports...
EAL: Error disabling MSI-X interrupts for fd 26 Done

Becasue the interrupt already been disabled in stop stage. Since it is enabled in init stage, better remove from stop stage.

Fixes 0eb609239efd ("ixgbe: enable Rx queue interrupts for PF and VF")

---
v2 --> v1:
fix error in commit log word "interrupte"

 drivers/net/ixgbe/ixgbe_ethdev.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/net/ixgbe/ixgbe_ethdev.c +0 -6
index 4c4c6df..a561f8d 100644
@@ -2192,9 +2192,6 @@ ixgbe_dev_stop(struct rte_eth_dev *dev)
 	/* disable interrupts */
 	ixgbe_disable_intr(hw);
 
-	/* disable intr eventfd mapping */
-	rte_intr_disable(intr_handle);
-
 	/* reset the NIC */
 	ixgbe_pf_reset_hw(hw);
 	hw->adapter_stopped = 0;
@@ -3898,9 +3895,6 @@ ixgbevf_dev_stop(struct rte_eth_dev *dev)
 
 	ixgbe_dev_clear_queues(dev);
 
-	/* disable intr eventfd mapping */
-	rte_intr_disable(intr_handle);
-
 	/* Clean datapath event and queue/vec mapping */
 	rte_intr_efd_disable(intr_handle);
 	if (intr_handle->intr_vec != NULL) {
Signature · 1 line
1.9.3
#2 lore raw

Hi Michael,

Quoted 19 lines

-----Original Message-----
From: Qiu, Michael
Sent: Friday, January 29, 2016 1:58 PM
To: [email protected]
Cc: Zhou, Danny; Liu, Yong; Liang, Cunming; Lu, Wenzhuo; Qiu, Michael
Subject: [PATCH v2] ixgbe: Fix disable interrupt twice

Currently, ixgbe vf and pf will disable interrupt twice in stop stage and uninit stage. It will cause an error:

testpmd> quit

Shutting down port 0...
Stopping ports...
Done
Closing ports...
EAL: Error disabling MSI-X interrupts for fd 26 Done

Quoted 2 lines

Becasue the interrupt already been disabled in stop stage. Since it is enabled in init stage, better remove from stop stage.

I'm afraid it's not a good idea to just remove the intr_disable from dev_stop.
I think dev_stop have the chance to be used independently with dev_unint. In this scenario, we still need intr_disable, right? Maybe what we need is some check before we disable the intr:)

#3 lore raw
Quoted 21 lines · Wenzhuo

Hi Michael,

Quoted 19 lines

-----Original Message-----
From: Qiu, Michael
Sent: Friday, January 29, 2016 1:58 PM
To: [email protected]
Cc: Zhou, Danny; Liu, Yong; Liang, Cunming; Lu, Wenzhuo; Qiu, Michael
Subject: [PATCH v2] ixgbe: Fix disable interrupt twice

Currently, ixgbe vf and pf will disable interrupt twice in stop stage and uninit stage. It will cause an error:

testpmd> quit

Shutting down port 0...
Stopping ports...
Done
Closing ports...
EAL: Error disabling MSI-X interrupts for fd 26 Done

Quoted 5 lines
Quoted 2 lines

Becasue the interrupt already been disabled in stop stage. Since it is enabled in init stage, better remove from stop stage.

I'm afraid it’s not a good idea to just remove the intr_disable from dev_stop.
I think dev_stop have the chance to be used independently with dev_unint. In this scenario, we still need intr_disable, right? Maybe what we need is some check before we disable the intr:)

Yes, indeed we need some check in disable intr, but it need additional fields in "struct rte_intr_handle", and it's much saft to do so, but as I check i40e/fm10k code, only ixgbe disable it in dev_stop().

On other hand, if we remove it in dev_stop, any side effect? In ixgbe start, it will always disable it first and then re-enable it, so it's safe.

Thanks,
Michael

Quoted 1 line
#4 lore raw

Hi Michael,

Quoted 31 lines

-----Original Message-----
From: Qiu, Michael
Sent: Monday, February 1, 2016 4:05 PM
To: Lu, Wenzhuo; [email protected]
Cc: Zhou, Danny; Liu, Yong; Liang, Cunming
Subject: Re: [PATCH v2] ixgbe: Fix disable interrupt twice

Quoted 23 lines · Wenzhuo

Hi Michael,

Quoted 21 lines

-----Original Message-----
From: Qiu, Michael
Sent: Friday, January 29, 2016 1:58 PM
To: [email protected]
Cc: Zhou, Danny; Liu, Yong; Liang, Cunming; Lu, Wenzhuo; Qiu, Michael
Subject: [PATCH v2] ixgbe: Fix disable interrupt twice

Currently, ixgbe vf and pf will disable interrupt twice in stop stage and uninit stage. It will cause an error:

testpmd> quit

Shutting down port 0...
Stopping ports...
Done
Closing ports...
EAL: Error disabling MSI-X interrupts for fd 26 Done

Becasue the interrupt already been disabled in stop stage. Since it is enabled in init stage, better remove from stop stage.

Quoted 8 lines
Quoted 2 lines

I'm afraid it's not a good idea to just remove the intr_disable from dev_stop. I think dev_stop have the chance to be used independently with dev_unint. In

this scenario, we still need intr_disable, right?

Quoted 1 line

Maybe what we need is some check before we disable the intr:)

Yes, indeed we need some check in disable intr, but it need additional fields in "struct rte_intr_handle", and it's much saft to do so, but as I check i40e/fm10k code, only ixgbe disable it in dev_stop().

I found fm10k doesn't enable intr in dev_start. So, I think it's OK. But i40e enables intr in dev_start. To my opinion, it's more like i40e misses the intr_disable in dev_stop.
Maybe we can follow fm10k's style.

Quoted 3 lines

On other hand, if we remove it in dev_stop, any side effect? In ixgbe start, it will always disable it first and then re-enable it, so it's safe.

I think you mean we can disable intr anyway even if it has been disabled. Sounds more like why we don't need this patch :)

Quoted 4 lines

Thanks,
Michael

Quoted 1 line
#5 lore raw

[+cc helin]

Quoted 35 lines · Wenzhuo

Hi Michael,

Quoted 33 lines

-----Original Message-----
From: Qiu, Michael
Sent: Monday, February 1, 2016 4:05 PM
To: Lu, Wenzhuo; [email protected]
Cc: Zhou, Danny; Liu, Yong; Liang, Cunming
Subject: Re: [PATCH v2] ixgbe: Fix disable interrupt twice

Quoted 25 lines · Wenzhuo

Hi Michael,

Quoted 19 lines

-----Original Message-----
From: Qiu, Michael
Sent: Friday, January 29, 2016 1:58 PM
To: [email protected]
Cc: Zhou, Danny; Liu, Yong; Liang, Cunming; Lu, Wenzhuo; Qiu, Michael
Subject: [PATCH v2] ixgbe: Fix disable interrupt twice

Currently, ixgbe vf and pf will disable interrupt twice in stop stage and uninit stage. It will cause an error:

testpmd> quit

Shutting down port 0...
Stopping ports...
Done
Closing ports...
EAL: Error disabling MSI-X interrupts for fd 26 Done

Quoted 2 lines

Becasue the interrupt already been disabled in stop stage. Since it is enabled in init stage, better remove from stop stage.

I'm afraid it’s not a good idea to just remove the intr_disable from dev_stop. I think dev_stop have the chance to be used independently with dev_unint. In

Quoted 7 lines
Quoted 5 lines

this scenario, we still need intr_disable, right?

Quoted 1 line

Maybe what we need is some check before we disable the intr:)

Yes, indeed we need some check in disable intr, but it need additional fields in "struct rte_intr_handle", and it's much saft to do so, but as I check i40e/fm10k code, only ixgbe disable it in dev_stop().

I found fm10k doesn’t enable intr in dev_start. So, I think it's OK. But i40e enables intr in dev_start. To my opinion, it's more like i40e misses the intr_disable in dev_stop.

I don't think i40e miss it, because it not the right please to disable interrupt. because all interrupts are enabled in init stage.

Actually, ixgbe enable the interrupt in init stage, but in dev_start, it disable it first and re-enable, so it just the same with doing nothing about interrupt.

Just think below:

1. start the port.(interrupt already enabled in init stage, disable --> re-enable)
2. stop the port.(disable interrupt)
3. start port again(Try to disable, but failed, already disabled)

Would you think the code has issue?

Thanks,
Michael

Quoted 5 lines

Maybe we can follow fm10k's style.

Quoted 2 lines

On other hand, if we remove it in dev_stop, any side effect? In ixgbe start, it will always disable it first and then re-enable it, so it's safe.

I think you mean we can disable intr anyway even if it has been disabled.

Actually, we couldn't, DPDK call VFIO ioctl to kernel to disable interrupts, and if we try disable twice, it will return and error. That's why I mean we need a flag to show the interrupts stats. If it already disabled, we do not need call in to kernel. just return and give a warning message.

Thanks,
Michael

Quoted 6 lines

Sounds more like why we don't
need this patch :)

Quoted 2 lines

Thanks,
Michael

#6 lore raw
Quoted 65 lines

-----Original Message-----
From: Qiu, Michael
Sent: Tuesday, February 2, 2016 10:07 AM
To: Lu, Wenzhuo; [email protected]
Cc: Zhou, Danny; Liu, Yong; Liang, Cunming; Zhang, Helin
Subject: Re: [PATCH v2] ixgbe: Fix disable interrupt twice

[+cc helin]

Quoted 35 lines · Wenzhuo

Hi Michael,

Quoted 33 lines

-----Original Message-----
From: Qiu, Michael
Sent: Monday, February 1, 2016 4:05 PM
To: Lu, Wenzhuo; [email protected]
Cc: Zhou, Danny; Liu, Yong; Liang, Cunming
Subject: Re: [PATCH v2] ixgbe: Fix disable interrupt twice

Quoted 25 lines · Wenzhuo

Hi Michael,

Quoted 20 lines

-----Original Message-----
From: Qiu, Michael
Sent: Friday, January 29, 2016 1:58 PM
To: [email protected]
Cc: Zhou, Danny; Liu, Yong; Liang, Cunming; Lu, Wenzhuo; Qiu, Michael
Subject: [PATCH v2] ixgbe: Fix disable interrupt twice

Currently, ixgbe vf and pf will disable interrupt twice in stop stage and uninit stage. It will cause an error:

testpmd> quit

Shutting down port 0...
Stopping ports...
Done
Closing ports...
EAL: Error disabling MSI-X interrupts for fd 26 Done

Quoted 2 lines

Becasue the interrupt already been disabled in stop stage. Since it is enabled in init stage, better remove from stop stage.

I'm afraid it's not a good idea to just remove the intr_disable from

dev_stop.

Quoted 8 lines
Quoted 7 lines
Quoted 2 lines

I think dev_stop have the chance to be used independently with dev_unint. In

this scenario, we still need intr_disable, right?

Quoted 1 line

Maybe what we need is some check before we disable the intr:)

Yes, indeed we need some check in disable intr, but it need additional fields in "struct rte_intr_handle", and it's much saft to do so, but as I check i40e/fm10k code, only ixgbe disable it in dev_stop().

I found fm10k doesn't enable intr in dev_start. So, I think it's OK. But i40e

enables intr in dev_start.

Quoted 1 line

To my opinion, it's more like i40e misses the intr_disable in dev_stop.

I don't think i40e miss it, because it not the right please to disable interrupt. because all interrupts are enabled in init stage.

Actually, ixgbe enable the interrupt in init stage, but in dev_start, it disable it first and re-enable, so it just the same with doing nothing about interrupt.

Quoted 8 lines

Just think below:

1. start the port.(interrupt already enabled in init stage, disable --> re-enable)
2. stop the port.(disable interrupt)
3. start port again(Try to disable, but failed, already disabled)

Would you think the code has issue?

[Zhang, Helin] in ixgbe PMD, it can be seen that uninit() calls dev_close(), which calls dev_stop(). So I think the disabling can be done only in dev_stop(). All others can make use of dev_stop to disable the interrupt.

Regards,
Helin

Quoted 25 lines

Thanks,
Michael

Quoted 5 lines

Maybe we can follow fm10k's style.

Quoted 2 lines

On other hand, if we remove it in dev_stop, any side effect? In ixgbe start, it will always disable it first and then re-enable it, so it's safe.

I think you mean we can disable intr anyway even if it has been disabled.

Actually, we couldn't, DPDK call VFIO ioctl to kernel to disable interrupts, and if we try disable twice, it will return and error.
That's why I mean we need a flag to show the interrupts stats. If it already disabled, we do not need call in to kernel. just return and give a warning message.

Thanks,
Michael

Quoted 6 lines

Sounds more like why we don't
need this patch :)

Quoted 2 lines

Thanks,
Michael

Acked-by
#13 lore raw
In reply to Qiu, Michael

Hi Michael,

Quoted 62 lines

-----Original Message-----
From: Qiu, Michael
Sent: Tuesday, February 2, 2016 10:07 AM
To: Lu, Wenzhuo; [email protected]
Cc: Zhou, Danny; Liu, Yong; Liang, Cunming; Zhang, Helin
Subject: Re: [PATCH v2] ixgbe: Fix disable interrupt twice

[+cc helin]

Quoted 37 lines · Wenzhuo

Hi Michael,

Quoted 35 lines

-----Original Message-----
From: Qiu, Michael
Sent: Monday, February 1, 2016 4:05 PM
To: Lu, Wenzhuo; [email protected]
Cc: Zhou, Danny; Liu, Yong; Liang, Cunming
Subject: Re: [PATCH v2] ixgbe: Fix disable interrupt twice

Quoted 27 lines · Wenzhuo

Hi Michael,

Quoted 20 lines

-----Original Message-----
From: Qiu, Michael
Sent: Friday, January 29, 2016 1:58 PM
To: [email protected]
Cc: Zhou, Danny; Liu, Yong; Liang, Cunming; Lu, Wenzhuo; Qiu, Michael
Subject: [PATCH v2] ixgbe: Fix disable interrupt twice

Currently, ixgbe vf and pf will disable interrupt twice in stop stage and uninit stage. It will cause an error:

testpmd> quit

Shutting down port 0...
Stopping ports...
Done
Closing ports...
EAL: Error disabling MSI-X interrupts for fd 26 Done

Quoted 2 lines

Becasue the interrupt already been disabled in stop stage. Since it is enabled in init stage, better remove from stop stage.

I'm afraid it's not a good idea to just remove the intr_disable from dev_stop. I think dev_stop have the chance to be used independently with dev_unint. In

Quoted 6 lines
Quoted 5 lines

this scenario, we still need intr_disable, right?

Quoted 1 line

Maybe what we need is some check before we disable the intr:)

Yes, indeed we need some check in disable intr, but it need additional fields in "struct rte_intr_handle", and it's much saft to do so, but as I check i40e/fm10k code, only ixgbe disable it in dev_stop().

I found fm10k doesn't enable intr in dev_start. So, I think it's OK. But i40e

enables intr in dev_start.

Quoted 1 line

To my opinion, it's more like i40e misses the intr_disable in dev_stop.

I don't think i40e miss it, because it not the right please to disable interrupt. because all interrupts are enabled in init stage.

Actually, ixgbe enable the interrupt in init stage, but in dev_start, it disable it first and re-enable, so it just the same with doing nothing about interrupt.

Quoted 8 lines

Just think below:

1. start the port.(interrupt already enabled in init stage, disable --> re-enable)
2. stop the port.(disable interrupt)
3. start port again(Try to disable, but failed, already disabled)

Would you think the code has issue?

Got your point. So, dev_start/stop will not influence the state of intr enabling/disabling. The intr will be enabled/disabled during dev_init/unint.
Thanks.

Quoted 25 lines

Thanks,
Michael

Quoted 5 lines

Maybe we can follow fm10k's style.

Quoted 2 lines

On other hand, if we remove it in dev_stop, any side effect? In ixgbe start, it will always disable it first and then re-enable it, so it's safe.

I think you mean we can disable intr anyway even if it has been disabled.

Actually, we couldn't, DPDK call VFIO ioctl to kernel to disable interrupts, and if we try disable twice, it will return and error.
That's why I mean we need a flag to show the interrupts stats. If it already disabled, we do not need call in to kernel. just return and give a warning message.

Thanks,
Michael

Quoted 6 lines

Sounds more like why we don't
need this patch :)

Quoted 2 lines

Thanks,
Michael

#7 lore raw
In reply to Zhang, Helin
Quoted 70 lines · Helin
Quoted 70 lines

-----Original Message-----
From: Qiu, Michael
Sent: Tuesday, February 2, 2016 10:07 AM
To: Lu, Wenzhuo; [email protected]
Cc: Zhou, Danny; Liu, Yong; Liang, Cunming; Zhang, Helin
Subject: Re: [PATCH v2] ixgbe: Fix disable interrupt twice

[+cc helin]

Quoted 35 lines · Wenzhuo

Hi Michael,

Quoted 33 lines

-----Original Message-----
From: Qiu, Michael
Sent: Monday, February 1, 2016 4:05 PM
To: Lu, Wenzhuo; [email protected]
Cc: Zhou, Danny; Liu, Yong; Liang, Cunming
Subject: Re: [PATCH v2] ixgbe: Fix disable interrupt twice

Quoted 25 lines · Wenzhuo

Hi Michael,

Quoted 20 lines

-----Original Message-----
From: Qiu, Michael
Sent: Friday, January 29, 2016 1:58 PM
To: [email protected]
Cc: Zhou, Danny; Liu, Yong; Liang, Cunming; Lu, Wenzhuo; Qiu, Michael
Subject: [PATCH v2] ixgbe: Fix disable interrupt twice

Currently, ixgbe vf and pf will disable interrupt twice in stop stage and uninit stage. It will cause an error:

testpmd> quit

Shutting down port 0...
Stopping ports...
Done
Closing ports...
EAL: Error disabling MSI-X interrupts for fd 26 Done

Quoted 2 lines

Becasue the interrupt already been disabled in stop stage. Since it is enabled in init stage, better remove from stop stage.

I'm afraid it’s not a good idea to just remove the intr_disable from

dev_stop.

Quoted 8 lines
Quoted 7 lines
Quoted 2 lines

I think dev_stop have the chance to be used independently with dev_unint. In

this scenario, we still need intr_disable, right?

Quoted 1 line

Maybe what we need is some check before we disable the intr:)

Yes, indeed we need some check in disable intr, but it need additional fields in "struct rte_intr_handle", and it's much saft to do so, but as I check i40e/fm10k code, only ixgbe disable it in dev_stop().

I found fm10k doesn’t enable intr in dev_start. So, I think it's OK. But i40e

enables intr in dev_start.

Quoted 1 line

To my opinion, it's more like i40e misses the intr_disable in dev_stop.

I don't think i40e miss it, because it not the right please to disable interrupt. because all interrupts are enabled in init stage.

Actually, ixgbe enable the interrupt in init stage, but in dev_start, it disable it first and re-enable, so it just the same with doing nothing about interrupt.

Just think below:

1. start the port.(interrupt already enabled in init stage, disable --> re-enable)
2. stop the port.(disable interrupt)
3. start port again(Try to disable, but failed, already disabled)

Quoted 4 lines
Quoted 1 line

Would you think the code has issue?

[Zhang, Helin] in ixgbe PMD, it can be seen that uninit() calls dev_close(), which calls dev_stop(). So I think the disabling can be done only in dev_stop(). All others can make use of dev_stop to disable the interrupt.

As I said, if it is in dev_stop, it will has issue when dev_start --> dev_stop --> dev_start, this also could applied in i40e and fm10k. If you want to put it in dev_stop, better to remove enable interrupts in init stage, and only put it in dev_start.

Thanks,
Michael

Quoted 26 lines

Regards,
Helin

Quoted 22 lines

Thanks,
Michael

Quoted 5 lines

Maybe we can follow fm10k's style.

Quoted 2 lines

On other hand, if we remove it in dev_stop, any side effect? In ixgbe start, it will always disable it first and then re-enable it, so it's safe.

I think you mean we can disable intr anyway even if it has been disabled.

Actually, we couldn't, DPDK call VFIO ioctl to kernel to disable interrupts, and if we try disable twice, it will return and error.
That's why I mean we need a flag to show the interrupts stats. If it already disabled, we do not need call in to kernel. just return and give a warning message.

Thanks,
Michael

Quoted 5 lines

Sounds more like why we don't
need this patch :)

Quoted 2 lines

Thanks,
Michael

#8 lore raw
Quoted 90 lines

-----Original Message-----
From: Qiu, Michael
Sent: Tuesday, February 2, 2016 10:57 AM
To: Zhang, Helin <[email protected]>; Lu, Wenzhuo <[email protected]>; [email protected]
Cc: Zhou, Danny <[email protected]>; Liu, Yong <[email protected]>; Liang, Cunming <[email protected]>
Subject: Re: [PATCH v2] ixgbe: Fix disable interrupt twice

Quoted 47 lines · Helin
Quoted 47 lines

-----Original Message-----
From: Qiu, Michael
Sent: Tuesday, February 2, 2016 10:07 AM
To: Lu, Wenzhuo; [email protected]
Cc: Zhou, Danny; Liu, Yong; Liang, Cunming; Zhang, Helin
Subject: Re: [PATCH v2] ixgbe: Fix disable interrupt twice

[+cc helin]

Quoted 36 lines · Wenzhuo

Hi Michael,

Quoted 34 lines

-----Original Message-----
From: Qiu, Michael
Sent: Monday, February 1, 2016 4:05 PM
To: Lu, Wenzhuo; [email protected]
Cc: Zhou, Danny; Liu, Yong; Liang, Cunming
Subject: Re: [PATCH v2] ixgbe: Fix disable interrupt twice

Quoted 26 lines · Wenzhuo

Hi Michael,

Quoted 20 lines

-----Original Message-----
From: Qiu, Michael
Sent: Friday, January 29, 2016 1:58 PM
To: [email protected]
Cc: Zhou, Danny; Liu, Yong; Liang, Cunming; Lu, Wenzhuo; Qiu, Michael
Subject: [PATCH v2] ixgbe: Fix disable interrupt twice

Currently, ixgbe vf and pf will disable interrupt twice in stop stage and uninit stage. It will cause an error:

testpmd> quit

Shutting down port 0...
Stopping ports...
Done
Closing ports...
EAL: Error disabling MSI-X interrupts for fd 26 Done

Quoted 2 lines

Becasue the interrupt already been disabled in stop stage. Since it is enabled in init stage, better remove from stop stage.

I'm afraid it's not a good idea to just remove the intr_disable from

Quoted 8 lines
Quoted 8 lines

dev_stop.

Quoted 7 lines
Quoted 7 lines
Quoted 2 lines

I think dev_stop have the chance to be used independently with dev_unint. In

this scenario, we still need intr_disable, right?

Quoted 1 line

Maybe what we need is some check before we disable the intr:)

Yes, indeed we need some check in disable intr, but it need additional fields in "struct rte_intr_handle", and it's much saft to do so, but as I check i40e/fm10k code, only ixgbe disable it in

dev_stop().

Quoted 9 lines
Quoted 9 lines
Quoted 2 lines

I found fm10k doesn't enable intr in dev_start. So, I think it's OK. But i40e

enables intr in dev_start.

Quoted 1 line

To my opinion, it's more like i40e misses the intr_disable in dev_stop.

I don't think i40e miss it, because it not the right please to disable interrupt. because all interrupts are enabled in init stage.

Actually, ixgbe enable the interrupt in init stage, but in dev_start, it disable it first and re-enable, so it just the same with doing nothing about

interrupt.

Quoted 9 lines
Quoted 9 lines

Just think below:

1. start the port.(interrupt already enabled in init stage, disable -->
re-enable)
2. stop the port.(disable interrupt)
3. start port again(Try to disable, but failed, already disabled)

Quoted 3 lines
Quoted 1 line

Would you think the code has issue?

[Zhang, Helin] in ixgbe PMD, it can be seen that uninit() calls dev_close(), which calls dev_stop(). So I think the disabling can be done only in

Quoted 7 lines

dev_stop().

Quoted 1 line

All others can make use of dev_stop to disable the interrupt.

As I said, if it is in dev_stop, it will has issue when dev_start --> dev_stop --> dev_start, this also could applied in i40e and fm10k. If you want to put it in dev_stop, better to remove enable interrupts in init stage, and only put it in dev_start.

Oh, yes, you are talking about the refactoring. That's good, and reasonable. Please do more validation with LSC, mailbox, rx interrupts, to make sure there is no issue introduced.

Thanks,
Helin

Quoted 29 lines

Thanks,
Michael

Quoted 26 lines

Regards,
Helin

Quoted 22 lines

Thanks,
Michael

Quoted 5 lines

Maybe we can follow fm10k's style.

Quoted 2 lines

On other hand, if we remove it in dev_stop, any side effect? In ixgbe start, it will always disable it first and then re-enable it, so it's safe.

I think you mean we can disable intr anyway even if it has been disabled.

Actually, we couldn't, DPDK call VFIO ioctl to kernel to disable interrupts, and if we try disable twice, it will return and error. That's why I mean we need a flag to show the interrupts stats. If it already disabled, we do not need call in to kernel. just return and give a warning message.

Thanks,
Michael

Quoted 5 lines

Sounds more like why we don't
need this patch :)

Quoted 2 lines

Thanks,
Michael

#9 lore raw
Quoted 88 lines · Helin
Quoted 88 lines

-----Original Message-----
From: Qiu, Michael
Sent: Tuesday, February 2, 2016 10:57 AM
To: Zhang, Helin <[email protected]>; Lu, Wenzhuo <[email protected]>; [email protected]
Cc: Zhou, Danny <[email protected]>; Liu, Yong <[email protected]>; Liang, Cunming <[email protected]>
Subject: Re: [PATCH v2] ixgbe: Fix disable interrupt twice

Quoted 46 lines · Helin
Quoted 46 lines

-----Original Message-----
From: Qiu, Michael
Sent: Tuesday, February 2, 2016 10:07 AM
To: Lu, Wenzhuo; [email protected]
Cc: Zhou, Danny; Liu, Yong; Liang, Cunming; Zhang, Helin
Subject: Re: [PATCH v2] ixgbe: Fix disable interrupt twice

[+cc helin]

Quoted 36 lines · Wenzhuo

Hi Michael,

Quoted 34 lines

-----Original Message-----
From: Qiu, Michael
Sent: Monday, February 1, 2016 4:05 PM
To: Lu, Wenzhuo; [email protected]
Cc: Zhou, Danny; Liu, Yong; Liang, Cunming
Subject: Re: [PATCH v2] ixgbe: Fix disable interrupt twice

Quoted 26 lines · Wenzhuo

Hi Michael,

Quoted 20 lines

-----Original Message-----
From: Qiu, Michael
Sent: Friday, January 29, 2016 1:58 PM
To: [email protected]
Cc: Zhou, Danny; Liu, Yong; Liang, Cunming; Lu, Wenzhuo; Qiu, Michael
Subject: [PATCH v2] ixgbe: Fix disable interrupt twice

Currently, ixgbe vf and pf will disable interrupt twice in stop stage and uninit stage. It will cause an error:

testpmd> quit

Shutting down port 0...
Stopping ports...
Done
Closing ports...
EAL: Error disabling MSI-X interrupts for fd 26 Done

Quoted 2 lines

Becasue the interrupt already been disabled in stop stage. Since it is enabled in init stage, better remove from stop stage.

I'm afraid it’s not a good idea to just remove the intr_disable from

Quoted 8 lines
Quoted 8 lines

dev_stop.

Quoted 7 lines
Quoted 7 lines
Quoted 2 lines

I think dev_stop have the chance to be used independently with dev_unint. In

this scenario, we still need intr_disable, right?

Quoted 1 line

Maybe what we need is some check before we disable the intr:)

Yes, indeed we need some check in disable intr, but it need additional fields in "struct rte_intr_handle", and it's much saft to do so, but as I check i40e/fm10k code, only ixgbe disable it in

dev_stop().

Quoted 9 lines
Quoted 9 lines
Quoted 2 lines

I found fm10k doesn’t enable intr in dev_start. So, I think it's OK. But i40e

enables intr in dev_start.

Quoted 1 line

To my opinion, it's more like i40e misses the intr_disable in dev_stop.

I don't think i40e miss it, because it not the right please to disable interrupt. because all interrupts are enabled in init stage.

Actually, ixgbe enable the interrupt in init stage, but in dev_start, it disable it first and re-enable, so it just the same with doing nothing about

interrupt.

Quoted 11 lines
Quoted 9 lines

Just think below:

1. start the port.(interrupt already enabled in init stage, disable -->
re-enable)
2. stop the port.(disable interrupt)
3. start port again(Try to disable, but failed, already disabled)

Would you think the code has issue?

[Zhang, Helin] in ixgbe PMD, it can be seen that uninit() calls dev_close(), which calls dev_stop(). So I think the disabling can be done only in

dev_stop().

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

All others can make use of dev_stop to disable the interrupt.

As I said, if it is in dev_stop, it will has issue when dev_start --> dev_stop --> dev_start, this also could applied in i40e and fm10k. If you want to put it in dev_stop, better to remove enable interrupts in init stage, and only put it in dev_start.

Oh, yes, you are talking about the refactoring. That's good, and reasonable. Please do more validation with LSC, mailbox, rx interrupts, to make sure there is no issue introduced.

I have no plan to do code refactor, it includes lots of validation, and will influence many components, time is limited for 2.3. I would like keep it in uninit and remove it from stop, this only affect ixgbe, and I have done validation for it.

Thanks,
Michael

Quoted 31 lines

Thanks,
Helin

Quoted 27 lines

Thanks,
Michael

Quoted 25 lines

Regards,
Helin

Quoted 22 lines

Thanks,
Michael

Quoted 5 lines

Maybe we can follow fm10k's style.

Quoted 2 lines

On other hand, if we remove it in dev_stop, any side effect? In ixgbe start, it will always disable it first and then re-enable it, so it's safe.

I think you mean we can disable intr anyway even if it has been disabled.

Actually, we couldn't, DPDK call VFIO ioctl to kernel to disable interrupts, and if we try disable twice, it will return and error. That's why I mean we need a flag to show the interrupts stats. If it already disabled, we do not need call in to kernel. just return and give a warning message.

Thanks,
Michael

Quoted 5 lines

Sounds more like why we don't
need this patch :)

Quoted 2 lines

Thanks,
Michael

#10 lore raw
In reply to Qiu, Michael
Quoted 80 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Qiu, Michael
Sent: Tuesday, February 02, 2016 2:57 AM
To: Zhang, Helin; Lu, Wenzhuo; [email protected]
Subject: Re: [dpdk-dev] [PATCH v2] ixgbe: Fix disable interrupt twice

Quoted 71 lines · Helin
Quoted 71 lines

-----Original Message-----
From: Qiu, Michael
Sent: Tuesday, February 2, 2016 10:07 AM
To: Lu, Wenzhuo; [email protected]
Cc: Zhou, Danny; Liu, Yong; Liang, Cunming; Zhang, Helin
Subject: Re: [PATCH v2] ixgbe: Fix disable interrupt twice

[+cc helin]

Quoted 35 lines · Wenzhuo

Hi Michael,

Quoted 33 lines

-----Original Message-----
From: Qiu, Michael
Sent: Monday, February 1, 2016 4:05 PM
To: Lu, Wenzhuo; [email protected]
Cc: Zhou, Danny; Liu, Yong; Liang, Cunming
Subject: Re: [PATCH v2] ixgbe: Fix disable interrupt twice

Quoted 25 lines · Wenzhuo

Hi Michael,

Quoted 20 lines

-----Original Message-----
From: Qiu, Michael
Sent: Friday, January 29, 2016 1:58 PM
To: [email protected]
Cc: Zhou, Danny; Liu, Yong; Liang, Cunming; Lu, Wenzhuo; Qiu, Michael
Subject: [PATCH v2] ixgbe: Fix disable interrupt twice

Currently, ixgbe vf and pf will disable interrupt twice in stop stage and uninit stage. It will cause an error:

testpmd> quit

Shutting down port 0...
Stopping ports...
Done
Closing ports...
EAL: Error disabling MSI-X interrupts for fd 26 Done

Quoted 2 lines

Becasue the interrupt already been disabled in stop stage. Since it is enabled in init stage, better remove from stop stage.

I'm afraid it's not a good idea to just remove the intr_disable from

dev_stop.

Quoted 8 lines
Quoted 7 lines
Quoted 2 lines

I think dev_stop have the chance to be used independently with dev_unint. In

this scenario, we still need intr_disable, right?

Quoted 1 line

Maybe what we need is some check before we disable the intr:)

Yes, indeed we need some check in disable intr, but it need additional fields in "struct rte_intr_handle", and it's much saft to do so, but as I check i40e/fm10k code, only ixgbe disable it in dev_stop().

I found fm10k doesn't enable intr in dev_start. So, I think it's OK. But i40e

enables intr in dev_start.

Quoted 1 line

To my opinion, it's more like i40e misses the intr_disable in dev_stop.

I don't think i40e miss it, because it not the right please to disable interrupt. because all interrupts are enabled in init stage.

Actually, ixgbe enable the interrupt in init stage, but in dev_start, it disable it first and re-enable, so it just the same with doing nothing about interrupt.

Just think below:

1. start the port.(interrupt already enabled in init stage, disable --> re-enable)
2. stop the port.(disable interrupt)
3. start port again(Try to disable, but failed, already disabled)

Would you think the code has issue?

Quoted 8 lines
Quoted 3 lines

[Zhang, Helin] in ixgbe PMD, it can be seen that uninit() calls dev_close(), which calls dev_stop(). So I think the disabling can be done only in dev_stop(). All others can make use of dev_stop to disable the interrupt.

As I said, if it is in dev_stop, it will has issue when dev_start --> dev_stop --> dev_start, this also could applied in i40e and fm10k. If you want to put it in dev_stop, better to remove enable interrupts in init stage, and only put it in dev_start.

We can't remove enabling interrupt at init stage and put it only in dev_start(). That means PF couldn't handle interrupts from VF till dev_start() will be executed on PF
- which could never happen.
For same reason we can't disable all interrupts in dev_stop().
See: http://dpdk.org/ml/archives/dev/2015-November/027238.html
Konstantin

Quoted 29 lines

Thanks,
Michael

Quoted 26 lines

Regards,
Helin

Quoted 22 lines

Thanks,
Michael

Quoted 5 lines

Maybe we can follow fm10k's style.

Quoted 2 lines

On other hand, if we remove it in dev_stop, any side effect? In ixgbe start, it will always disable it first and then re-enable it, so it's safe.

I think you mean we can disable intr anyway even if it has been disabled.

Actually, we couldn't, DPDK call VFIO ioctl to kernel to disable interrupts, and if we try disable twice, it will return and error.
That's why I mean we need a flag to show the interrupts stats. If it already disabled, we do not need call in to kernel. just return and give a warning message.

Thanks,
Michael

Quoted 5 lines

Sounds more like why we don't
need this patch :)

Quoted 2 lines

Thanks,
Michael

#11 lore raw
Quoted 1 line · Konstantin

[...]

Quoted 21 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines

I don't think i40e miss it, because it not the right please to disable interrupt. because all interrupts are enabled in init stage.

Actually, ixgbe enable the interrupt in init stage, but in dev_start, it disable it first and re-enable, so it just the same with doing nothing about interrupt.

Just think below:

1. start the port.(interrupt already enabled in init stage, disable --> re-enable)
2. stop the port.(disable interrupt)
3. start port again(Try to disable, but failed, already disabled)

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

Would you think the code has issue?

[Zhang, Helin] in ixgbe PMD, it can be seen that uninit() calls dev_close(), which calls dev_stop(). So I think the disabling can be done only in dev_stop(). All others can make use of dev_stop to disable the interrupt.

As I said, if it is in dev_stop, it will has issue when dev_start --> dev_stop --> dev_start, this also could applied in i40e and fm10k. If you want to put it in dev_stop, better to remove enable interrupts in init stage, and only put it in dev_start.

Quoted 5 lines

We can't remove enabling interrupt at init stage and put it only in dev_start(). That means PF couldn't handle interrupts from VF till dev_start() will be executed on PF
- which could never happen.
For same reason we can't disable all interrupts in dev_stop().
See: http://dpdk.org/ml/archives/dev/2015-November/027238.html

Hi, Konstantin

Yes, you are right.

So the only way to fix this issue should remove it in dev_stop(), and left it in uinit() stage, which my patch does.

Am I right?

Thanks,
Michael

Quoted 30 lines

Konstantin

Quoted 27 lines

Thanks,
Michael

Quoted 25 lines

Regards,
Helin

Quoted 22 lines

Thanks,
Michael

Quoted 5 lines

Maybe we can follow fm10k's style.

Quoted 2 lines

On other hand, if we remove it in dev_stop, any side effect? In ixgbe start, it will always disable it first and then re-enable it, so it's safe.

I think you mean we can disable intr anyway even if it has been disabled.

Actually, we couldn't, DPDK call VFIO ioctl to kernel to disable interrupts, and if we try disable twice, it will return and error.
That's why I mean we need a flag to show the interrupts stats. If it already disabled, we do not need call in to kernel. just return and give a warning message.

Thanks,
Michael

Quoted 5 lines

Sounds more like why we don't
need this patch :)

Quoted 2 lines

Thanks,
Michael

#12 lore raw

Hi Michael

Quoted 33 lines · Konstantin
Quoted 1 line

[...]

Quoted 21 lines
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines

I don't think i40e miss it, because it not the right please to disable interrupt. because all interrupts are enabled in init stage.

Actually, ixgbe enable the interrupt in init stage, but in dev_start, it disable it first and re-enable, so it just the same with doing nothing about interrupt.

Just think below:

1. start the port.(interrupt already enabled in init stage, disable --> re-enable)
2. stop the port.(disable interrupt)
3. start port again(Try to disable, but failed, already disabled)

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

Would you think the code has issue?

[Zhang, Helin] in ixgbe PMD, it can be seen that uninit() calls dev_close(), which calls dev_stop(). So I think the disabling can be done only in dev_stop(). All others can make use of dev_stop to disable the interrupt.

As I said, if it is in dev_stop, it will has issue when dev_start --> dev_stop --> dev_start, this also could applied in i40e and fm10k. If you want to put it in dev_stop, better to remove enable interrupts in init stage, and only put it in dev_start.

Quoted 5 lines

We can't remove enabling interrupt at init stage and put it only in dev_start(). That means PF couldn't handle interrupts from VF till dev_start() will be executed on PF
- which could never happen.
For same reason we can't disable all interrupts in dev_stop().
See: http://dpdk.org/ml/archives/dev/2015-November/027238.html

Quoted 8 lines

Hi, Konstantin

Yes, you are right.

So the only way to fix this issue should remove it in dev_stop(), and left it in uinit() stage, which my patch does.

Am I right?

Yes, I think so.
PF should be able to receive MBOX interrupts after dev_stop(). Konstantin

Quoted 33 lines

Thanks,
Michael

Quoted 30 lines

Konstantin

Quoted 27 lines

Thanks,
Michael

Quoted 25 lines

Regards,
Helin

Quoted 22 lines

Thanks,
Michael

Quoted 5 lines

Maybe we can follow fm10k's style.

Quoted 2 lines

On other hand, if we remove it in dev_stop, any side effect? In ixgbe start, it will always disable it first and then re-enable it, so it's safe.

I think you mean we can disable intr anyway even if it has been disabled.

Actually, we couldn't, DPDK call VFIO ioctl to kernel to disable interrupts, and if we try disable twice, it will return and error.
That's why I mean we need a flag to show the interrupts stats. If it already disabled, we do not need call in to kernel. just return and give a warning message.

Thanks,
Michael

Quoted 5 lines

Sounds more like why we don't
need this patch :)

Quoted 2 lines

Thanks,
Michael

Acked-by on v2 1/1
#14 lore raw
In reply to Michael Qiu
Quoted 20 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Michael Qiu
Sent: Friday, January 29, 2016 1:58 PM
To: [email protected]
Subject: [dpdk-dev] [PATCH v2] ixgbe: Fix disable interrupt twice

Currently, ixgbe vf and pf will disable interrupt twice in stop stage and uninit stage. It will cause an error:

testpmd> quit

Shutting down port 0...
Stopping ports...
Done
Closing ports...
EAL: Error disabling MSI-X interrupts for fd 26 Done

Quoted 6 lines

Becasue the interrupt already been disabled in stop stage. Since it is enabled in init stage, better remove from stop stage.

Fixes 0eb609239efd ("ixgbe: enable Rx queue interrupts for PF and VF")
Quoted 34 lines

---
v2 --> v1:
fix error in commit log word "interrupte"

 drivers/net/ixgbe/ixgbe_ethdev.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/net/ixgbe/ixgbe_ethdev.c +0 -7
index 4c4c6df..a561f8d 100644
@@ -2192,9 +2192,6 @@ ixgbe_dev_stop(struct rte_eth_dev *dev)
 	/* disable interrupts */
 	ixgbe_disable_intr(hw);
 
-	/* disable intr eventfd mapping */
-	rte_intr_disable(intr_handle);
-
 	/* reset the NIC */
 	ixgbe_pf_reset_hw(hw);
 	hw->adapter_stopped = 0;
@@ -3898,9 +3895,6 @@ ixgbevf_dev_stop(struct rte_eth_dev *dev)
 
 	ixgbe_dev_clear_queues(dev);
 
-	/* disable intr eventfd mapping */
-	rte_intr_disable(intr_handle);
-
 	/* Clean datapath event and queue/vec mapping */
 	rte_intr_efd_disable(intr_handle);
 	if (intr_handle->intr_vec != NULL) {
--

1.9.3

#15 lore raw
Quoted 20 lines · Helin
Quoted 20 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Michael Qiu
Sent: Friday, January 29, 2016 1:58 PM
To: [email protected]
Subject: [dpdk-dev] [PATCH v2] ixgbe: Fix disable interrupt twice

Currently, ixgbe vf and pf will disable interrupt twice in stop stage and uninit stage. It will cause an error:

testpmd> quit

Shutting down port 0...
Stopping ports...
Done
Closing ports...
EAL: Error disabling MSI-X interrupts for fd 26 Done

Quoted 8 lines
Quoted 6 lines

Becasue the interrupt already been disabled in stop stage. Since it is enabled in init stage, better remove from stop stage.

Fixes 0eb609239efd ("ixgbe: enable Rx queue interrupts for PF and VF")

applied to dpdk-next-net/rel_16_04

/Bruce