DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/ice: invoke callback func when link status change
@ 2019-10-14  8:41 Leyi Rong
  2019-10-16  5:41 ` Ye Xiaolong
  2019-10-16  6:24 ` [dpdk-dev] [PATCH v2] " Leyi Rong
  0 siblings, 2 replies; 6+ messages in thread
From: Leyi Rong @ 2019-10-14  8:41 UTC (permalink / raw)
  To: wenzhuo.lu, qi.z.zhang, xiaolong.ye; +Cc: dev, Leyi Rong

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(-)

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] net/ice: invoke callback func when link status change
  2019-10-14  8:41 [dpdk-dev] [PATCH] net/ice: invoke callback func when link status change Leyi Rong
@ 2019-10-16  5:41 ` Ye Xiaolong
  2019-10-16  6:24 ` [dpdk-dev] [PATCH v2] " Leyi Rong
  1 sibling, 0 replies; 6+ messages in thread
From: Ye Xiaolong @ 2019-10-16  5:41 UTC (permalink / raw)
  To: Leyi Rong; +Cc: wenzhuo.lu, qi.z.zhang, dev

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
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [dpdk-dev] [PATCH v2] net/ice: invoke callback func when link status change
  2019-10-14  8:41 [dpdk-dev] [PATCH] net/ice: invoke callback func when link status change Leyi Rong
  2019-10-16  5:41 ` Ye Xiaolong
@ 2019-10-16  6:24 ` Leyi Rong
  2019-10-16  6:41   ` Ye Xiaolong
  2019-10-17  3:16   ` Ye Xiaolong
  1 sibling, 2 replies; 6+ messages in thread
From: Leyi Rong @ 2019-10-16  6:24 UTC (permalink / raw)
  To: wenzhuo.lu, qi.z.zhang, xiaolong.ye; +Cc: dev, Leyi Rong

Needs to call _rte_eth_dev_callback_process to run registered
callbacks when link status change.

Fixes: cf911d90e366 ("net/ice: support link update")

Signed-off-by: Leyi Rong <leyi.rong@intel.com>

---
v2:
- adds fixline in commit log.
---
 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 5567beb55..092f10d47 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -1303,6 +1303,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
@@ -1330,7 +1331,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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH v2] net/ice: invoke callback func when link status change
  2019-10-16  6:24 ` [dpdk-dev] [PATCH v2] " Leyi Rong
@ 2019-10-16  6:41   ` Ye Xiaolong
  2019-10-16  7:08     ` Rong, Leyi
  2019-10-17  3:16   ` Ye Xiaolong
  1 sibling, 1 reply; 6+ messages in thread
From: Ye Xiaolong @ 2019-10-16  6:41 UTC (permalink / raw)
  To: Leyi Rong; +Cc: wenzhuo.lu, qi.z.zhang, dev

On 10/16, Leyi Rong wrote:
>Needs to call _rte_eth_dev_callback_process to run registered
>callbacks when link status change.
>

Is it a must to call _rte_eth_dev_callback_process after link status change, I
see ice_link_update is also called in ice_dev_start, do we need to apply the
same change there too?

Thanks,
Xiaolong

>Fixes: cf911d90e366 ("net/ice: support link update")
>
>Signed-off-by: Leyi Rong <leyi.rong@intel.com>
>
>---
>v2:
>- adds fixline in commit log.
>---
> 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 5567beb55..092f10d47 100644
>--- a/drivers/net/ice/ice_ethdev.c
>+++ b/drivers/net/ice/ice_ethdev.c
>@@ -1303,6 +1303,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
>@@ -1330,7 +1331,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
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH v2] net/ice: invoke callback func when link status change
  2019-10-16  6:41   ` Ye Xiaolong
@ 2019-10-16  7:08     ` Rong, Leyi
  0 siblings, 0 replies; 6+ messages in thread
From: Rong, Leyi @ 2019-10-16  7:08 UTC (permalink / raw)
  To: Ye, Xiaolong; +Cc: Lu, Wenzhuo, Zhang, Qi Z, dev


> -----Original Message-----
> From: Ye, Xiaolong
> Sent: Wednesday, October 16, 2019 2:41 PM
> To: Rong, Leyi <leyi.rong@intel.com>
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>;
> dev@dpdk.org
> Subject: Re: [PATCH v2] net/ice: invoke callback func when link status change
> 
> On 10/16, Leyi Rong wrote:
> >Needs to call _rte_eth_dev_callback_process to run registered callbacks
> >when link status change.
> >
> 
> Is it a must to call _rte_eth_dev_callback_process after link status change, I see
> ice_link_update is also called in ice_dev_start, do we need to apply the same
> change there too?
> 

I think no needs to invoke the same callback in ice_dev_start, as it's not triggered by event
in start process.

> Thanks,
> Xiaolong
> 
> >Fixes: cf911d90e366 ("net/ice: support link update")
> >
> >Signed-off-by: Leyi Rong <leyi.rong@intel.com>
> >
> >---
> >v2:
> >- adds fixline in commit log.
> >---
> > 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 5567beb55..092f10d47 100644
> >--- a/drivers/net/ice/ice_ethdev.c
> >+++ b/drivers/net/ice/ice_ethdev.c
> >@@ -1303,6 +1303,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
> >@@ -1330,7 +1331,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
> >

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH v2] net/ice: invoke callback func when link status change
  2019-10-16  6:24 ` [dpdk-dev] [PATCH v2] " Leyi Rong
  2019-10-16  6:41   ` Ye Xiaolong
@ 2019-10-17  3:16   ` Ye Xiaolong
  1 sibling, 0 replies; 6+ messages in thread
From: Ye Xiaolong @ 2019-10-17  3:16 UTC (permalink / raw)
  To: Leyi Rong; +Cc: wenzhuo.lu, qi.z.zhang, dev

On 10/16, Leyi Rong wrote:
>Needs to call _rte_eth_dev_callback_process to run registered
>callbacks when link status change.
>
>Fixes: cf911d90e366 ("net/ice: support link update")
>
>Signed-off-by: Leyi Rong <leyi.rong@intel.com>
>
>---
>v2:
>- adds fixline in commit log.
>---
> 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 5567beb55..092f10d47 100644
>--- a/drivers/net/ice/ice_ethdev.c
>+++ b/drivers/net/ice/ice_ethdev.c
>@@ -1303,6 +1303,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
>@@ -1330,7 +1331,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
>

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

Applied to dpdk-next-net-intel.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-10-17  3:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-14  8:41 [dpdk-dev] [PATCH] net/ice: invoke callback func when link status change Leyi Rong
2019-10-16  5:41 ` Ye Xiaolong
2019-10-16  6:24 ` [dpdk-dev] [PATCH v2] " Leyi Rong
2019-10-16  6:41   ` Ye Xiaolong
2019-10-16  7:08     ` Rong, Leyi
2019-10-17  3:16   ` Ye Xiaolong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).