[DPDK/ethdev Bug 1581] net/txgbe: duplicate legs of if statement
bugzilla at dpdk.org
bugzilla at dpdk.org
Fri Nov 15 06:05:07 CET 2024
https://bugs.dpdk.org/show_bug.cgi?id=1581
Bug ID: 1581
Summary: net/txgbe: duplicate legs of if statement
Product: DPDK
Version: 24.11
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: major
Priority: Normal
Component: ethdev
Assignee: dev at dpdk.org
Reporter: stephen at networkplumber.org
Target Milestone: ---
This bug is reported here:
https://pvs-studio.com/en/blog/posts/cpp/1183/
V523 The 'then' statement is equivalent to the 'else' statement. bnx2x.c 1633
static s32 txgbe_read_phy_if(struct txgbe_hw *hw)
{
....
if (!hw->phy.phy_semaphore_mask) {
if (hw->bus.lan_id)
hw->phy.phy_semaphore_mask = TXGBE_MNGSEM_SWPHY;
else
hw->phy.phy_semaphore_mask = TXGBE_MNGSEM_SWPHY;
}
return 0;
}
Looking at the Linux kernel driver this mask looks messed up.
In Linux driver possible values are
ethernet/wangxun/libwx/wx_type.h:#define WX_MNG_SWFW_SYNC_SW_MB BIT(2)
ethernet/wangxun/libwx/wx_type.h:#define WX_MNG_SWFW_SYNC_SW_FLASH BIT(3)
But in DPDK it is always using a different value.
#define TXGBE_MNGSEM_SWPHY MS(0, 0x1)
Looks like with wrong mask the SW/FW sync never works!
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mails.dpdk.org/archives/dev/attachments/20241115/07ef0140/attachment.htm>
More information about the dev
mailing list