[dpdk-dev] [PATCH v2 14/36] net/ice/base: add dedicate MAC type for E810

Qi Zhang qi.z.zhang at intel.com
Mon Mar 23 08:17:37 CET 2020


Add a new MAC type ICE_MAC_E810 to distinguish E810 devices from other
devices. MAC types for all other devices will be ICE_MAC_GENERIC till
there's a need to distinguish further between devices.

Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan at intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr at intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang at intel.com>
---
 drivers/net/ice/base/ice_common.c | 42 ++++++++++++++++++++++++++-------------
 drivers/net/ice/base/ice_type.h   |  1 +
 2 files changed, 29 insertions(+), 14 deletions(-)

diff --git a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c
index 3fae6e731..3fa2256e8 100644
--- a/drivers/net/ice/base/ice_common.c
+++ b/drivers/net/ice/base/ice_common.c
@@ -20,24 +20,38 @@
  */
 static enum ice_status ice_set_mac_type(struct ice_hw *hw)
 {
-	enum ice_status status = ICE_SUCCESS;
-
 	ice_debug(hw, ICE_DBG_TRACE, "%s\n", __func__);
 
-	if (hw->vendor_id == ICE_INTEL_VENDOR_ID) {
-		switch (hw->device_id) {
-		default:
-			hw->mac_type = ICE_MAC_GENERIC;
-			break;
-		}
-	} else {
-		status = ICE_ERR_DEVICE_NOT_SUPPORTED;
+	if (hw->vendor_id != ICE_INTEL_VENDOR_ID)
+		return ICE_ERR_DEVICE_NOT_SUPPORTED;
+
+	switch (hw->device_id) {
+	case ICE_DEV_ID_E810C_BACKPLANE:
+	case ICE_DEV_ID_E810C_QSFP:
+	case ICE_DEV_ID_E810C_SFP:
+	case ICE_DEV_ID_E810_XXV_BACKPLANE:
+	case ICE_DEV_ID_E810_XXV_QSFP:
+	case ICE_DEV_ID_E810_XXV_SFP:
+		hw->mac_type = ICE_MAC_E810;
+		break;
+	case ICE_DEV_ID_E822C_10G_BASE_T:
+	case ICE_DEV_ID_E822C_BACKPLANE:
+	case ICE_DEV_ID_E822C_QSFP:
+	case ICE_DEV_ID_E822C_SFP:
+	case ICE_DEV_ID_E822C_SGMII:
+	case ICE_DEV_ID_E822L_10G_BASE_T:
+	case ICE_DEV_ID_E822L_BACKPLANE:
+	case ICE_DEV_ID_E822L_SFP:
+	case ICE_DEV_ID_E822L_SGMII:
+		hw->mac_type = ICE_MAC_GENERIC;
+		break;
+	default:
+		hw->mac_type = ICE_MAC_UNKNOWN;
+		break;
 	}
 
-	ice_debug(hw, ICE_DBG_INIT, "found mac_type: %d, status: %d\n",
-		  hw->mac_type, status);
-
-	return status;
+	ice_debug(hw, ICE_DBG_INIT, "mac_type: %d\n", hw->mac_type);
+	return ICE_SUCCESS;
 }
 
 /**
diff --git a/drivers/net/ice/base/ice_type.h b/drivers/net/ice/base/ice_type.h
index 29fa34fc0..3e24bb1dc 100644
--- a/drivers/net/ice/base/ice_type.h
+++ b/drivers/net/ice/base/ice_type.h
@@ -205,6 +205,7 @@ enum ice_set_fc_aq_failures {
 /* MAC types */
 enum ice_mac_type {
 	ICE_MAC_UNKNOWN = 0,
+	ICE_MAC_E810,
 	ICE_MAC_GENERIC,
 };
 
-- 
2.13.6



More information about the dev mailing list