Skip to contentSkip to conversation

net/i40e: fix link_state update for i40e_ethdev_vf drv

PATCH Superseded Tushar Mulkar 2 participants 2 messages Jan 17, 2018 1 message not in the archive Network drivers

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#1 lore raw

PATCH 1/1 net/i40e: fix link_state update for i40e_ethdev_vf drv

In reply to a message not in the archive

The check for bool was accounting unwanted bits in the calulation of truth value

---
 drivers/net/i40e/i40e_ethdev_vf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/i40e/i40e_ethdev_vf.c +1 -1
index b96d77a0c..9c14ea278 100644
@@ -2095,7 +2095,7 @@ i40evf_dev_link_update(struct rte_eth_dev *dev,
 	}
 	/* full duplex only */
 	new_link.link_duplex = ETH_LINK_FULL_DUPLEX;
-	new_link.link_status = vf->link_up ? ETH_LINK_UP :
+	new_link.link_status = (vf->link_up & true) ? ETH_LINK_UP :
 					     ETH_LINK_DOWN;
 	new_link.link_autoneg =
 		dev->data->dev_conf.link_speeds & ETH_LINK_SPEED_FIXED;
Signature · 1 line
2.11.0
#2 lore raw
Quoted 10 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Tushar Mulkar
Sent: Wednesday, January 17, 2018 4:53 PM
To: [email protected]
Cc: Xing, Beilei; Zhang, Qi Z; Tushar Mulkar
Subject: [dpdk-dev] [PATCH] net/i40e: fix link_state update for i40e_ethdev_vf drv

Quoted 2 lines

The check for bool was accounting unwanted bits in the calulation of truth value

Could you help to add a bit more about the problem statement?

Quoted 12 lines
---
 drivers/net/i40e/i40e_ethdev_vf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/i40e/i40e_ethdev_vf.c +0 -0
index b96d77a0c..9c14ea278 100644

drivers/net/i40e/i40e_ethdev_vf.c i40evf_dev_link_update(struct rte_eth_dev *dev, · line 2099

Quoted 6 lines
drivers/net/i40e/i40e_ethdev_vf.c +1 -1
@@ -2095,7 +2095,7 @@ i40evf_dev_link_update(struct rte_eth_dev *dev,
 	}
 	/* full duplex only */
 	new_link.link_duplex = ETH_LINK_FULL_DUPLEX;
-	new_link.link_status = vf->link_up ? ETH_LINK_UP :
+	new_link.link_status = (vf->link_up & true) ? ETH_LINK_UP :
 					     ETH_LINK_DOWN;

Basically 'link_up' is in bool type, why adding bit manipulation on it? But thanks for your patches!

/Helin

Quoted 4 lines
drivers/net/i40e/i40e_ethdev_vf.c +0 -1
 	new_link.link_autoneg =
 		dev->data->dev_conf.link_speeds & ETH_LINK_SPEED_FIXED;
--

2.11.0