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: <1323277440.1762.46.camel@joe2Laptop>
Date:	Wed, 07 Dec 2011 09:04:00 -0800
From:	Joe Perches <joe@...ches.com>
To:	Barak Witkowski <barak@...adcom.com>
Cc:	davem@...emloft.net, netdev@...r.kernel.org,
	Eilon Greenstein <eilong@...adcom.com>
Subject: Re: [PATCH net-next 1/2] bnx2x: dont handle storage drv_info req if
 no cnic

On Wed, 2011-12-07 at 15:45 +0200, Barak Witkowski wrote:
> This patch returns ACK with zeroed buffer to FW upon fcoe/iscsi drv_info
> request if cnic is not defined. This is better handling in comparison to
> send NACK to FW upon such request, as it's a valid request.

Hi Barak.

Other than the good comment,
I think this patch isn't useful.
It adds maintenance overhead.

It just adds more #ifdefs.

gcc should remove the call to the
empty static void funcs.

> Reported-by: Joe Perches <joe@...ches.com>
> Signed-off-by: Barak Witkowski <barak@...adcom.com>
> Signed-off-by: Eilon Greenstein <eilong@...adcom.com>
> ---
>  drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c |   12 ++++++++----
>  1 files changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
> index 418e7d3..d104695 100644
> --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
> +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
> @@ -2941,9 +2941,9 @@ static void bnx2x_drv_info_ether_stat(struct bnx2x *bp)
>  	ether_stat->rxq_size = bp->rx_ring_size;
>  }
>  
> +#ifdef BCM_CNIC
>  static void bnx2x_drv_info_fcoe_stat(struct bnx2x *bp)
>  {
> -#ifdef BCM_CNIC
>  	struct bnx2x_dcbx_app_params *app = &bp->dcbx_port_params.app;
>  	struct fcoe_stats_info *fcoe_stat =
>  		&bp->slowpath->drv_info_to_mcp.fcoe_stat;
> @@ -3029,12 +3029,12 @@ static void bnx2x_drv_info_fcoe_stat(struct bnx2x *bp)
>  
>  	/* ask L5 driver to add data to the struct */
>  	bnx2x_cnic_notify(bp, CNIC_CTL_FCOE_STATS_GET_CMD);
> -#endif
>  }
> +#endif
>  
> +#ifdef BCM_CNIC
>  static void bnx2x_drv_info_iscsi_stat(struct bnx2x *bp)
>  {
> -#ifdef BCM_CNIC
>  	struct bnx2x_dcbx_app_params *app = &bp->dcbx_port_params.app;
>  	struct iscsi_stats_info *iscsi_stat =
>  		&bp->slowpath->drv_info_to_mcp.iscsi_stat;
> @@ -3046,8 +3046,8 @@ static void bnx2x_drv_info_iscsi_stat(struct bnx2x *bp)
>  
>  	/* ask L5 driver to add data to the struct */
>  	bnx2x_cnic_notify(bp, CNIC_CTL_ISCSI_STATS_GET_CMD);
> -#endif
>  }
> +#endif
>  
>  /* called due to MCP event (on pmf):
>   *	reread new bandwidth configuration
> @@ -3091,10 +3091,14 @@ static void bnx2x_handle_drv_info_req(struct bnx2x *bp)
>  		bnx2x_drv_info_ether_stat(bp);
>  		break;
>  	case FCOE_STATS_OPCODE:
> +#ifdef BCM_CNIC
>  		bnx2x_drv_info_fcoe_stat(bp);
> +#endif
>  		break;
>  	case ISCSI_STATS_OPCODE:
> +#ifdef BCM_CNIC
>  		bnx2x_drv_info_iscsi_stat(bp);
> +#endif
>  		break;
>  	default:
>  		/* if op code isn't supported - send NACK */

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ