* [PATCH net-next 1/2] bnx2x: dont handle storage drv_info req if no cnic [not found] <Barak Witkowski <barak@broadcom.com> @ 2011-12-07 13:45 ` Barak Witkowski 2011-12-07 13:45 ` [PATCH net-next 2/2] bnx2x: fix typo in fcoe stats collection Barak Witkowski 2011-12-07 17:04 ` [PATCH net-next 1/2] bnx2x: dont handle storage drv_info req if no cnic Joe Perches 2011-12-14 10:14 ` [PATCH net-next 1/1] bnx2x: handle vpd data longer than 128 bytes Barak Witkowski 1 sibling, 2 replies; 8+ messages in thread From: Barak Witkowski @ 2011-12-07 13:45 UTC (permalink / raw) To: davem, netdev; +Cc: Barak Witkowski, Eilon Greenstein 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. Reported-by: Joe Perches <joe@perches.com> Signed-off-by: Barak Witkowski <barak@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.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 */ -- 1.7.7.4 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH net-next 2/2] bnx2x: fix typo in fcoe stats collection 2011-12-07 13:45 ` [PATCH net-next 1/2] bnx2x: dont handle storage drv_info req if no cnic Barak Witkowski @ 2011-12-07 13:45 ` Barak Witkowski 2011-12-07 18:39 ` David Miller 2011-12-07 17:04 ` [PATCH net-next 1/2] bnx2x: dont handle storage drv_info req if no cnic Joe Perches 1 sibling, 1 reply; 8+ messages in thread From: Barak Witkowski @ 2011-12-07 13:45 UTC (permalink / raw) To: davem, netdev; +Cc: Barak Witkowski, Eilon Greenstein Signed-off-by: Barak Witkowski <barak@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> --- drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c index d104695..12b8001 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c @@ -2994,7 +2994,7 @@ static void bnx2x_drv_info_fcoe_stat(struct bnx2x *bp) fcoe_q_tstorm_stats->rcv_bcast_pkts); ADD_64(fcoe_stat->rx_frames_hi, 0, fcoe_stat->rx_frames_lo, - fcoe_q_tstorm_stats->rcv_ucast_pkts); + fcoe_q_tstorm_stats->rcv_mcast_pkts); ADD_64(fcoe_stat->tx_bytes_hi, 0, fcoe_stat->tx_bytes_lo, fw_fcoe_stat->tx_stat.fcoe_tx_byte_cnt); -- 1.7.7.4 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH net-next 2/2] bnx2x: fix typo in fcoe stats collection 2011-12-07 13:45 ` [PATCH net-next 2/2] bnx2x: fix typo in fcoe stats collection Barak Witkowski @ 2011-12-07 18:39 ` David Miller 2011-12-08 14:13 ` [BUG] bnx2x: crash at boot Eric Dumazet 0 siblings, 1 reply; 8+ messages in thread From: David Miller @ 2011-12-07 18:39 UTC (permalink / raw) To: barak; +Cc: netdev, eilong From: "Barak Witkowski" <barak@broadcom.com> Date: Wed, 7 Dec 2011 15:45:36 +0200 > Signed-off-by: Barak Witkowski <barak@broadcom.com> > Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Applied. ^ permalink raw reply [flat|nested] 8+ messages in thread
* [BUG] bnx2x: crash at boot 2011-12-07 18:39 ` David Miller @ 2011-12-08 14:13 ` Eric Dumazet 0 siblings, 0 replies; 8+ messages in thread From: Eric Dumazet @ 2011-12-08 14:13 UTC (permalink / raw) To: David Miller; +Cc: barak, netdev, eilong Hi guys Latest net-next crashes in bnx2x_stats_init+0x678/0xc90 CR2: 000000000000000004da # CONFIG_SCSI_BNX2X_FCOE is not set Oh well... bnx2x_nic_init() bnx2x_nic_load() bnx2x_open() dev_change_flags() FCOE support is good, but could we get back Ethernet support ? ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net-next 1/2] bnx2x: dont handle storage drv_info req if no cnic 2011-12-07 13:45 ` [PATCH net-next 1/2] bnx2x: dont handle storage drv_info req if no cnic Barak Witkowski 2011-12-07 13:45 ` [PATCH net-next 2/2] bnx2x: fix typo in fcoe stats collection Barak Witkowski @ 2011-12-07 17:04 ` Joe Perches 2011-12-07 18:45 ` David Miller 1 sibling, 1 reply; 8+ messages in thread From: Joe Perches @ 2011-12-07 17:04 UTC (permalink / raw) To: Barak Witkowski; +Cc: davem, netdev, Eilon Greenstein 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@perches.com> > Signed-off-by: Barak Witkowski <barak@broadcom.com> > Signed-off-by: Eilon Greenstein <eilong@broadcom.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 */ ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net-next 1/2] bnx2x: dont handle storage drv_info req if no cnic 2011-12-07 17:04 ` [PATCH net-next 1/2] bnx2x: dont handle storage drv_info req if no cnic Joe Perches @ 2011-12-07 18:45 ` David Miller 0 siblings, 0 replies; 8+ messages in thread From: David Miller @ 2011-12-07 18:45 UTC (permalink / raw) To: joe; +Cc: barak, netdev, eilong From: Joe Perches <joe@perches.com> Date: Wed, 07 Dec 2011 09:04:00 -0800 > 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. Agreed, I'm not applying this patch. ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH net-next 1/1] bnx2x: handle vpd data longer than 128 bytes [not found] <Barak Witkowski <barak@broadcom.com> 2011-12-07 13:45 ` [PATCH net-next 1/2] bnx2x: dont handle storage drv_info req if no cnic Barak Witkowski @ 2011-12-14 10:14 ` Barak Witkowski 2011-12-14 18:35 ` David Miller 1 sibling, 1 reply; 8+ messages in thread From: Barak Witkowski @ 2011-12-14 10:14 UTC (permalink / raw) To: davem, netdev; +Cc: Barak Witkowski, Eilon Greenstein Signed-off-by: Barak Witkowski <barak@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> --- drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 35 +++++++++++++++++---- 1 files changed, 28 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c index b45baf9..ffeaaa9 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c @@ -9931,30 +9931,49 @@ static int __devinit bnx2x_get_hwinfo(struct bnx2x *bp) static void __devinit bnx2x_read_fwinfo(struct bnx2x *bp) { int cnt, i, block_end, rodi; - char vpd_data[BNX2X_VPD_LEN+1]; + char vpd_start[BNX2X_VPD_LEN+1]; char str_id_reg[VENDOR_ID_LEN+1]; char str_id_cap[VENDOR_ID_LEN+1]; + char *vpd_data; + char *vpd_extended_data = NULL; u8 len; - cnt = pci_read_vpd(bp->pdev, 0, BNX2X_VPD_LEN, vpd_data); + cnt = pci_read_vpd(bp->pdev, 0, BNX2X_VPD_LEN, vpd_start); memset(bp->fw_ver, 0, sizeof(bp->fw_ver)); if (cnt < BNX2X_VPD_LEN) goto out_not_found; - i = pci_vpd_find_tag(vpd_data, 0, BNX2X_VPD_LEN, + /* VPD RO tag should be first tag after identifier string, hence + * we should be able to find it in first BNX2X_VPD_LEN chars + */ + i = pci_vpd_find_tag(vpd_start, 0, BNX2X_VPD_LEN, PCI_VPD_LRDT_RO_DATA); if (i < 0) goto out_not_found; - block_end = i + PCI_VPD_LRDT_TAG_SIZE + - pci_vpd_lrdt_size(&vpd_data[i]); + pci_vpd_lrdt_size(&vpd_start[i]); i += PCI_VPD_LRDT_TAG_SIZE; - if (block_end > BNX2X_VPD_LEN) - goto out_not_found; + if (block_end > BNX2X_VPD_LEN) { + vpd_extended_data = kmalloc(block_end, GFP_KERNEL); + if (vpd_extended_data == NULL) + goto out_not_found; + + /* read rest of vpd image into vpd_extended_data */ + memcpy(vpd_extended_data, vpd_start, BNX2X_VPD_LEN); + cnt = pci_read_vpd(bp->pdev, BNX2X_VPD_LEN, + block_end - BNX2X_VPD_LEN, + vpd_extended_data + BNX2X_VPD_LEN); + if (cnt < (block_end - BNX2X_VPD_LEN)) + goto out_not_found; + vpd_data = vpd_extended_data; + } else + vpd_data = vpd_start; + + /* now vpd_data holds full vpd content in both cases */ rodi = pci_vpd_find_info_keyword(vpd_data, i, block_end, PCI_VPD_RO_KEYWORD_MFR_ID); @@ -9986,9 +10005,11 @@ static void __devinit bnx2x_read_fwinfo(struct bnx2x *bp) bp->fw_ver[len] = ' '; } } + kfree(vpd_extended_data); return; } out_not_found: + kfree(vpd_extended_data); return; } -- 1.7.7.4 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH net-next 1/1] bnx2x: handle vpd data longer than 128 bytes 2011-12-14 10:14 ` [PATCH net-next 1/1] bnx2x: handle vpd data longer than 128 bytes Barak Witkowski @ 2011-12-14 18:35 ` David Miller 0 siblings, 0 replies; 8+ messages in thread From: David Miller @ 2011-12-14 18:35 UTC (permalink / raw) To: barak; +Cc: netdev, eilong From: "Barak Witkowski" <barak@broadcom.com> Date: Wed, 14 Dec 2011 12:14:53 +0200 > Signed-off-by: Barak Witkowski <barak@broadcom.com> > Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Applied. ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2011-12-14 18:35 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <Barak Witkowski <barak@broadcom.com>
2011-12-07 13:45 ` [PATCH net-next 1/2] bnx2x: dont handle storage drv_info req if no cnic Barak Witkowski
2011-12-07 13:45 ` [PATCH net-next 2/2] bnx2x: fix typo in fcoe stats collection Barak Witkowski
2011-12-07 18:39 ` David Miller
2011-12-08 14:13 ` [BUG] bnx2x: crash at boot Eric Dumazet
2011-12-07 17:04 ` [PATCH net-next 1/2] bnx2x: dont handle storage drv_info req if no cnic Joe Perches
2011-12-07 18:45 ` David Miller
2011-12-14 10:14 ` [PATCH net-next 1/1] bnx2x: handle vpd data longer than 128 bytes Barak Witkowski
2011-12-14 18:35 ` David Miller
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).