[dpdk-dev] net/liquidio:fix Unable to update lio_dev->linfo.link var

Message ID 1526899028-72619-1-git-send-email-ych@panath.cn (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation success Compilation OK

Commit Message

chuhong yao May 21, 2018, 10:37 a.m. UTC
  Signed-off-by: yaochuhong <ych@panath.cn>
---
 drivers/net/liquidio/lio_ethdev.c | 3 +++
 1 file changed, 3 insertions(+)
  

Comments

Ferruh Yigit May 21, 2018, 11:04 a.m. UTC | #1
On 5/21/2018 11:37 AM, yaochuhong wrote:
> Signed-off-by: yaochuhong <ych@panath.cn>
> ---
>  drivers/net/liquidio/lio_ethdev.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c
> index 0e0b5d8..ba39d20 100644
> --- a/drivers/net/liquidio/lio_ethdev.c
> +++ b/drivers/net/liquidio/lio_ethdev.c
> @@ -1405,6 +1405,9 @@ struct rte_lio_xstats_name_off {
>  	/* Configure RSS if device configured with multiple RX queues. */
>  	lio_dev_mq_rx_configure(eth_dev);
>  
> +	/* Before update the link info, must set linfo.link.link_status64 to 0. */
> +	lio_dev->linfo.link.link_status64 = 0;

Initial link_status64 value should be 0 (memory allocated with
rte_zmalloc_socket()) and lio_dev_stop() sets it to 0. So there should be no
need to set zero here.

Are you observing cases this value is not zero? Can you please add more
information to commit log about what/how you are observing and what is the
result of it?

> +    
>  	/* start polling for lsc */
>  	ret = rte_eal_alarm_set(LIO_LSC_TIMEOUT,
>  				lio_sync_link_state_check,
>
  

Patch

diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c
index 0e0b5d8..ba39d20 100644
--- a/drivers/net/liquidio/lio_ethdev.c
+++ b/drivers/net/liquidio/lio_ethdev.c
@@ -1405,6 +1405,9 @@  struct rte_lio_xstats_name_off {
 	/* Configure RSS if device configured with multiple RX queues. */
 	lio_dev_mq_rx_configure(eth_dev);
 
+	/* Before update the link info, must set linfo.link.link_status64 to 0. */
+	lio_dev->linfo.link.link_status64 = 0;
+    
 	/* start polling for lsc */
 	ret = rte_eal_alarm_set(LIO_LSC_TIMEOUT,
 				lio_sync_link_state_check,