Netdev Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH net] bnx2x: Check if transceiver implements DDM before access
@ 2019-06-13 19:25 Mauro S. M. Rodrigues
  2019-06-16 20:39 ` David Miller
  2019-06-18 17:02 ` David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Mauro S. M. Rodrigues @ 2019-06-13 19:25 UTC (permalink / raw)
  To: netdev; +Cc: aelior, skalluru, GR-everest-linux-l2, davem, maurosr

Some transceivers may comply with SFF-8472 even though they do not
implement the Digital Diagnostic Monitoring (DDM) interface described in
the spec. The existence of such area is specified by the 6th bit of byte
92, set to 1 if implemented.

Currently, without checking this bit, bnx2x fails trying to read sfp
module's EEPROM with the follow message:

ethtool -m enP5p1s0f1
Cannot get Module EEPROM data: Input/output error

Because it fails to read the additional 256 bytes in which it is assumed
to exist the DDM data.

This issue was noticed using a Mellanox Passive DAC PN 01FT738. The EEPROM
data was confirmed by Mellanox as correct and similar to other Passive
DACs from other manufacturers.

Signed-off-by: Mauro S. M. Rodrigues <maurosr@linux.vnet.ibm.com>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | 3 ++-
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h    | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
index 0745cccd416d..51fc845de31a 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
@@ -1609,7 +1609,8 @@ static int bnx2x_get_module_info(struct net_device *dev,
 	}
 
 	if (!sff8472_comp ||
-	    (diag_type & SFP_EEPROM_DIAG_ADDR_CHANGE_REQ)) {
+	    (diag_type & SFP_EEPROM_DIAG_ADDR_CHANGE_REQ) ||
+	    !(diag_type & SFP_EEPROM_DDM_IMPLEMENTED)) {
 		modinfo->type = ETH_MODULE_SFF_8079;
 		modinfo->eeprom_len = ETH_MODULE_SFF_8079_LEN;
 	} else {
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h
index b7d251108c19..7115f5025664 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h
@@ -62,6 +62,7 @@
 #define SFP_EEPROM_DIAG_TYPE_ADDR		0x5c
 #define SFP_EEPROM_DIAG_TYPE_SIZE		1
 #define SFP_EEPROM_DIAG_ADDR_CHANGE_REQ		(1<<2)
+#define SFP_EEPROM_DDM_IMPLEMENTED		(1<<6)
 #define SFP_EEPROM_SFF_8472_COMP_ADDR		0x5e
 #define SFP_EEPROM_SFF_8472_COMP_SIZE		1
 
-- 
2.21.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net] bnx2x: Check if transceiver implements DDM before access
  2019-06-13 19:25 [PATCH net] bnx2x: Check if transceiver implements DDM before access Mauro S. M. Rodrigues
@ 2019-06-16 20:39 ` David Miller
  2019-06-17 11:47   ` Sudarsana Reddy Kalluru
  2019-06-18 17:02 ` David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: David Miller @ 2019-06-16 20:39 UTC (permalink / raw)
  To: maurosr; +Cc: netdev, aelior, skalluru, GR-everest-linux-l2

From: "Mauro S. M. Rodrigues" <maurosr@linux.vnet.ibm.com>
Date: Thu, 13 Jun 2019 16:25:40 -0300

> Some transceivers may comply with SFF-8472 even though they do not
> implement the Digital Diagnostic Monitoring (DDM) interface described in
> the spec. The existence of such area is specified by the 6th bit of byte
> 92, set to 1 if implemented.
> 
> Currently, without checking this bit, bnx2x fails trying to read sfp
> module's EEPROM with the follow message:
> 
> ethtool -m enP5p1s0f1
> Cannot get Module EEPROM data: Input/output error
> 
> Because it fails to read the additional 256 bytes in which it is assumed
> to exist the DDM data.
> 
> This issue was noticed using a Mellanox Passive DAC PN 01FT738. The EEPROM
> data was confirmed by Mellanox as correct and similar to other Passive
> DACs from other manufacturers.
> 
> Signed-off-by: Mauro S. M. Rodrigues <maurosr@linux.vnet.ibm.com>

Marvell folks, please review.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH net] bnx2x: Check if transceiver implements DDM before access
  2019-06-16 20:39 ` David Miller
@ 2019-06-17 11:47   ` Sudarsana Reddy Kalluru
  0 siblings, 0 replies; 4+ messages in thread
From: Sudarsana Reddy Kalluru @ 2019-06-17 11:47 UTC (permalink / raw)
  To: David Miller, maurosr; +Cc: netdev, Ariel Elior, GR-everest-linux-l2

> -----Original Message-----
> From: David Miller <davem@davemloft.net>
> Sent: Monday, June 17, 2019 2:09 AM
> To: maurosr@linux.vnet.ibm.com
> Cc: netdev@vger.kernel.org; Ariel Elior <aelior@marvell.com>; Sudarsana
> Reddy Kalluru <skalluru@marvell.com>; GR-everest-linux-l2 <GR-everest-
> linux-l2@marvell.com>
> Subject: Re: [PATCH net] bnx2x: Check if transceiver implements DDM before
> access
> 
> From: "Mauro S. M. Rodrigues" <maurosr@linux.vnet.ibm.com>
> Date: Thu, 13 Jun 2019 16:25:40 -0300
> 
> > Some transceivers may comply with SFF-8472 even though they do not
> > implement the Digital Diagnostic Monitoring (DDM) interface described
> > in the spec. The existence of such area is specified by the 6th bit of
> > byte 92, set to 1 if implemented.
> >
> > Currently, without checking this bit, bnx2x fails trying to read sfp
> > module's EEPROM with the follow message:
> >
> > ethtool -m enP5p1s0f1
> > Cannot get Module EEPROM data: Input/output error
> >
> > Because it fails to read the additional 256 bytes in which it is
> > assumed to exist the DDM data.
> >
> > This issue was noticed using a Mellanox Passive DAC PN 01FT738. The
> > EEPROM data was confirmed by Mellanox as correct and similar to other
> > Passive DACs from other manufacturers.
> >
> > Signed-off-by: Mauro S. M. Rodrigues <maurosr@linux.vnet.ibm.com>
> 
> Marvell folks, please review.

Acked-by: Sudarsana Reddy Kalluru <skalluru@marvell.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net] bnx2x: Check if transceiver implements DDM before access
  2019-06-13 19:25 [PATCH net] bnx2x: Check if transceiver implements DDM before access Mauro S. M. Rodrigues
  2019-06-16 20:39 ` David Miller
@ 2019-06-18 17:02 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2019-06-18 17:02 UTC (permalink / raw)
  To: maurosr; +Cc: netdev, aelior, skalluru, GR-everest-linux-l2

From: "Mauro S. M. Rodrigues" <maurosr@linux.vnet.ibm.com>
Date: Thu, 13 Jun 2019 16:25:40 -0300

> Some transceivers may comply with SFF-8472 even though they do not
> implement the Digital Diagnostic Monitoring (DDM) interface described in
> the spec. The existence of such area is specified by the 6th bit of byte
> 92, set to 1 if implemented.
> 
> Currently, without checking this bit, bnx2x fails trying to read sfp
> module's EEPROM with the follow message:
> 
> ethtool -m enP5p1s0f1
> Cannot get Module EEPROM data: Input/output error
> 
> Because it fails to read the additional 256 bytes in which it is assumed
> to exist the DDM data.
> 
> This issue was noticed using a Mellanox Passive DAC PN 01FT738. The EEPROM
> data was confirmed by Mellanox as correct and similar to other Passive
> DACs from other manufacturers.
> 
> Signed-off-by: Mauro S. M. Rodrigues <maurosr@linux.vnet.ibm.com>

Applied, thank you.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, back to index

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-13 19:25 [PATCH net] bnx2x: Check if transceiver implements DDM before access Mauro S. M. Rodrigues
2019-06-16 20:39 ` David Miller
2019-06-17 11:47   ` Sudarsana Reddy Kalluru
2019-06-18 17:02 ` David Miller

Netdev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/netdev/0 netdev/git/0.git
	git clone --mirror https://lore.kernel.org/netdev/1 netdev/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 netdev netdev/ https://lore.kernel.org/netdev \
		netdev@vger.kernel.org netdev@archiver.kernel.org
	public-inbox-index netdev


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.netdev


AGPL code for this site: git clone https://public-inbox.org/ public-inbox