DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/i40e: fix shifts of 32-bit value
@ 2018-05-23  7:46 Beilei Xing
  2018-05-23 15:49 ` Ferruh Yigit
  2018-06-21 14:19 ` Zhang, Qi Z
  0 siblings, 2 replies; 3+ messages in thread
From: Beilei Xing @ 2018-05-23  7:46 UTC (permalink / raw)
  To: qi.z.zhang; +Cc: dev, jia.guo

Cppcheck reports following error,
(error) Shifting 32-bit value by 36 bits is undefined behaviour

According to datasheet, there's PHY type and PHY type extension
in setting PHY config command, should exclude PHY type extension
when setting PHY type.

Fixes: 1bb8f661168d ("net/i40e: fix link down and negotiation")

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 7d4f1c9..9792205 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -2065,8 +2065,8 @@ i40e_phy_conf_link(struct i40e_hw *hw,
 
 
 
-	/* To enable link, phy_type mask needs to include each type */
-	for (cnt = I40E_PHY_TYPE_SGMII; cnt < I40E_PHY_TYPE_MAX; cnt++)
+	/* PHY type mask needs to include each type except PHY type extension */
+	for (cnt = I40E_PHY_TYPE_SGMII; cnt < I40E_PHY_TYPE_25GBASE_KR; cnt++)
 		phy_type_mask |= 1 << cnt;
 
 	/* use get_phy_abilities_resp value for the rest */
-- 
2.5.5

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

* Re: [dpdk-dev] [PATCH] net/i40e: fix shifts of 32-bit value
  2018-05-23  7:46 [dpdk-dev] [PATCH] net/i40e: fix shifts of 32-bit value Beilei Xing
@ 2018-05-23 15:49 ` Ferruh Yigit
  2018-06-21 14:19 ` Zhang, Qi Z
  1 sibling, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2018-05-23 15:49 UTC (permalink / raw)
  To: Beilei Xing, qi.z.zhang; +Cc: dev, jia.guo

On 5/23/2018 8:46 AM, Beilei Xing wrote:
> Cppcheck reports following error,
> (error) Shifting 32-bit value by 36 bits is undefined behaviour
> 
> According to datasheet, there's PHY type and PHY type extension
> in setting PHY config command, should exclude PHY type extension
> when setting PHY type.
> 
> Fixes: 1bb8f661168d ("net/i40e: fix link down and negotiation")
> 
> Signed-off-by: Beilei Xing <beilei.xing@intel.com>

Hi Beilei,

This patc was late for rc5, it will be considered for next release.

Thanks,
ferruh

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

* Re: [dpdk-dev] [PATCH] net/i40e: fix shifts of 32-bit value
  2018-05-23  7:46 [dpdk-dev] [PATCH] net/i40e: fix shifts of 32-bit value Beilei Xing
  2018-05-23 15:49 ` Ferruh Yigit
@ 2018-06-21 14:19 ` Zhang, Qi Z
  1 sibling, 0 replies; 3+ messages in thread
From: Zhang, Qi Z @ 2018-06-21 14:19 UTC (permalink / raw)
  To: Xing, Beilei; +Cc: dev, Guo, Jia



> -----Original Message-----
> From: Xing, Beilei
> Sent: Wednesday, May 23, 2018 3:47 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>
> Cc: dev@dpdk.org; Guo, Jia <jia.guo@intel.com>
> Subject: [PATCH] net/i40e: fix shifts of 32-bit value
> 
> Cppcheck reports following error,
> (error) Shifting 32-bit value by 36 bits is undefined behaviour
> 
> According to datasheet, there's PHY type and PHY type extension in setting PHY
> config command, should exclude PHY type extension when setting PHY type.
> 
> Fixes: 1bb8f661168d ("net/i40e: fix link down and negotiation")
> 
> Signed-off-by: Beilei Xing <beilei.xing@intel.com>

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel

Thanks!
Qi

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

end of thread, other threads:[~2018-06-21 14:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-23  7:46 [dpdk-dev] [PATCH] net/i40e: fix shifts of 32-bit value Beilei Xing
2018-05-23 15:49 ` Ferruh Yigit
2018-06-21 14:19 ` Zhang, Qi Z

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