From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A17BA45D0B; Fri, 15 Nov 2024 06:05:09 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4016142EF2; Fri, 15 Nov 2024 06:05:09 +0100 (CET) Received: from inbox.dpdk.org (inbox.dpdk.org [95.142.172.178]) by mails.dpdk.org (Postfix) with ESMTP id 84D0B42E52 for ; Fri, 15 Nov 2024 06:05:07 +0100 (CET) Received: by inbox.dpdk.org (Postfix, from userid 33) id 4A3D845D0C; Fri, 15 Nov 2024 06:05:07 +0100 (CET) From: bugzilla@dpdk.org To: dev@dpdk.org Subject: [DPDK/ethdev Bug 1581] net/txgbe: duplicate legs of if statement Date: Fri, 15 Nov 2024 05:05:07 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: DPDK X-Bugzilla-Component: ethdev X-Bugzilla-Version: 24.11 X-Bugzilla-Keywords: X-Bugzilla-Severity: major X-Bugzilla-Who: stephen@networkplumber.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: Normal X-Bugzilla-Assigned-To: dev@dpdk.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: multipart/alternative; boundary=17316471070.fd6C8.914006 Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://bugs.dpdk.org/ Auto-Submitted: auto-generated X-Auto-Response-Suppress: All MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org --17316471070.fd6C8.914006 Date: Fri, 15 Nov 2024 06:05:06 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.dpdk.org/ Auto-Submitted: auto-generated X-Auto-Response-Suppress: All https://bugs.dpdk.org/show_bug.cgi?id=3D1581 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 16= 33 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 =3D TXGBE_MNGSEM_SWPHY; else hw->phy.phy_semaphore_mask =3D TXGBE_MNGSEM_SWPHY; } return 0; } Looking at the Linux kernel driver this mask looks messed up. In Linux driver possible values are=20 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! --=20 You are receiving this mail because: You are the assignee for the bug.= --17316471070.fd6C8.914006 Date: Fri, 15 Nov 2024 06:05:07 +0100 MIME-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.dpdk.org/ Auto-Submitted: auto-generated X-Auto-Response-Suppress: All
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-stud=
io.com/en/blog/posts/cpp/1183/

V523 The 'then' statement is equivalent to the 'else' statement. bnx2x.c 16=
33

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 =3D TXGBE_MNGSEM_SWPHY;
    else
      hw->phy.phy_semaphore_mask =3D TXGBE_MNGSEM_SWPHY;
  }
  return 0;
}

Looking at the Linux kernel driver this mask looks messed up.
In Linux driver possible values are=20

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.
=20=20=20=20=20=20=20=20=20=20
= --17316471070.fd6C8.914006--