net/ice: invoke callback func when link status change

Message ID 20191014084128.11791-1-leyi.rong@intel.com (mailing list archive)
State Changes Requested, archived
Delegated to: xiaolong ye
Headers
Series net/ice: invoke callback func when link status change |

Checks

Context Check Description
ci/iol-compilation success Compile Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Leyi Rong Oct. 14, 2019, 8:41 a.m. UTC
  Call _rte_eth_dev_callback_process when link status change.

Signed-off-by: Leyi Rong <leyi.rong@intel.com>
---
 drivers/net/ice/ice_ethdev.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
  

Comments

Xiaolong Ye Oct. 16, 2019, 5:41 a.m. UTC | #1
Hi, Leyi 

On 10/14, Leyi Rong wrote:
>Call _rte_eth_dev_callback_process when link status change.

Could you elaborate more in commit log, like why we need this patch, what's the 
impact without this patch, is it a fix, etc?

Thanks,
Xiaolong
>
>Signed-off-by: Leyi Rong <leyi.rong@intel.com>
>---
> drivers/net/ice/ice_ethdev.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
>diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
>index dfccef65d..ddcb4848b 100644
>--- a/drivers/net/ice/ice_ethdev.c
>+++ b/drivers/net/ice/ice_ethdev.c
>@@ -1293,6 +1293,7 @@ ice_interrupt_handler(void *param)
> 	uint8_t pf_num;
> 	uint8_t event;
> 	uint16_t queue;
>+	int ret;
> #ifdef ICE_LSE_SPT
> 	uint32_t int_fw_ctl;
> #endif
>@@ -1320,7 +1321,10 @@ ice_interrupt_handler(void *param)
> #else
> 	if (oicr & PFINT_OICR_LINK_STAT_CHANGE_M) {
> 		PMD_DRV_LOG(INFO, "OICR: link state change event");
>-		ice_link_update(dev, 0);
>+		ret = ice_link_update(dev, 0);
>+		if (!ret)
>+			_rte_eth_dev_callback_process
>+				(dev, RTE_ETH_EVENT_INTR_LSC, NULL);
> 	}
> #endif
> 
>-- 
>2.17.1
>
  

Patch

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index dfccef65d..ddcb4848b 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -1293,6 +1293,7 @@  ice_interrupt_handler(void *param)
 	uint8_t pf_num;
 	uint8_t event;
 	uint16_t queue;
+	int ret;
 #ifdef ICE_LSE_SPT
 	uint32_t int_fw_ctl;
 #endif
@@ -1320,7 +1321,10 @@  ice_interrupt_handler(void *param)
 #else
 	if (oicr & PFINT_OICR_LINK_STAT_CHANGE_M) {
 		PMD_DRV_LOG(INFO, "OICR: link state change event");
-		ice_link_update(dev, 0);
+		ret = ice_link_update(dev, 0);
+		if (!ret)
+			_rte_eth_dev_callback_process
+				(dev, RTE_ETH_EVENT_INTR_LSC, NULL);
 	}
 #endif