[v2] net/ixgbe: fix port close in FreeBSD OS

Message ID 20191101022644.48465-1-chenxux.di@intel.com (mailing list archive)
State Accepted, archived
Delegated to: xiaolong ye
Headers
Series [v2] net/ixgbe: fix port close in FreeBSD OS |

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/iol-intel-Performance fail Performance Testing issues
ci/iol-compilation success Compile Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/travis-robot success Travis build: passed
ci/checkpatch success coding style OK

Commit Message

Chenxu Di Nov. 1, 2019, 2:26 a.m. UTC
  FreeBSD OS don't support igb_uio interrupt, so it will fail
 when unregister the interrupt callback in port close.
We can fix the issue by passing -ENOENT when check the
 return value of unregister interrupt callback function.

Fixes: f2f4990eff94 ("net/ixgbe: release port upon close")

Signed-off-by: Di ChenxuX <chenxux.di@intel.com>

v2:
Modified commit log.
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Xiaolong Ye Nov. 4, 2019, 5:16 a.m. UTC | #1
Seems i40e driver has the same issue, could you help to cook another fix patch
as well?

On 11/01, Di ChenxuX wrote:
>FreeBSD OS don't support igb_uio interrupt, so it will fail
> when unregister the interrupt callback in port close.
>We can fix the issue by passing -ENOENT when check the
> return value of unregister interrupt callback function.
>
>Fixes: f2f4990eff94 ("net/ixgbe: release port upon close")
>
>Signed-off-by: Di ChenxuX <chenxux.di@intel.com>
>
>v2:
>Modified commit log.
>---
> drivers/net/ixgbe/ixgbe_ethdev.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
>index dbce7a80e..0a654accb 100644
>--- a/drivers/net/ixgbe/ixgbe_ethdev.c
>+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
>@@ -2978,7 +2978,7 @@ ixgbe_dev_close(struct rte_eth_dev *dev)
> 	do {
> 		ret = rte_intr_callback_unregister(intr_handle,
> 				ixgbe_dev_interrupt_handler, dev);
>-		if (ret >= 0) {
>+		if (ret >= 0 || ret == -ENOENT) {
> 			break;
> 		} else if (ret != -EAGAIN) {
> 			PMD_INIT_LOG(ERR,
>-- 
>2.17.1
>

Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>

Applied to dpdk-next-net-intel. Thanks.
  

Patch

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index dbce7a80e..0a654accb 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -2978,7 +2978,7 @@  ixgbe_dev_close(struct rte_eth_dev *dev)
 	do {
 		ret = rte_intr_callback_unregister(intr_handle,
 				ixgbe_dev_interrupt_handler, dev);
-		if (ret >= 0) {
+		if (ret >= 0 || ret == -ENOENT) {
 			break;
 		} else if (ret != -EAGAIN) {
 			PMD_INIT_LOG(ERR,