lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <504C9EFCA2D0054393414C9CB605C37F3086A3@SJEXCHMB06.corp.ad.broadcom.com>
Date:	Tue, 25 Sep 2012 10:42:19 +0000
From:	"Dmitry Kravkov" <dmitry@...adcom.com>
To:	"Jean-Michel Hautbois" <jhautbois@...il.com>
cc:	netdev <netdev@...r.kernel.org>,
	"Barak Witkowski" <barak@...adcom.com>,
	"Eilon Greenstein" <eilong@...adcom.com>,
	"davem@...emloft.net" <davem@...emloft.net>
Subject: RE: bnx2x: link detected up at startup even when it should be
 down

> -----Original Message-----
> From: Jean-Michel Hautbois [mailto:jhautbois@...il.com]
> Sent: Tuesday, September 25, 2012 10:11 AM
> To: Dmitry Kravkov
> Cc: netdev; Barak Witkowski; Eilon Greenstein; davem@...emloft.net
> Subject: Re: bnx2x: link detected up at startup even when it should be down
> 
> 
> I have tested several things, and I added some traces in order to get
> information.
> For instance, I trace the load_code in the function named "bnx2x_nic_load".
> 
> [   25.693677] bnx2x 0000:04:00.0: eth0: bnx2x_nic_load load_code=0x10130000
> [   25.693679] bnx2x 0000:04:00.0: eth0: bnx2x_nic_load start period
> [  102.748934] bnx2x 0000:04:00.1: eth1: bnx2x_nic_load load_code=0x10100000
> [  102.749065] bnx2x 0000:04:00.1: eth1: bnx2x_nic_load start period
> [  104.007074] bnx2x 0000:04:00.2: eth2: bnx2x_nic_load load_code=0x10120000
> [  104.007197] bnx2x 0000:04:00.2: eth2: bnx2x_nic_load NOT start period
> [  104.423789] bnx2x 0000:04:00.3: eth3: bnx2x_nic_load load_code=0x10120000
> [  104.423914] bnx2x 0000:04:00.3: eth3: bnx2x_nic_load NOT start period
> [  104.836505] bnx2x 0000:04:00.4: eth4: bnx2x_nic_load load_code=0x10120000
> [  104.836632] bnx2x 0000:04:00.4: eth4: bnx2x_nic_load NOT start period
> [  105.254220] bnx2x 0000:04:00.5: eth5: bnx2x_nic_load load_code=0x10120000
> [  105.254350] bnx2x 0000:04:00.5: eth5: bnx2x_nic_load NOT start period
> [  105.667935] bnx2x 0000:04:00.6: eth6: bnx2x_nic_load load_code=0x10120000
> [  105.668066] bnx2x 0000:04:00.6: eth6: bnx2x_nic_load NOT start period
> [  106.081652] bnx2x 0000:04:00.7: eth7: bnx2x_nic_load load_code=0x10120000
> [  106.081779] bnx2x 0000:04:00.7: eth7: bnx2x_nic_load NOT start period
> 
> This is a FlexNIC use.
> Here is my (quick and dirty) patch which makes the link detection
> working and adds the traces shown above :
> 
> diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
> b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
> index 580b44e..dedd810 100644
> --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
> +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
> @@ -1769,6 +1769,7 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
>          */
>         if (!BP_NOMCP(bp)) {
>                 load_code = bnx2x_fw_command(bp, DRV_MSG_CODE_LOAD_REQ, 0);
> +netdev_info(bp->dev, "bnx2x_nic_load bnx2x_fw_command
> load_code=0x%08X\n",load_code);
>                 if (!load_code) {
>                         BNX2X_ERR("MCP response failure, aborting\n");
>                         rc = -EBUSY;
> @@ -1785,22 +1786,31 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
>                 DP(NETIF_MSG_IFUP, "NO MCP - load counts[%d]      %d, %d, %d\n",
>                    path, load_count[path][0], load_count[path][1],
>                    load_count[path][2]);
> +netdev_info(bp->dev, "bnx2x_nic_load NO MCP - load counts[%d]
> %d, %d, %d\n",
> +                  path, load_count[path][0], load_count[path][1],
> +                  load_count[path][2]);
>                 load_count[path][0]++;
>                 load_count[path][1 + port]++;
>                 DP(NETIF_MSG_IFUP, "NO MCP - new load counts[%d]  %d, %d, %d\n",
>                    path, load_count[path][0], load_count[path][1],
>                    load_count[path][2]);
> +netdev_info(bp->dev, "bnx2x_nic_load NO MCP - new load counts[%d]
> %d, %d, %d\n",
> +                  path, load_count[path][0], load_count[path][1],
> +                  load_count[path][2]);
>                 if (load_count[path][0] == 1)
>                         load_code = FW_MSG_CODE_DRV_LOAD_COMMON;
>                 else if (load_count[path][1 + port] == 1)
>                         load_code = FW_MSG_CODE_DRV_LOAD_PORT;
>                 else
>                         load_code = FW_MSG_CODE_DRV_LOAD_FUNCTION;
> +netdev_info(bp->dev, "bnx2x_nic_load autre
> load_code=0x%08X\n",load_code);
>         }
> 
> +netdev_info(bp->dev, "bnx2x_nic_load load_code=0x%08X\n",load_code);
>         if ((load_code == FW_MSG_CODE_DRV_LOAD_COMMON) ||
>             (load_code == FW_MSG_CODE_DRV_LOAD_COMMON_CHIP) ||
> -           (load_code == FW_MSG_CODE_DRV_LOAD_PORT)) {
> +           (load_code == FW_MSG_CODE_DRV_LOAD_PORT) ||
> +                (load_code == FW_MSG_CODE_DRV_LOAD_FUNCTION)) {
>                 bp->port.pmf = 1;
>                 /*
>                  * We need the barrier to ensure the ordering between the
> @@ -1808,9 +1818,13 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
>                  * bnx2x_periodic_task().
>                  */
>                 smp_mb();
> +netdev_info(bp->dev, "bnx2x_nic_load start period\n");
>                 queue_delayed_work(bnx2x_wq, &bp->period_task, 0);
>         } else
> +{
> +netdev_info(bp->dev, "bnx2x_nic_load NOT start period\n");
>                 bp->port.pmf = 0;
> +}
> 
>         DP(NETIF_MSG_LINK, "pmf %d\n", bp->port.pmf);
> 
Thanks Jean,
But your output does not suit the patch.
Your patch will start periodic for every instance, but printout show that it's started for PMF only (which is correct).
Generally if all functions are marked as PMF (port management function) you will get into the problem accessing shared port resources, like phys and internal data structures, then configuration/data will be corrupted.

Is it feasible to provide ethtool -i output and syslog when driver is loaded debug=0x4?

Thanks



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ