net/ixgbe: fix port close in FreeBSD OS

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

Checks

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

Commit Message

Chenxu Di Oct. 25, 2019, 4:52 a.m. UTC
  FreeBSD OS don't support igb_uio interrupt, so it will fail
 that unregister intr callback when port close.
Fix by passing -ENOENT when check the return value of
unregister intr callback function.

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

Signed-off-by: Di ChenxuX <chenxux.di@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Qiming Yang Oct. 28, 2019, 5:50 a.m. UTC | #1
Hi, Chenxu

> -----Original Message-----
> From: Di, ChenxuX
> Sent: Friday, October 25, 2019 12:53 PM
> To: dev@dpdk.org
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Yang, Qiming
> <qiming.yang@intel.com>; Di, ChenxuX <chenxux.di@intel.com>
> Subject: [PATCH] net/ixgbe: fix port close in FreeBSD OS
> 
> FreeBSD OS don't support igb_uio interrupt, so it will fail  that unregister intr
> callback when port close.
it will fail when unregister the interrupt callback in port close.

> Fix by passing -ENOENT when check the return value of unregister intr
> callback function.
We can fix the issue by ... / please use interrupt not intr in commit message.
> 
> Fixes: f2f4990eff94 ("net/ixgbe: release port upon close")
> 
> Signed-off-by: Di ChenxuX <chenxux.di@intel.com>
> ---
>  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
  

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,