[dpdk-dev] net/ixgbe: correct error when SFP not present

Message ID 1485245660-2127-1-git-send-email-wei.dai@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel compilation success Compilation OK

Commit Message

Wei Dai Jan. 24, 2017, 8:14 a.m. UTC
  Ignore the error=IXGBE_ERR_SFP_NOT_PRESENT when SFP is not present.
If it is not ignored, testpmd will in the NIC initialization process.
Ixgbe kernel driver ignores this error and works well. So DPDK
does same thing.

Signed-off-by: Wei Dai <wei.dai@intel.com>
Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Tested-by: Yuan Peng <yuan.peng@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 5 +++++
 1 file changed, 5 insertions(+)
  

Comments

Wenzhuo Lu Jan. 24, 2017, 8:51 a.m. UTC | #1
Hi,


> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wei Dai
> Sent: Tuesday, January 24, 2017 4:14 PM
> To: dev@dpdk.org
> Cc: Zhang, Helin; Ananyev, Konstantin; Dai, Wei
> Subject: [dpdk-dev] [PATCH] net/ixgbe: correct error when SFP not present
> 
> Ignore the error=IXGBE_ERR_SFP_NOT_PRESENT when SFP is not present.
> If it is not ignored, testpmd will in the NIC initialization process.
> Ixgbe kernel driver ignores this error and works well. So DPDK does same thing.
> 
> Signed-off-by: Wei Dai <wei.dai@intel.com>
> Signed-off-by: Helin Zhang <helin.zhang@intel.com>
> Tested-by: Yuan Peng <yuan.peng@intel.com>
Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
  
Ferruh Yigit Jan. 24, 2017, 3:55 p.m. UTC | #2
On 1/24/2017 8:51 AM, Lu, Wenzhuo wrote:
<...>
>>
>> Ignore the error=IXGBE_ERR_SFP_NOT_PRESENT when SFP is not present.
>> If it is not ignored, testpmd will in the NIC initialization process.
>> Ixgbe kernel driver ignores this error and works well. So DPDK does same thing.
>>
>> Signed-off-by: Wei Dai <wei.dai@intel.com>
>> Signed-off-by: Helin Zhang <helin.zhang@intel.com>
>> Tested-by: Yuan Peng <yuan.peng@intel.com>
> Acked-by: Wenzhuo Lu <wenzhuo.lu@intel.com>

Applied to dpdk-next-net/master, thanks.
  

Patch

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index bdf4e2b..ae7fb86 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -898,6 +898,8 @@  ixgbe_pf_reset_hw(struct ixgbe_hw *hw)
 	IXGBE_WRITE_REG(hw, IXGBE_CTRL_EXT, ctrl_ext);
 	IXGBE_WRITE_FLUSH(hw);
 
+	if (status == IXGBE_ERR_SFP_NOT_PRESENT)
+		status = IXGBE_SUCCESS;
 	return status;
 }
 
@@ -1237,6 +1239,9 @@  eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev)
 		diag = ixgbe_init_hw(hw);
 	}
 
+	if (diag == IXGBE_ERR_SFP_NOT_PRESENT)
+		diag = IXGBE_SUCCESS;
+
 	if (diag == IXGBE_ERR_EEPROM_VERSION) {
 		PMD_INIT_LOG(ERR, "This device is a pre-production adapter/"
 			     "LOM.  Please be aware there may be issues associated "