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@dpdk.org
Reporter stephen@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: