Skip to contentSkip to conversation

net/ixgbe/base: fix check for PHY reset

PATCH Superseded Wei Dai 2 participants 36 messages Dec 4, 2016 – Dec 21, 2016 Network drivers

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Wei Dai

author
#0 lore raw

PATCH 1/29 net/ixgbe/base: fix check for PHY reset

The previously generic PHY reset check is not sufficient for the PHY type = ixgbe_phy_x550em_ext_t.
This patch fixes it.

Fixes af75078fece3 ("first public release")
---
 drivers/net/ixgbe/base/ixgbe_phy.c | 29 ++++++++++++++++++++++++-----
 1 file changed, 24 insertions(+), 5 deletions(-)
drivers/net/ixgbe/base/ixgbe_phy.c +24 -5
index 43c55d7..1d9fb3e 100644
@@ -528,11 +528,30 @@ s32 ixgbe_reset_phy_generic(struct ixgbe_hw *hw)
 	 */
 	for (i = 0; i < 30; i++) {
 		msec_delay(100);
-		hw->phy.ops.read_reg(hw, IXGBE_MDIO_PHY_XS_CONTROL,
-				     IXGBE_MDIO_PHY_XS_DEV_TYPE, &ctrl);
-		if (!(ctrl & IXGBE_MDIO_PHY_XS_RESET)) {
-			usec_delay(2);
-			break;
+		if (hw->phy.type == ixgbe_phy_x550em_ext_t) {
+			status = hw->phy.ops.read_reg(hw,
+						  IXGBE_MDIO_TX_VENDOR_ALARMS_3,
+						  IXGBE_MDIO_PMA_PMD_DEV_TYPE,
+						  &ctrl);
+			if (status != IXGBE_SUCCESS)
+				return status;
+
+			if (ctrl & IXGBE_MDIO_TX_VENDOR_ALARMS_3_RST_MASK) {
+				usec_delay(2);
+				break;
+			}
+		} else {
+			status = hw->phy.ops.read_reg(hw,
+						     IXGBE_MDIO_PHY_XS_CONTROL,
+						     IXGBE_MDIO_PHY_XS_DEV_TYPE,
+						     &ctrl);
+			if (status != IXGBE_SUCCESS)
+				return status;
+
+			if (!(ctrl & IXGBE_MDIO_PHY_XS_RESET)) {
+				usec_delay(2);
+				break;
+			}
 		}
 	}
 
Signature · 1 line
2.7.4
author
#1 lore raw

PATCH 2/29 net/ixgbe/base: fix condition to clear RAR entry

Specifically the RAR entry for the SAN MAC address is being cleared when the VMDq pool bits are cleared. In order to prevent this we need to add an extra check to protect the SAN MAC from being cleared.

Fixes af75078fece3 ("first public release")
---
 drivers/net/ixgbe/base/ixgbe_common.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ixgbe/base/ixgbe_common.c +2 -1
index cca19ef..b2cc6fb 100644
@@ -3764,7 +3764,8 @@ s32 ixgbe_clear_vmdq_generic(struct ixgbe_hw *hw, u32 rar, u32 vmdq)
 	}
 
 	/* was that the last pool using this rar? */
-	if (mpsar_lo == 0 && mpsar_hi == 0 && rar != 0)
+	if (mpsar_lo == 0 && mpsar_hi == 0 &&
+	    rar != 0 && rar != hw->mac.san_mac_rar_index)
 		hw->mac.ops.clear_rar(hw, rar);
 done:
 	return IXGBE_SUCCESS;
Signature · 1 line
2.7.4
author
#2 lore raw

PATCH 3/29 net/ixgbe/base: use fast MDIO for non-10G MDIO devices

In reply to Wei Dai

Devices that cannot go 10G can safely select a faster MDIO speed than those devices that can possibly connect at 10G. So select the higher speed for those devices.

---
 drivers/net/ixgbe/base/ixgbe_x550.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/net/ixgbe/base/ixgbe_x550.c +7 -2
index acb8140..c1fac1a 100644
@@ -2549,8 +2549,6 @@ STATIC void ixgbe_set_mdio_speed(struct ixgbe_hw *hw)
 	case IXGBE_DEV_ID_X550EM_X_10G_T:
 	case IXGBE_DEV_ID_X550EM_A_SGMII:
 	case IXGBE_DEV_ID_X550EM_A_SGMII_L:
-	case IXGBE_DEV_ID_X550EM_A_1G_T:
-	case IXGBE_DEV_ID_X550EM_A_1G_T_L:
 	case IXGBE_DEV_ID_X550EM_A_10G_T:
 	case IXGBE_DEV_ID_X550EM_A_SFP:
 	case IXGBE_DEV_ID_X550EM_A_QSFP:
@@ -2559,6 +2557,13 @@ STATIC void ixgbe_set_mdio_speed(struct ixgbe_hw *hw)
 		hlreg0 &= ~IXGBE_HLREG0_MDCSPD;
 		IXGBE_WRITE_REG(hw, IXGBE_HLREG0, hlreg0);
 		break;
+	case IXGBE_DEV_ID_X550EM_A_1G_T:
+	case IXGBE_DEV_ID_X550EM_A_1G_T_L:
+		/* Select fast MDIO clock speed for these devices */
+		hlreg0 = IXGBE_READ_REG(hw, IXGBE_HLREG0);
+		hlreg0 |= IXGBE_HLREG0_MDCSPD;
+		IXGBE_WRITE_REG(hw, IXGBE_HLREG0, hlreg0);
+		break;
 	default:
 		break;
 	}
Signature · 1 line
2.7.4
author
#3 lore raw

PATCH 4/29 net/ixgbe/base: fix PHY identification

In reply to Wei Dai

previous method to identify the CS4223/CS4227 is incorrect and unreliable. This patch provide a new register to differentiate between these PHY SKUs.

Fixes fc0559bdb5e3 ("net/ixgbe/base: add link MAC setup for X550a SFP+")
---
 drivers/net/ixgbe/base/ixgbe_phy.h  | 5 +++--
 drivers/net/ixgbe/base/ixgbe_x550.c | 6 +++---
 2 files changed, 6 insertions(+), 5 deletions(-)
drivers/net/ixgbe/base/ixgbe_phy.h +3 -2
index da14abc..816de36 100644
@@ -92,8 +92,9 @@ POSSIBILITY OF SUCH DAMAGE.
 #define IXGBE_CS4227_GLOBAL_ID_MSB	1
 #define IXGBE_CS4227_SCRATCH		2
 #define IXGBE_CS4227_GLOBAL_ID_VALUE	0x03E5
-#define IXGBE_CS4223_PHY_ID		0x7003	/* Quad port */
-#define IXGBE_CS4227_PHY_ID		0x3003	/* Dual port */
+#define IXGBE_CS4227_EFUSE_PDF_SKU	0x19F
+#define IXGBE_CS4223_SKU_ID		0x0010	/* Quad port */
+#define IXGBE_CS4227_SKU_ID		0x0014	/* Dual port */
 #define IXGBE_CS4227_RESET_PENDING	0x1357
 #define IXGBE_CS4227_RESET_COMPLETE	0x5AA5
 #define IXGBE_CS4227_RETRIES		15
drivers/net/ixgbe/base/ixgbe_x550.c +3 -3
index c1fac1a..f5143f9 100644
@@ -2927,8 +2927,8 @@ s32 ixgbe_setup_mac_link_sfp_x550a(struct ixgbe_hw *hw,
 			return IXGBE_ERR_PHY_ADDR_INVALID;
 		}
 
-		/* Get external PHY device id */
-		ret_val = hw->phy.ops.read_reg(hw, IXGBE_CS4227_GLOBAL_ID_MSB,
+		/* Get external PHY SKU id */
+		ret_val = hw->phy.ops.read_reg(hw, IXGBE_CS4227_EFUSE_PDF_SKU,
 					IXGBE_MDIO_ZERO_DEV_TYPE, &reg_phy_ext);
 
 		if (ret_val != IXGBE_SUCCESS)
@@ -2937,7 +2937,7 @@ s32 ixgbe_setup_mac_link_sfp_x550a(struct ixgbe_hw *hw,
 		/* When configuring quad port CS4223, the MAC instance is part
 		 * of the slice offset.
 		 */
-		if (reg_phy_ext == IXGBE_CS4223_PHY_ID)
+		if (reg_phy_ext == IXGBE_CS4223_SKU_ID)
 			slice_offset = (hw->bus.lan_id +
 					(hw->bus.instance_id << 1)) << 12;
 		else
Signature · 1 line
2.7.4
author
#4 lore raw

PATCH 5/29 net/ixgbe/base: clean up X557 link status check

In reply to Wei Dai

This patch cleans up the code and clarifies the comment around the X557 PHY link status check in ixgbe_check_link_t_x550em( ).

---
 drivers/net/ixgbe/base/ixgbe_x550.c | 25 +++++++++++--------------
 1 file changed, 11 insertions(+), 14 deletions(-)
drivers/net/ixgbe/base/ixgbe_x550.c +11 -14
index f5143f9..69aa9d5 100644
@@ -4660,7 +4660,7 @@ s32 ixgbe_check_link_t_X550em(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
 			      bool *link_up, bool link_up_wait_to_complete)
 {
 	u32 status;
-	u16 autoneg_status;
+	u16 i, autoneg_status = 0;
 
 	if (hw->mac.ops.get_media_type(hw) != ixgbe_media_type_copper)
 		return IXGBE_ERR_CONFIG;
@@ -4673,21 +4673,18 @@ s32 ixgbe_check_link_t_X550em(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
 		return status;
 
 	/* MAC link is up, so check external PHY link.
-	 * Read this twice back to back to indicate current status.
+	 * X557 PHY. Link status is latching low, and can only be used to detect
+	 * link drop, and not the current status of the link without performing
+	 * back-to-back reads.
 	 */
-	status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_STATUS,
-				      IXGBE_MDIO_AUTO_NEG_DEV_TYPE,
-				      &autoneg_status);
-
-	if (status != IXGBE_SUCCESS)
-		return status;
-
-	status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_STATUS,
-				      IXGBE_MDIO_AUTO_NEG_DEV_TYPE,
-				      &autoneg_status);
+	for (i = 0; i < 2; i++) {
+		status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_STATUS,
+					      IXGBE_MDIO_AUTO_NEG_DEV_TYPE,
+					      &autoneg_status);
 
-	if (status != IXGBE_SUCCESS)
-		return status;
+		if (status != IXGBE_SUCCESS)
+			return status;
+	}
 
 	/* If external PHY link is not up, then indicate link not up */
 	if (!(autoneg_status & IXGBE_MDIO_AUTO_NEG_LINK_STATUS))
Signature · 1 line
2.7.4
author
#5 lore raw

PATCH 6/29 net/ixgbe/base: add driver version to firmware

In reply to Wei Dai

This patch sends the driver version string to firmware through the host interface command on x550 devices.

---
 drivers/net/ixgbe/base/ixgbe_api.c    |  7 ++--
 drivers/net/ixgbe/base/ixgbe_api.h    |  2 +-
 drivers/net/ixgbe/base/ixgbe_common.c |  4 ++-
 drivers/net/ixgbe/base/ixgbe_common.h |  2 +-
 drivers/net/ixgbe/base/ixgbe_type.h   | 14 +++++++-
 drivers/net/ixgbe/base/ixgbe_x550.c   | 63 +++++++++++++++++++++++++++++++++++
 drivers/net/ixgbe/base/ixgbe_x550.h   |  2 ++
 7 files changed, 88 insertions(+), 6 deletions(-)
drivers/net/ixgbe/base/ixgbe_api.c +5 -2
index 094ee52..0ddafcb 100644
@@ -1147,12 +1147,15 @@ s32 ixgbe_setup_fc(struct ixgbe_hw *hw)
  * @min: driver minor number to be sent to firmware
  * @build: driver build number to be sent to firmware
  * @ver: driver version number to be sent to firmware
+ * @len: length of driver_ver string
+ * @driver_ver: driver string
  **/
 s32 ixgbe_set_fw_drv_ver(struct ixgbe_hw *hw, u8 maj, u8 min, u8 build,
-			 u8 ver)
+			 u8 ver, u16 len, char *driver_ver)
 {
 	return ixgbe_call_func(hw, hw->mac.ops.set_fw_drv_ver, (hw, maj, min,
-			       build, ver), IXGBE_NOT_IMPLEMENTED);
+			       build, ver, len, driver_ver),
+			       IXGBE_NOT_IMPLEMENTED);
 }
 
 
drivers/net/ixgbe/base/ixgbe_api.h +1 -1
index 24c4ae8..af85d4e 100644
@@ -133,7 +133,7 @@ s32 ixgbe_set_vlvf(struct ixgbe_hw *hw, u32 vlan, u32 vind,
 s32 ixgbe_fc_enable(struct ixgbe_hw *hw);
 s32 ixgbe_setup_fc(struct ixgbe_hw *hw);
 s32 ixgbe_set_fw_drv_ver(struct ixgbe_hw *hw, u8 maj, u8 min, u8 build,
-			 u8 ver);
+			 u8 ver, u16 len, char *driver_ver);
 s32 ixgbe_get_thermal_sensor_data(struct ixgbe_hw *hw);
 s32 ixgbe_init_thermal_sensor_thresh(struct ixgbe_hw *hw);
 void ixgbe_set_mta(struct ixgbe_hw *hw, u8 *mc_addr);
drivers/net/ixgbe/base/ixgbe_common.c +3 -1
index b2cc6fb..a6016dc 100644
@@ -4596,13 +4596,15 @@ s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, u32 *buffer,
  *  semaphore or IXGBE_ERR_HOST_INTERFACE_COMMAND when command fails.
  **/
 s32 ixgbe_set_fw_drv_ver_generic(struct ixgbe_hw *hw, u8 maj, u8 min,
-				 u8 build, u8 sub)
+				 u8 build, u8 sub, u16 len,
+				 const char *driver_ver)
 {
 	struct ixgbe_hic_drv_info fw_cmd;
 	int i;
 	s32 ret_val = IXGBE_SUCCESS;
 
 	DEBUGFUNC("ixgbe_set_fw_drv_ver_generic");
+	UNREFERENCED_2PARAMETER(len, driver_ver);
 
 	fw_cmd.hdr.cmd = FW_CEM_CMD_DRIVER_INFO;
 	fw_cmd.hdr.buf_len = FW_CEM_CMD_DRIVER_INFO_LEN;
drivers/net/ixgbe/base/ixgbe_common.h +1 -1
index 66dd565..ae28206 100644
@@ -155,7 +155,7 @@ void ixgbe_set_rxpba_generic(struct ixgbe_hw *hw, int num_pb, u32 headroom,
 			     int strategy);
 void ixgbe_enable_relaxed_ordering_gen2(struct ixgbe_hw *hw);
 s32 ixgbe_set_fw_drv_ver_generic(struct ixgbe_hw *hw, u8 maj, u8 min,
-				 u8 build, u8 ver);
+				 u8 build, u8 ver, u16 len, const char *str);
 u8 ixgbe_calculate_checksum(u8 *buffer, u32 length);
 s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, u32 *buffer,
 				 u32 length, u32 timeout, bool return_data);
drivers/net/ixgbe/base/ixgbe_type.h +13 -1
index 4982e03..5b2506a 100644
@@ -3037,6 +3037,7 @@ enum ixgbe_fdir_pballoc_type {
 #define FW_CEM_UNUSED_VER		0x0
 #define FW_CEM_MAX_RETRIES		3
 #define FW_CEM_RESP_STATUS_SUCCESS	0x1
+#define FW_CEM_DRIVER_VERSION_SIZE	39 /* +9 would send 48 bytes to fw */
 #define FW_READ_SHADOW_RAM_CMD		0x31
 #define FW_READ_SHADOW_RAM_LEN		0x6
 #define FW_WRITE_SHADOW_RAM_CMD		0x33
@@ -3111,6 +3112,16 @@ struct ixgbe_hic_drv_info {
 	u16 pad2; /* end spacing to ensure length is mult. of dword2 */
 };
 
+struct ixgbe_hic_drv_info2 {
+	struct ixgbe_hic_hdr hdr;
+	u8 port_num;
+	u8 ver_sub;
+	u8 ver_build;
+	u8 ver_min;
+	u8 ver_maj;
+	char driver_string[FW_CEM_DRIVER_VERSION_SIZE];
+};
+
 /* These need to be dword aligned */
 struct ixgbe_hic_read_shadow_ram {
 	union ixgbe_hic_hdr2 hdr;
@@ -3907,7 +3918,8 @@ struct ixgbe_mac_operations {
 	void (*fc_autoneg)(struct ixgbe_hw *);
 
 	/* Manageability interface */
-	s32 (*set_fw_drv_ver)(struct ixgbe_hw *, u8, u8, u8, u8);
+	s32 (*set_fw_drv_ver)(struct ixgbe_hw *, u8, u8, u8, u8, u16,
+			      const char *);
 	s32 (*get_thermal_sensor_data)(struct ixgbe_hw *);
 	s32 (*init_thermal_sensor_thresh)(struct ixgbe_hw *hw);
 	void (*get_rtrup2tc)(struct ixgbe_hw *hw, u8 *map);
drivers/net/ixgbe/base/ixgbe_x550.c +63 -0

72 lines not on this page · raw message

drivers/net/ixgbe/base/ixgbe_x550.h +2 -0
index cd4db29..2d1876b 100644
@@ -67,6 +67,8 @@ s32 ixgbe_write_iosf_sb_reg_x550(struct ixgbe_hw *hw, u32 reg_addr,
 				 u32 device_type, u32 data);
 s32 ixgbe_read_iosf_sb_reg_x550(struct ixgbe_hw *hw, u32 reg_addr,
 	u32 device_type, u32 *data);
+s32 ixgbe_set_fw_drv_ver_x550(struct ixgbe_hw *hw, u8 maj, u8 min,
+			      u8 build, u8 ver, u16 len, const char *str);
 s32 ixgbe_get_phy_token(struct ixgbe_hw *);
 s32 ixgbe_put_phy_token(struct ixgbe_hw *);
 s32 ixgbe_write_iosf_sb_reg_x550a(struct ixgbe_hw *hw, u32 reg_addr,
Signature · 1 line
2.7.4
author
#6 lore raw

PATCH 7/29 net/ixgbe/base: add support to store LED link active

In reply to Wei Dai

This patch adds support to get the LED link active via the LEDCTL register. If the LEDCTL register does not have LED link active (LED mode field = 0x0100) set then default LED link active returned. LED link active is used for adapter identify/blink support.

---
 drivers/net/ixgbe/base/ixgbe_common.c | 45 +++++++++++++++++++++++++++++++++++
 drivers/net/ixgbe/base/ixgbe_common.h |  1 +
 drivers/net/ixgbe/base/ixgbe_type.h   |  2 ++
 3 files changed, 48 insertions(+)
drivers/net/ixgbe/base/ixgbe_common.c +45 -0
index a6016dc..89b4b5f 100644
@@ -113,6 +113,7 @@ s32 ixgbe_init_ops_generic(struct ixgbe_hw *hw)
 	mac->ops.led_off = ixgbe_led_off_generic;
 	mac->ops.blink_led_start = ixgbe_blink_led_start_generic;
 	mac->ops.blink_led_stop = ixgbe_blink_led_stop_generic;
+	mac->ops.init_led_link_act = ixgbe_init_led_link_act_generic;
 
 	/* RAR, Multicast, VLAN */
 	mac->ops.set_rar = ixgbe_set_rar_generic;
@@ -497,6 +498,9 @@ s32 ixgbe_init_hw_generic(struct ixgbe_hw *hw)
 		status = hw->mac.ops.start_hw(hw);
 	}
 
+	/* Initialize the LED link active for LED blink support */
+	hw->mac.ops.init_led_link_act(hw);
+
 	return status;
 }
 
@@ -1136,6 +1140,47 @@ s32 ixgbe_stop_adapter_generic(struct ixgbe_hw *hw)
 }
 
 /**
+ *  ixgbe_init_led_link_act_generic - Store the LED index link/activity.
+ *  @hw: pointer to hardware structure
+ *
+ *  Store the index for the link active LED. This will be used to support
+ *  blinking the LED.
+ **/
+s32 ixgbe_init_led_link_act_generic(struct ixgbe_hw *hw)
+{
+	struct ixgbe_mac_info *mac = &hw->mac;
+	u32 led_reg, led_mode;
+	u16 i;
+
+	led_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL);
+
+	/* Get LED link active from the LEDCTL register */
+	for (i = 0; i < 4; i++) {
+		led_mode = led_reg >> IXGBE_LED_MODE_SHIFT(i);
+
+		if ((led_mode & IXGBE_LED_MODE_MASK_BASE) ==
+		     IXGBE_LED_LINK_ACTIVE) {
+			mac->led_link_act = i;
+			return IXGBE_SUCCESS;
+		}
+	}
+
+	/*
+	 * If LEDCTL register does not have the LED link active set, then use
+	 * known MAC defaults.
+	 */
+	switch (hw->mac.type) {
+	case ixgbe_mac_X550EM_a:
+	case ixgbe_mac_X550EM_x:
+		mac->led_link_act = 1;
+		break;
+	default:
+		mac->led_link_act = 2;
+	}
+	return IXGBE_SUCCESS;
+}
+
+/**
  *  ixgbe_led_on_generic - Turns on the software controllable LEDs.
  *  @hw: pointer to hardware structure
  *  @index: led number to turn on
drivers/net/ixgbe/base/ixgbe_common.h +1 -0
index ae28206..93e80ea 100644
@@ -72,6 +72,7 @@ s32 ixgbe_stop_adapter_generic(struct ixgbe_hw *hw);
 
 s32 ixgbe_led_on_generic(struct ixgbe_hw *hw, u32 index);
 s32 ixgbe_led_off_generic(struct ixgbe_hw *hw, u32 index);
+s32 ixgbe_init_led_link_act_generic(struct ixgbe_hw *hw);
 
 s32 ixgbe_init_eeprom_params_generic(struct ixgbe_hw *hw);
 s32 ixgbe_write_eeprom_generic(struct ixgbe_hw *hw, u16 offset, u16 data);
drivers/net/ixgbe/base/ixgbe_type.h +2 -0
index 5b2506a..b90ae6d 100644
@@ -3886,6 +3886,7 @@ struct ixgbe_mac_operations {
 	s32 (*led_off)(struct ixgbe_hw *, u32);
 	s32 (*blink_led_start)(struct ixgbe_hw *, u32);
 	s32 (*blink_led_stop)(struct ixgbe_hw *, u32);
+	s32 (*init_led_link_act)(struct ixgbe_hw *);
 
 	/* RAR, Multicast, VLAN */
 	s32 (*set_rar)(struct ixgbe_hw *, u32, u8 *, u32, u32);
@@ -4029,6 +4030,7 @@ struct ixgbe_mac_info {
 	struct ixgbe_dmac_config dmac_config;
 	bool set_lben;
 	u32  max_link_up_time;
+	u8   led_link_act;
 };
 
 struct ixgbe_phy_info {
Signature · 1 line
2.7.4
author
#7 lore raw

PATCH 8/29 net/ixgbe/base: cleanup logic in X540 checksum calculation

In reply to Wei Dai

The variable checksum_last_word is used only for a bounds check. So remove this variable and use IXGBE_EEPROM_CHECKSUM directly. IXGBE_EEPROM_CHECKSUM value is included in the for loop, but then it is checked and excluded. Remove the variable checksum_last_word from the loop so no check is needed.

---
 drivers/net/ixgbe/base/ixgbe_x540.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/net/ixgbe/base/ixgbe_x540.c +5 -5
index 6e778bc..49bf154 100644
@@ -491,7 +491,6 @@ s32 ixgbe_calc_eeprom_checksum_X540(struct ixgbe_hw *hw)
 	u16 length = 0;
 	u16 pointer = 0;
 	u16 word = 0;
-	u16 checksum_last_word = IXGBE_EEPROM_CHECKSUM;
 	u16 ptr_start = IXGBE_PCIE_ANALOG_PTR;
 
 	/* Do not use hw->eeprom.ops.read because we do not want to take
@@ -501,14 +500,15 @@ s32 ixgbe_calc_eeprom_checksum_X540(struct ixgbe_hw *hw)
 
 	DEBUGFUNC("ixgbe_calc_eeprom_checksum_X540");
 
-	/* Include 0x0-0x3F in the checksum */
-	for (i = 0; i <= checksum_last_word; i++) {
+	/* Include 0x0 up to IXGBE_EEPROM_CHECKSUM; do not include the
+	 * checksum itself
+	 */
+	for (i = 0; i < IXGBE_EEPROM_CHECKSUM; i++) {
 		if (ixgbe_read_eerd_generic(hw, i, &word)) {
 			DEBUGOUT("EEPROM read failed\n");
 			return IXGBE_ERR_EEPROM;
 		}
-		if (i != IXGBE_EEPROM_CHECKSUM)
-			checksum += word;
+		checksum += word;
 	}
 
 	/* Include all data from pointers 0x3, 0x6-0xE.  This excludes the
Signature · 1 line
2.7.4
author
#8 lore raw

PATCH 9/29 net/ixgbe/base: enable LASI interrupts only for X552 devices

In reply to Wei Dai

Enable the LASI interrupts on X552 devices to receive notifications of the link configurations of the external PHY and correspondingly support the configuration of the internal iXFI link, since iXFI does not support auto-negotiation. This is not required for X553 devices having KR support, which performs auto-negotiations and which is used as the internal link to the external PHY. Hence adding a check here to avoid enabling LASI interrupts for X553 devices. For X553 devices we get link notifications through LSC interrupts in the MAC. That should suffice to handle link notifications. The default value of "Link connect/disconnect mask" (IXGBE_MDIO_PMA_TX_VEN_LASI_INT_EN) in auto-neg transmit vendor interrupt mask 2 (7.D401) is 0. Hence added a check that disables code in ixgbe_x550.c/ixgbe_enable_lasi_ext_t_x550em() that sets this bit and hence retains the default value for this bit, for X553 devices.

---
 drivers/net/ixgbe/base/ixgbe_x550.c | 31 ++++++++++++++++++++++---------
 1 file changed, 22 insertions(+), 9 deletions(-)
drivers/net/ixgbe/base/ixgbe_x550.c +22 -9
index 28c7ce3..fecc8e6 100644
@@ -2026,19 +2026,32 @@ STATIC s32 ixgbe_enable_lasi_ext_t_x550em(struct ixgbe_hw *hw)
 	status = ixgbe_get_lasi_ext_t_x550em(hw, &lsc);
 
 	/* Enable link status change alarm */
-	status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_PMA_TX_VEN_LASI_INT_MASK,
-				      IXGBE_MDIO_AUTO_NEG_DEV_TYPE, &reg);
 
-	if (status != IXGBE_SUCCESS)
-		return status;
+	/* Enable the LASI interrupts on X552 devices to receive notifications
+	 * of the link configurations of the external PHY and correspondingly
+	 * support the configuration of the internal iXFI link, since iXFI does
+	 * not support auto-negotiation. This is not required for X553 devices
+	 * having KR support, which performs auto-negotiations and which is used
+	 * as the internal link to the external PHY. Hence adding a check here
+	 * to avoid enabling LASI interrupts for X553 devices.
+	 */
+	if (hw->mac.type != ixgbe_mac_X550EM_a) {
+		status = hw->phy.ops.read_reg(hw,
+					IXGBE_MDIO_PMA_TX_VEN_LASI_INT_MASK,
+					IXGBE_MDIO_AUTO_NEG_DEV_TYPE, &reg);
+
+		if (status != IXGBE_SUCCESS)
+			return status;
 
-	reg |= IXGBE_MDIO_PMA_TX_VEN_LASI_INT_EN;
+		reg |= IXGBE_MDIO_PMA_TX_VEN_LASI_INT_EN;
 
-	status = hw->phy.ops.write_reg(hw, IXGBE_MDIO_PMA_TX_VEN_LASI_INT_MASK,
-				       IXGBE_MDIO_AUTO_NEG_DEV_TYPE, reg);
+		status = hw->phy.ops.write_reg(hw,
+					IXGBE_MDIO_PMA_TX_VEN_LASI_INT_MASK,
+					IXGBE_MDIO_AUTO_NEG_DEV_TYPE, reg);
 
-	if (status != IXGBE_SUCCESS)
-		return status;
+		if (status != IXGBE_SUCCESS)
+			return status;
+	}
 
 	/* Enable high temperature failure and global fault alarms */
 	status = hw->phy.ops.read_reg(hw, IXGBE_MDIO_GLOBAL_INT_MASK,
Signature · 1 line
2.7.4
author
#9 lore raw

PATCH 10/29 net/ixgbe/base: add X552 MAC check for iXFI flows

In reply to Wei Dai

The MAC register NW_MNG_IF_SEL fields have been redefined for X553. These changes impact the iXFI driver code flow. Since iXFI is only supported in X552, this patch adds X552 MAC check for iXFI flows.

---
 drivers/net/ixgbe/base/ixgbe_type.h |  4 ++--
 drivers/net/ixgbe/base/ixgbe_x550.c | 13 ++++++++++---
 2 files changed, 12 insertions(+), 5 deletions(-)
drivers/net/ixgbe/base/ixgbe_type.h +2 -2
index b90ae6d..adc5fb3 100644
@@ -4271,8 +4271,8 @@ struct ixgbe_hw {
 #define IXGBE_NW_MNG_IF_SEL_PHY_SPEED_1G	(1u << 19)
 #define IXGBE_NW_MNG_IF_SEL_PHY_SPEED_2_5G	(1u << 20)
 #define IXGBE_NW_MNG_IF_SEL_PHY_SPEED_10G	(1u << 21)
-#define IXGBE_NW_MNG_IF_SEL_ENABLE_10_100M (1 << 23)
-#define IXGBE_NW_MNG_IF_SEL_INT_PHY_MODE (1 << 24)
+#define IXGBE_NW_MNG_IF_SEL_SGMII_ENABLE	(1u << 25)
+#define IXGBE_NW_MNG_IF_SEL_INT_PHY_MODE (1 << 24) /* X552 reg field only */
 #define IXGBE_NW_MNG_IF_SEL_MDIO_PHY_ADD_SHIFT 3
 #define IXGBE_NW_MNG_IF_SEL_MDIO_PHY_ADD	\
 				(0x1F << IXGBE_NW_MNG_IF_SEL_MDIO_PHY_ADD_SHIFT)
drivers/net/ixgbe/base/ixgbe_x550.c +10 -3
index fecc8e6..a338a79 100644
@@ -3053,6 +3053,10 @@ STATIC s32 ixgbe_setup_ixfi_x550em(struct ixgbe_hw *hw, ixgbe_link_speed *speed)
 	s32 status;
 	u32 reg_val;
 
+	/* iXFI is only supported with X552 */
+	if (mac->type != ixgbe_mac_X550EM_x)
+		return IXGBE_ERR_LINK_SETUP;
+
 	/* Disable AN and force speed to 10G Serial. */
 	status = mac->ops.read_iosf_sb_reg(hw,
 					IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
@@ -3149,7 +3153,8 @@ s32 ixgbe_setup_internal_phy_t_x550em(struct ixgbe_hw *hw)
 	if (hw->mac.ops.get_media_type(hw) != ixgbe_media_type_copper)
 		return IXGBE_ERR_CONFIG;
 
-	if (!(hw->phy.nw_mng_if_sel & IXGBE_NW_MNG_IF_SEL_INT_PHY_MODE)) {
+	if (hw->mac.type == ixgbe_mac_X550EM_x &&
+	    !(hw->phy.nw_mng_if_sel & IXGBE_NW_MNG_IF_SEL_INT_PHY_MODE)) {
 		/* If link is down, there is no setup necessary so return  */
 		status = ixgbe_ext_phy_t_x550em_get_link(hw, &link_up);
 		if (status != IXGBE_SUCCESS)
@@ -4651,8 +4656,10 @@ s32 ixgbe_setup_mac_link_t_X550em(struct ixgbe_hw *hw,
 	else
 		force_speed = IXGBE_LINK_SPEED_1GB_FULL;
 
-	/* If internal link mode is XFI, then setup XFI internal link. */
-	if (!(hw->phy.nw_mng_if_sel & IXGBE_NW_MNG_IF_SEL_INT_PHY_MODE)) {
+	/* If X552 and internal link mode is XFI, then setup XFI internal link.
+	 */
+	if (hw->mac.type == ixgbe_mac_X550EM_x &&
+	    !(hw->phy.nw_mng_if_sel & IXGBE_NW_MNG_IF_SEL_INT_PHY_MODE)) {
 		status = ixgbe_setup_ixfi_x550em(hw, &force_speed);
 
 		if (status != IXGBE_SUCCESS)
Signature · 1 line
2.7.4
author
#10 lore raw

PATCH 11/29 net/ixgbe/base: fix getting phy type

In reply to Wei Dai

This patch fixes ixgbe_get_supported_physical_layer_X550em to correctly return physical layer as IXGBE_PHYSICAL_LAYER_1000BASE_T for some devices.

Fixes 76d5b807ff74 ("ixgbe/base: new X557 phy")
Fixes d2e72774e58c ("ixgbe/base: support X550")
---
 drivers/net/ixgbe/base/ixgbe_x550.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ixgbe/base/ixgbe_x550.c +2 -0
index a338a79..d5dffdf 100644
@@ -3797,6 +3797,8 @@ u32 ixgbe_get_supported_physical_layer_X550em(struct ixgbe_hw *hw)
 		if (ext_ability & IXGBE_MDIO_PHY_1000BASET_ABILITY)
 			physical_layer |= IXGBE_PHYSICAL_LAYER_1000BASE_T;
 		break;
+	case ixgbe_phy_m88:
+		physical_layer = IXGBE_PHYSICAL_LAYER_1000BASE_T;
 	default:
 		break;
 	}
Signature · 1 line
2.7.4
author
#11 lore raw

PATCH 12/29 net/ixgbe/base: fix SGMII link setup for M88 PHYs

In reply to Wei Dai

This patch fixes ixgbe_setup_sgmii_m88 to set lane speed to autoneg instead of 1G to prevent problems with link between PHYs

Fixes d4b4c6845487 ("net/ixgbe/base: add X550em_a FW ALEF support")
---
 drivers/net/ixgbe/base/ixgbe_x550.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ixgbe/base/ixgbe_x550.c +1 -1
index d5dffdf..5cf9e40 100644
@@ -1778,7 +1778,7 @@ STATIC s32 ixgbe_setup_sgmii_m88(struct ixgbe_hw *hw, ixgbe_link_speed speed,
 		return rc;
 
 	flx_val &= ~IXGBE_KRM_PMD_FLX_MASK_ST20_SPEED_MASK;
-	flx_val |= IXGBE_KRM_PMD_FLX_MASK_ST20_SPEED_1G;
+	flx_val |= IXGBE_KRM_PMD_FLX_MASK_ST20_SPEED_AN;
 	flx_val &= ~IXGBE_KRM_PMD_FLX_MASK_ST20_AN_EN;
 	flx_val |= IXGBE_KRM_PMD_FLX_MASK_ST20_SGMII_EN;
 	flx_val |= IXGBE_KRM_PMD_FLX_MASK_ST20_AN37_EN;
Signature · 1 line
2.7.4
author
#12 lore raw

PATCH 13/29 net/ixgbe/base: cleanup dead EEE code

In reply to Wei Dai

Remove some specific code for enabling/disabling
EEE. Those were added previously and now are
in "removed" status.

---
 drivers/net/ixgbe/base/ixgbe_x550.c | 61 ++++++-------------------------------
 1 file changed, 10 insertions(+), 51 deletions(-)
drivers/net/ixgbe/base/ixgbe_x550.c +10 -51
index 5cf9e40..97fbf88 100644
@@ -62,7 +62,7 @@ s32 ixgbe_init_ops_X550(struct ixgbe_hw *hw)
 	mac->ops.dmac_config = ixgbe_dmac_config_X550;
 	mac->ops.dmac_config_tcs = ixgbe_dmac_config_tcs_X550;
 	mac->ops.dmac_update_tcs = ixgbe_dmac_update_tcs_X550;
-	mac->ops.setup_eee = ixgbe_setup_eee_X550;
+	mac->ops.setup_eee = NULL;
 	mac->ops.set_source_address_pruning =
 			ixgbe_set_source_address_pruning_X550;
 	mac->ops.set_ethertype_anti_spoofing =
@@ -603,15 +603,6 @@ s32 ixgbe_init_ops_X550EM(struct ixgbe_hw *hw)
 	else
 		mac->ops.setup_fc = ixgbe_setup_fc_X550em;
 
-	switch (hw->device_id) {
-	case IXGBE_DEV_ID_X550EM_X_KR:
-	case IXGBE_DEV_ID_X550EM_A_KR:
-	case IXGBE_DEV_ID_X550EM_A_KR_L:
-		break;
-	default:
-		mac->ops.setup_eee = NULL;
-	}
-
 	/* PHY */
 	phy->ops.init = ixgbe_init_phy_ops_X550em;
 	phy->ops.identify = ixgbe_identify_phy_x550em;
@@ -679,6 +670,15 @@ s32 ixgbe_init_ops_X550EM_a(struct ixgbe_hw *hw)
 		mac->ops.setup_fc = ixgbe_setup_fc_sgmii_x550em_a;
 	}
 
+	switch (hw->device_id) {
+	case IXGBE_DEV_ID_X550EM_A_KR:
+	case IXGBE_DEV_ID_X550EM_A_KR_L:
+		mac->ops.setup_eee = ixgbe_setup_eee_X550;
+		break;
+	default:
+		mac->ops.setup_eee = NULL;
+	}
+
 	return ret_val;
 }
 
@@ -883,28 +883,10 @@ s32 ixgbe_init_eeprom_params_X550(struct ixgbe_hw *hw)
  */
 STATIC s32 ixgbe_enable_eee_x550(struct ixgbe_hw *hw)
 {
-	u16 autoneg_eee_reg;
 	u32 link_reg;
 	s32 status;
 
-	if (hw->mac.type == ixgbe_mac_X550) {
-		/* Advertise EEE capability */
-		hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_EEE_ADVT,
-				     IXGBE_MDIO_AUTO_NEG_DEV_TYPE,
-				     &autoneg_eee_reg);
-
-		autoneg_eee_reg |= (IXGBE_AUTO_NEG_10GBASE_EEE_ADVT |
-				    IXGBE_AUTO_NEG_1000BASE_EEE_ADVT |
-				    IXGBE_AUTO_NEG_100BASE_EEE_ADVT);
-
-		hw->phy.ops.write_reg(hw, IXGBE_MDIO_AUTO_NEG_EEE_ADVT,
-				      IXGBE_MDIO_AUTO_NEG_DEV_TYPE,
-				      autoneg_eee_reg);
-		return IXGBE_SUCCESS;
-	}
-
 	switch (hw->device_id) {
-	case IXGBE_DEV_ID_X550EM_X_KR:
 	case IXGBE_DEV_ID_X550EM_A_KR:
 	case IXGBE_DEV_ID_X550EM_A_KR_L:
 		status = hw->mac.ops.read_iosf_sb_reg(hw,
@@ -938,26 +920,9 @@ STATIC s32 ixgbe_enable_eee_x550(struct ixgbe_hw *hw)
  */
 STATIC s32 ixgbe_disable_eee_x550(struct ixgbe_hw *hw)
 {
-	u16 autoneg_eee_reg;
 	u32 link_reg;
 	s32 status;
 
-	if (hw->mac.type == ixgbe_mac_X550) {
-		/* Disable advertised EEE capability */
-		hw->phy.ops.read_reg(hw, IXGBE_MDIO_AUTO_NEG_EEE_ADVT,
-				     IXGBE_MDIO_AUTO_NEG_DEV_TYPE,
-				     &autoneg_eee_reg);
-
-		autoneg_eee_reg &= ~(IXGBE_AUTO_NEG_10GBASE_EEE_ADVT |
-				     IXGBE_AUTO_NEG_1000BASE_EEE_ADVT |
-				     IXGBE_AUTO_NEG_100BASE_EEE_ADVT);
-
-		hw->phy.ops.write_reg(hw, IXGBE_MDIO_AUTO_NEG_EEE_ADVT,
-				      IXGBE_MDIO_AUTO_NEG_DEV_TYPE,
-				      autoneg_eee_reg);
-		return IXGBE_SUCCESS;
-	}
-
 	switch (hw->device_id) {
 	case IXGBE_DEV_ID_X550EM_X_KR:
 	case IXGBE_DEV_ID_X550EM_A_KR:
@@ -1009,12 +974,6 @@ s32 ixgbe_setup_eee_X550(struct ixgbe_hw *hw, bool enable_eee)
 	if (enable_eee) {
 		eeer |= (IXGBE_EEER_TX_LPI_EN | IXGBE_EEER_RX_LPI_EN);
 
-		/* Not supported on first revision of X550EM_x. */
-		if ((hw->mac.type == ixgbe_mac_X550EM_x) &&
-		    !(IXGBE_FUSES0_REV_MASK &
-		      IXGBE_READ_REG(hw, IXGBE_FUSES0_GROUP(0))))
-			return IXGBE_SUCCESS;
-
 		status = ixgbe_enable_eee_x550(hw);
 		if (status)
 			return status;
Signature · 1 line
2.7.4
author
#13 lore raw

PATCH 14/29 net/ixgbe/base: update setup PHY link to unset all speeds

In reply to Wei Dai

This patch updates ixgbe_setup_phy_link_generic to set/unset auto-negotiation for all speeds. This ensures that unsupported speeds are unset. This is necessary since the PHY NVM may advertise unsupported speeds.

---
 drivers/net/ixgbe/base/ixgbe_phy.c | 130 +++++++++++++++----------------------
 1 file changed, 51 insertions(+), 79 deletions(-)
drivers/net/ixgbe/base/ixgbe_phy.c +51 -79
index 1d9fb3e..54e45b2 100644
@@ -787,91 +787,63 @@ s32 ixgbe_setup_phy_link_generic(struct ixgbe_hw *hw)
 
 	ixgbe_get_copper_link_capabilities_generic(hw, &speed, &autoneg);
 
-	if (speed & IXGBE_LINK_SPEED_10GB_FULL) {
-		/* Set or unset auto-negotiation 10G advertisement */
-		hw->phy.ops.read_reg(hw, IXGBE_MII_10GBASE_T_AUTONEG_CTRL_REG,
-				     IXGBE_MDIO_AUTO_NEG_DEV_TYPE,
-				     &autoneg_reg);
-
-		autoneg_reg &= ~IXGBE_MII_10GBASE_T_ADVERTISE;
-		if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_10GB_FULL)
-			autoneg_reg |= IXGBE_MII_10GBASE_T_ADVERTISE;
-
-		hw->phy.ops.write_reg(hw, IXGBE_MII_10GBASE_T_AUTONEG_CTRL_REG,
-				      IXGBE_MDIO_AUTO_NEG_DEV_TYPE,
-				      autoneg_reg);
-	}
-
-	if (hw->mac.type == ixgbe_mac_X550) {
-		if (speed & IXGBE_LINK_SPEED_5GB_FULL) {
-			/* Set or unset auto-negotiation 5G advertisement */
-			hw->phy.ops.read_reg(hw,
-				IXGBE_MII_AUTONEG_VENDOR_PROVISION_1_REG,
-				IXGBE_MDIO_AUTO_NEG_DEV_TYPE,
-				&autoneg_reg);
-
-			autoneg_reg &= ~IXGBE_MII_5GBASE_T_ADVERTISE;
-			if (hw->phy.autoneg_advertised &
-			     IXGBE_LINK_SPEED_5GB_FULL)
-				autoneg_reg |= IXGBE_MII_5GBASE_T_ADVERTISE;
-
-			hw->phy.ops.write_reg(hw,
-				IXGBE_MII_AUTONEG_VENDOR_PROVISION_1_REG,
-				IXGBE_MDIO_AUTO_NEG_DEV_TYPE,
-				autoneg_reg);
-		}
+	/* Set or unset auto-negotiation 10G advertisement */
+	hw->phy.ops.read_reg(hw, IXGBE_MII_10GBASE_T_AUTONEG_CTRL_REG,
+			     IXGBE_MDIO_AUTO_NEG_DEV_TYPE,
+			     &autoneg_reg);
 
-		if (speed & IXGBE_LINK_SPEED_2_5GB_FULL) {
-			/* Set or unset auto-negotiation 2.5G advertisement */
-			hw->phy.ops.read_reg(hw,
-				IXGBE_MII_AUTONEG_VENDOR_PROVISION_1_REG,
-				IXGBE_MDIO_AUTO_NEG_DEV_TYPE,
-				&autoneg_reg);
-
-			autoneg_reg &= ~IXGBE_MII_2_5GBASE_T_ADVERTISE;
-			if (hw->phy.autoneg_advertised &
-			    IXGBE_LINK_SPEED_2_5GB_FULL)
-				autoneg_reg |= IXGBE_MII_2_5GBASE_T_ADVERTISE;
-
-			hw->phy.ops.write_reg(hw,
-				IXGBE_MII_AUTONEG_VENDOR_PROVISION_1_REG,
-				IXGBE_MDIO_AUTO_NEG_DEV_TYPE,
-				autoneg_reg);
-		}
-	}
+	autoneg_reg &= ~IXGBE_MII_10GBASE_T_ADVERTISE;
+	if ((hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_10GB_FULL) &&
+	    (speed & IXGBE_LINK_SPEED_10GB_FULL))
+		autoneg_reg |= IXGBE_MII_10GBASE_T_ADVERTISE;
 
-	if (speed & IXGBE_LINK_SPEED_1GB_FULL) {
-		/* Set or unset auto-negotiation 1G advertisement */
-		hw->phy.ops.read_reg(hw,
-				     IXGBE_MII_AUTONEG_VENDOR_PROVISION_1_REG,
-				     IXGBE_MDIO_AUTO_NEG_DEV_TYPE,
-				     &autoneg_reg);
+	hw->phy.ops.write_reg(hw, IXGBE_MII_10GBASE_T_AUTONEG_CTRL_REG,
+			      IXGBE_MDIO_AUTO_NEG_DEV_TYPE,
+			      autoneg_reg);
 
-		autoneg_reg &= ~IXGBE_MII_1GBASE_T_ADVERTISE;
-		if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_1GB_FULL)
-			autoneg_reg |= IXGBE_MII_1GBASE_T_ADVERTISE;
+	hw->phy.ops.read_reg(hw, IXGBE_MII_AUTONEG_VENDOR_PROVISION_1_REG,
+			     IXGBE_MDIO_AUTO_NEG_DEV_TYPE,
+			     &autoneg_reg);
 
-		hw->phy.ops.write_reg(hw,
-				      IXGBE_MII_AUTONEG_VENDOR_PROVISION_1_REG,
-				      IXGBE_MDIO_AUTO_NEG_DEV_TYPE,
-				      autoneg_reg);
+	if (hw->mac.type == ixgbe_mac_X550) {
+		/* Set or unset auto-negotiation 5G advertisement */
+		autoneg_reg &= ~IXGBE_MII_5GBASE_T_ADVERTISE;
+		if ((hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_5GB_FULL) &&
+		    (speed & IXGBE_LINK_SPEED_5GB_FULL))
+			autoneg_reg |= IXGBE_MII_5GBASE_T_ADVERTISE;
+
+		/* Set or unset auto-negotiation 2.5G advertisement */
+		autoneg_reg &= ~IXGBE_MII_2_5GBASE_T_ADVERTISE;
+		if ((hw->phy.autoneg_advertised &
+		     IXGBE_LINK_SPEED_2_5GB_FULL) &&
+		    (speed & IXGBE_LINK_SPEED_2_5GB_FULL))
+			autoneg_reg |= IXGBE_MII_2_5GBASE_T_ADVERTISE;
 	}
 
-	if (speed & IXGBE_LINK_SPEED_100_FULL) {
-		/* Set or unset auto-negotiation 100M advertisement */
-		hw->phy.ops.read_reg(hw, IXGBE_MII_AUTONEG_ADVERTISE_REG,
-				     IXGBE_MDIO_AUTO_NEG_DEV_TYPE,
-				     &autoneg_reg);
-
-		autoneg_reg &= ~(IXGBE_MII_100BASE_T_ADVERTISE |
-				 IXGBE_MII_100BASE_T_ADVERTISE_HALF);
-		if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_100_FULL)
-			autoneg_reg |= IXGBE_MII_100BASE_T_ADVERTISE;
-
-		hw->phy.ops.write_reg(hw, IXGBE_MII_AUTONEG_ADVERTISE_REG,
-				      IXGBE_MDIO_AUTO_NEG_DEV_TYPE,
-				      autoneg_reg);
-	}
+	/* Set or unset auto-negotiation 1G advertisement */
+	autoneg_reg &= ~IXGBE_MII_1GBASE_T_ADVERTISE;
+	if ((hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_1GB_FULL) &&
+	    (speed & IXGBE_LINK_SPEED_1GB_FULL))
+		autoneg_reg |= IXGBE_MII_1GBASE_T_ADVERTISE;
+
+	hw->phy.ops.write_reg(hw, IXGBE_MII_AUTONEG_VENDOR_PROVISION_1_REG,
+			      IXGBE_MDIO_AUTO_NEG_DEV_TYPE,
+			      autoneg_reg);
+
+	/* Set or unset auto-negotiation 100M advertisement */
+	hw->phy.ops.read_reg(hw, IXGBE_MII_AUTONEG_ADVERTISE_REG,
+			     IXGBE_MDIO_AUTO_NEG_DEV_TYPE,
+			     &autoneg_reg);
+
+	autoneg_reg &= ~(IXGBE_MII_100BASE_T_ADVERTISE |
+			 IXGBE_MII_100BASE_T_ADVERTISE_HALF);
+	if ((hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_100_FULL) &&
+	    (speed & IXGBE_LINK_SPEED_100_FULL))
+		autoneg_reg |= IXGBE_MII_100BASE_T_ADVERTISE;
+
+	hw->phy.ops.write_reg(hw, IXGBE_MII_AUTONEG_ADVERTISE_REG,
+			      IXGBE_MDIO_AUTO_NEG_DEV_TYPE,
+			      autoneg_reg);
 
 	/* Blocked by MNG FW so don't reset PHY */
 	if (ixgbe_check_reset_blocked(hw))
Signature · 1 line
2.7.4
author
#14 lore raw

PATCH 15/29 net/ixgbe/base: support FW commands to control some PHYs

In reply to Wei Dai

Implement support for new firmware commands to be used to access and control some PHYs.

---
 drivers/net/ixgbe/base/ixgbe_common.h |   4 +-
 drivers/net/ixgbe/base/ixgbe_osdep.h  |   3 +-
 drivers/net/ixgbe/base/ixgbe_type.h   |  70 ++++++++++-
 drivers/net/ixgbe/base/ixgbe_x550.c   | 230 +++++++++++++++++++++++++++++++++-
 4 files changed, 300 insertions(+), 7 deletions(-)
drivers/net/ixgbe/base/ixgbe_common.h +3 -1
index 93e80ea..903f34d 100644
@@ -161,7 +161,9 @@ u8 ixgbe_calculate_checksum(u8 *buffer, u32 length);
 s32 ixgbe_host_interface_command(struct ixgbe_hw *hw, u32 *buffer,
 				 u32 length, u32 timeout, bool return_data);
 s32 ixgbe_hic_unlocked(struct ixgbe_hw *, u32 *buffer, u32 length, u32 timeout);
-
+s32 ixgbe_shutdown_fw_phy(struct ixgbe_hw *);
+s32 ixgbe_fw_phy_activity(struct ixgbe_hw *, u16 activity,
+			  u32 (*data)[FW_PHY_ACT_DATA_COUNT]);
 void ixgbe_clear_tx_pending(struct ixgbe_hw *hw);
 
 extern s32 ixgbe_reset_pipeline_82599(struct ixgbe_hw *hw);
drivers/net/ixgbe/base/ixgbe_osdep.h +2 -1
index 77f0af5..b0977b6 100644
@@ -95,8 +95,9 @@ enum {
 #define STATIC static
 #define IXGBE_NTOHL(_i)	rte_be_to_cpu_32(_i)
 #define IXGBE_NTOHS(_i)	rte_be_to_cpu_16(_i)
+#define IXGBE_CPU_TO_LE16(_i)  rte_cpu_to_le_16(_i)
 #define IXGBE_CPU_TO_LE32(_i)  rte_cpu_to_le_32(_i)
-#define IXGBE_LE32_TO_CPU(_i) rte_le_to_cpu_32(_i)
+#define IXGBE_LE32_TO_CPU(_i)  rte_le_to_cpu_32(_i)
 #define IXGBE_LE32_TO_CPUS(_i) rte_le_to_cpu_32(_i)
 #define IXGBE_CPU_TO_BE16(_i)  rte_cpu_to_be_16(_i)
 #define IXGBE_CPU_TO_BE32(_i)  rte_cpu_to_be_32(_i)
drivers/net/ixgbe/base/ixgbe_type.h +68 -2

88 lines not on this page · raw message

drivers/net/ixgbe/base/ixgbe_x550.c +227 -3

259 lines not on this page · raw message

Signature · 1 line
2.7.4
author
#15 lore raw

PATCH 16/29 net/ixgbe/base: use FW commands to control some PHYs

In reply to Wei Dai

Use the new firmware interface to access and control some PHYs.

---
 drivers/net/ixgbe/base/ixgbe_phy.c  |   4 -
 drivers/net/ixgbe/base/ixgbe_phy.h  |  67 ------
 drivers/net/ixgbe/base/ixgbe_type.h |   2 +-
 drivers/net/ixgbe/base/ixgbe_x550.c | 412 ++++++------------------------------
 4 files changed, 68 insertions(+), 417 deletions(-)
drivers/net/ixgbe/base/ixgbe_phy.c +0 -4
index 54e45b2..8901fc1 100644
@@ -475,10 +475,6 @@ enum ixgbe_phy_type ixgbe_get_phy_type_from_id(u32 phy_id)
 	case X557_PHY_ID2:
 		phy_type = ixgbe_phy_x550em_ext_t;
 		break;
-	case IXGBE_M88E1500_E_PHY_ID:
-	case IXGBE_M88E1543_E_PHY_ID:
-		phy_type = ixgbe_phy_m88;
-		break;
 	default:
 		phy_type = ixgbe_phy_unknown;
 		break;
drivers/net/ixgbe/base/ixgbe_phy.h +0 -67

73 lines not on this page · raw message

drivers/net/ixgbe/base/ixgbe_type.h +1 -1
index c7100b0..6ab466b 100644
@@ -3663,7 +3663,7 @@ enum ixgbe_phy_type {
 	ixgbe_phy_qsfp_unknown,
 	ixgbe_phy_sfp_unsupported, /*Enforce bit set with unsupported module*/
 	ixgbe_phy_sgmii,
-	ixgbe_phy_m88,
+	ixgbe_phy_fw,
 	ixgbe_phy_generic
 };
 
drivers/net/ixgbe/base/ixgbe_x550.c +67 -345

538 lines not on this page · raw message

Signature · 1 line
2.7.4
author
#16 lore raw

PATCH 17/29 net/ixgbe/base: support busy SGMII register reads

In reply to Wei Dai

This patch is needed for base driver support because the NW_MNG_IF_SEL register fields are used to determine SGMII link for busy SGMII register reads.

---
 drivers/net/ixgbe/base/ixgbe_x550.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/net/ixgbe/base/ixgbe_x550.c +5 -1
index c7ccd81..0011f21 100644
@@ -2444,6 +2444,9 @@ s32 ixgbe_init_phy_ops_X550em(struct ixgbe_hw *hw)
 
 	DEBUGFUNC("ixgbe_init_phy_ops_X550em");
 
+	hw->mac.ops.set_lan_id(hw);
+	ixgbe_read_mng_if_sel_x550em(hw);
+
 	if (hw->mac.ops.get_media_type(hw) == ixgbe_media_type_fiber) {
 		phy->phy_semaphore_mask = IXGBE_GSSR_SHARED_I2C_SM;
 		ixgbe_setup_mux_ctl(hw);
@@ -2483,7 +2486,8 @@ s32 ixgbe_init_phy_ops_X550em(struct ixgbe_hw *hw)
 
 	/* Identify the PHY or SFP module */
 	ret_val = phy->ops.identify(hw);
-	if (ret_val == IXGBE_ERR_SFP_NOT_SUPPORTED)
+	if (ret_val == IXGBE_ERR_SFP_NOT_SUPPORTED ||
+	    ret_val == IXGBE_ERR_PHY_ADDR_INVALID)
 		return ret_val;
 
 	/* Setup function pointers based on detected hardware */
Signature · 1 line
2.7.4
author
#17 lore raw

PATCH 18/29 net/ixgbe/base: include new speeds in VFLINK interpretation

In reply to Wei Dai

This patch moves some of the extended speeds that come with X552 (5G, 2.5G, 10M) into the link check functions.
It also now returns speed_unknown for speeds that are not known
how to interpret.

---
 drivers/net/ixgbe/Makefile           |   1 +
 drivers/net/ixgbe/base/ixgbe_hv_vf.c | 240 +++++++++++++++++++++++++++++++++++
 drivers/net/ixgbe/base/ixgbe_hv_vf.h |  41 ++++++
 drivers/net/ixgbe/base/ixgbe_osdep.h |   1 +
 drivers/net/ixgbe/base/ixgbe_vf.c    |  16 +++
 drivers/net/ixgbe/base/ixgbe_vf.h    |   3 +
 6 files changed, 302 insertions(+)
 create mode 100644 drivers/net/ixgbe/base/ixgbe_hv_vf.c
 create mode 100644 drivers/net/ixgbe/base/ixgbe_hv_vf.h
drivers/net/ixgbe/Makefile +1 -0
index 94ddc7b..a3e6a52 100644
@@ -100,6 +100,7 @@ SRCS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += ixgbe_x550.c
 SRCS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += ixgbe_phy.c
 SRCS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += ixgbe_api.c
 SRCS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += ixgbe_vf.c
+SRCS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += ixgbe_hv_vf.c
 SRCS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += ixgbe_dcb.c
 SRCS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += ixgbe_dcb_82599.c
 SRCS-$(CONFIG_RTE_LIBRTE_IXGBE_PMD) += ixgbe_dcb_82598.c
drivers/net/ixgbe/base/ixgbe_hv_vf.c new file +240 -0

240 lines not on this page · raw message

drivers/net/ixgbe/base/ixgbe_hv_vf.h new file +41 -0

41 lines not on this page · raw message

drivers/net/ixgbe/base/ixgbe_osdep.h +1 -0
index b0977b6..fe532aa 100644
@@ -81,6 +81,7 @@
 #define UNREFERENCED_2PARAMETER(_p, _q)
 #define UNREFERENCED_3PARAMETER(_p, _q, _r) 
 #define UNREFERENCED_4PARAMETER(_p, _q, _r, _s) 
+#define UNREFERENCED_5PARAMETER(_p, _q, _r, _s, _t)
 
 /* Shared code error reporting */
 enum {
drivers/net/ixgbe/base/ixgbe_vf.c +16 -0
index e9c13f2..66486ea 100644
@@ -613,13 +613,29 @@ s32 ixgbe_check_mac_link_vf(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
 	switch (links_reg & IXGBE_LINKS_SPEED_82599) {
 	case IXGBE_LINKS_SPEED_10G_82599:
 		*speed = IXGBE_LINK_SPEED_10GB_FULL;
+		if (hw->mac.type >= ixgbe_mac_X550) {
+			if (links_reg & IXGBE_LINKS_SPEED_NON_STD)
+				*speed = IXGBE_LINK_SPEED_2_5GB_FULL;
+		}
 		break;
 	case IXGBE_LINKS_SPEED_1G_82599:
 		*speed = IXGBE_LINK_SPEED_1GB_FULL;
 		break;
 	case IXGBE_LINKS_SPEED_100_82599:
 		*speed = IXGBE_LINK_SPEED_100_FULL;
+		if (hw->mac.type >= ixgbe_mac_X550) {
+			if (links_reg & IXGBE_LINKS_SPEED_NON_STD)
+				*speed = IXGBE_LINK_SPEED_5GB_FULL;
+		}
 		break;
+	case IXGBE_LINKS_SPEED_10_X550EM_A:
+		*speed = IXGBE_LINK_SPEED_UNKNOWN;
+		/* Since Reserved in older MAC's */
+		if (hw->mac.type >= ixgbe_mac_X550)
+			*speed = IXGBE_LINK_SPEED_10_FULL;
+		break;
+	default:
+		*speed = IXGBE_LINK_SPEED_UNKNOWN;
 	}
 
 	/* if the read failed it could just be a mailbox collision, best wait
drivers/net/ixgbe/base/ixgbe_vf.h +3 -0
index d288f31..3efffe8 100644
@@ -34,6 +34,8 @@ POSSIBILITY OF SUCH DAMAGE.
 #ifndef _IXGBE_VF_H_
 #define _IXGBE_VF_H_
 
+#include "ixgbe_type.h"
+
 #define IXGBE_VF_IRQ_CLEAR_MASK	7
 #define IXGBE_VF_MAX_TX_QUEUES	8
 #define IXGBE_VF_MAX_RX_QUEUES	8
@@ -114,6 +116,7 @@ struct ixgbevf_hw_stats {
 	u64 saved_reset_vfmprc;
 };
 
+s32 ixgbe_init_ops_vf(struct ixgbe_hw *hw);
 s32 ixgbe_init_hw_vf(struct ixgbe_hw *hw);
 s32 ixgbe_start_hw_vf(struct ixgbe_hw *hw);
 s32 ixgbe_reset_hw_vf(struct ixgbe_hw *hw);
Signature · 1 line
2.7.4
author
#18 lore raw

PATCH 19/29 net/ixgbe/base: check only X550 devices support 5G

In reply to Wei Dai

Since only X550 devices have support for 5G, so it should be checked for that speed on such devices.

---
 drivers/net/ixgbe/base/ixgbe_common.c | 2 +-
 drivers/net/ixgbe/base/ixgbe_hv_vf.c  | 2 +-
 drivers/net/ixgbe/base/ixgbe_vf.c     | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/ixgbe/base/ixgbe_common.c +1 -1
index 89b4b5f..18bb18c 100644
@@ -4230,7 +4230,7 @@ s32 ixgbe_check_mac_link_generic(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
 		break;
 	case IXGBE_LINKS_SPEED_100_82599:
 		*speed = IXGBE_LINK_SPEED_100_FULL;
-		if (hw->mac.type >= ixgbe_mac_X550) {
+		if (hw->mac.type == ixgbe_mac_X550) {
 			if (links_reg & IXGBE_LINKS_SPEED_NON_STD)
 				*speed = IXGBE_LINK_SPEED_5GB_FULL;
 		}
drivers/net/ixgbe/base/ixgbe_hv_vf.c +1 -1
index 6e3449e..c4e11cc 100644
@@ -147,7 +147,7 @@ static s32 ixgbevf_hv_check_mac_link_vf(struct ixgbe_hw *hw,
 		break;
 	case IXGBE_LINKS_SPEED_100_82599:
 		*speed = IXGBE_LINK_SPEED_100_FULL;
-		if (hw->mac.type >= ixgbe_mac_X550) {
+		if (hw->mac.type == ixgbe_mac_X550) {
 			if (links_reg & IXGBE_LINKS_SPEED_NON_STD)
 				*speed = IXGBE_LINK_SPEED_5GB_FULL;
 		}
drivers/net/ixgbe/base/ixgbe_vf.c +1 -1
index 66486ea..8775ee5 100644
@@ -623,7 +623,7 @@ s32 ixgbe_check_mac_link_vf(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
 		break;
 	case IXGBE_LINKS_SPEED_100_82599:
 		*speed = IXGBE_LINK_SPEED_100_FULL;
-		if (hw->mac.type >= ixgbe_mac_X550) {
+		if (hw->mac.type == ixgbe_mac_X550) {
 			if (links_reg & IXGBE_LINKS_SPEED_NON_STD)
 				*speed = IXGBE_LINK_SPEED_5GB_FULL;
 		}
Signature · 1 line
2.7.4
author
#19 lore raw

PATCH 20/29 net/ixgbe/base: add physical layer options for FW PHY type

In reply to Wei Dai

The "FW" PHY type now supports speeds 10M, 100M, and 1G. Previously, only the 1G speed was reported in the ixgbe_get_supported_physical_layer_X550em() function for this PHY type. This patch is to add the 10M and 100M options.

---
 drivers/net/ixgbe/base/ixgbe_type.h | 1 +
 drivers/net/ixgbe/base/ixgbe_x550.c | 8 +++++++-
 2 files changed, 8 insertions(+), 1 deletion(-)
drivers/net/ixgbe/base/ixgbe_type.h +1 -0
index 6ab466b..9851d84 100644
@@ -3426,6 +3426,7 @@ typedef u32 ixgbe_physical_layer;
 #define IXGBE_PHYSICAL_LAYER_10GBASE_XAUI	0x1000
 #define IXGBE_PHYSICAL_LAYER_SFP_ACTIVE_DA	0x2000
 #define IXGBE_PHYSICAL_LAYER_1000BASE_SX	0x4000
+#define IXGBE_PHYSICAL_LAYER_10BASE_T		0x8000
 
 /* Flow Control Data Sheet defined values
  * Calculation and defines taken from 802.1bb Annex O
drivers/net/ixgbe/base/ixgbe_x550.c +7 -1
index 0011f21..f1f1fbe 100644
@@ -3784,7 +3784,13 @@ u32 ixgbe_get_supported_physical_layer_X550em(struct ixgbe_hw *hw)
 			physical_layer |= IXGBE_PHYSICAL_LAYER_1000BASE_T;
 		break;
 	case ixgbe_phy_fw:
-		physical_layer = IXGBE_PHYSICAL_LAYER_1000BASE_T;
+		if (hw->phy.speeds_supported & IXGBE_LINK_SPEED_1GB_FULL)
+			physical_layer |= IXGBE_PHYSICAL_LAYER_1000BASE_T;
+		if (hw->phy.speeds_supported & IXGBE_LINK_SPEED_100_FULL)
+			physical_layer |= IXGBE_PHYSICAL_LAYER_100BASE_TX;
+		if (hw->phy.speeds_supported & IXGBE_LINK_SPEED_10_FULL)
+			physical_layer |= IXGBE_PHYSICAL_LAYER_10BASE_T;
+		break;
 	default:
 		break;
 	}
Signature · 1 line
2.7.4
author
#20 lore raw

PATCH 21/29 net/ixgbe/base: remove unneeded MAC check

In reply to Wei Dai

ixgbe_read_i2c_combined_generic_int() is only used by devices >= X550. Set the initial value accordingly and remove the MAC check.

---
 drivers/net/ixgbe/base/ixgbe_phy.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/net/ixgbe/base/ixgbe_phy.c +1 -3
index 8901fc1..209e9d0 100644
@@ -113,7 +113,7 @@ s32 ixgbe_read_i2c_combined_generic_int(struct ixgbe_hw *hw, u8 addr, u16 reg,
 					u16 *val, bool lock)
 {
 	u32 swfw_mask = hw->phy.phy_semaphore_mask;
-	int max_retry = 10;
+	int max_retry = 3;
 	int retry = 0;
 	u8 csum_byte;
 	u8 high_bits;
@@ -121,8 +121,6 @@ s32 ixgbe_read_i2c_combined_generic_int(struct ixgbe_hw *hw, u8 addr, u16 reg,
 	u8 reg_high;
 	u8 csum;
 
-	if (hw->mac.type >= ixgbe_mac_X550)
-		max_retry = 3;
 	reg_high = ((reg >> 7) & 0xFE) | 1;	/* Indicate read combined */
 	csum = ixgbe_ones_comp_byte_add(reg_high, reg & 0xFF);
 	csum = ~csum;
Signature · 1 line
2.7.4
author
#21 lore raw

PATCH 22/29 net/ixgbe/base: remove unused PHY ID

In reply to Wei Dai

The first PHY ID for X550 was only used on original HW and never released. So remove these unused PHY ID.

---
 drivers/net/ixgbe/base/ixgbe_phy.c  | 1 -
 drivers/net/ixgbe/base/ixgbe_type.h | 1 -
 2 files changed, 2 deletions(-)
drivers/net/ixgbe/base/ixgbe_phy.c +0 -1
index 209e9d0..5ad4dfe 100644
@@ -457,7 +457,6 @@ enum ixgbe_phy_type ixgbe_get_phy_type_from_id(u32 phy_id)
 	case TN1010_PHY_ID:
 		phy_type = ixgbe_phy_tn;
 		break;
-	case X550_PHY_ID1:
 	case X550_PHY_ID2:
 	case X550_PHY_ID3:
 	case X540_PHY_ID:
drivers/net/ixgbe/base/ixgbe_type.h +0 -1
index 9851d84..9ec17a9 100644
@@ -1647,7 +1647,6 @@ struct ixgbe_dmac_config {
 #define TN1010_PHY_ID	0x00A19410
 #define TNX_FW_REV	0xB
 #define X540_PHY_ID	0x01540200
-#define X550_PHY_ID1	0x01540220
 #define X550_PHY_ID2	0x01540223
 #define X550_PHY_ID3	0x01540221
 #define X557_PHY_ID	0x01540240
Signature · 1 line
2.7.4
author
#22 lore raw

PATCH 23/29 net/ixgbe/base: update FW PHY flow control

In reply to Wei Dai

This patch removes the flow control conversion from rx and tx to pause and asymmetric pause, as that is handled by the call to ixgbe_negotiate_fc. Performing the conversion prior to calling ixgbe_negotiate_fc results in an incorrect fc mode if RX only pause is selected when the link partner is advertising TX.

---
 drivers/net/ixgbe/base/ixgbe_x550.c | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)
drivers/net/ixgbe/base/ixgbe_x550.c +1 -15
index f1f1fbe..49b59e7 100644
@@ -4199,7 +4199,6 @@ void ixgbe_fc_autoneg_sgmii_x550em_a(struct ixgbe_hw *hw)
 	u32 info[FW_PHY_ACT_DATA_COUNT] = { 0 };
 	ixgbe_link_speed speed;
 	bool link_up;
-	u32 fc;
 
 	/* AN should have completed when the cable was plugged in.
 	 * Look for reasons to bail out.  Bail out if:
@@ -4227,21 +4226,8 @@ void ixgbe_fc_autoneg_sgmii_x550em_a(struct ixgbe_hw *hw)
 		goto out;
 	}
 
-	/* Get the advertized flow control and modify it to indicate
-	 * pause and asymmetric pause instead of rx and tx
-	 */
-	fc = info[0];
-	if (fc & FW_PHY_ACT_GET_LINK_INFO_FC_RX)
-		fc ^= FW_PHY_ACT_GET_LINK_INFO_FC_TX;
-
-	/* Modify link partner's flow control to indicate pause and
-	 * asymmetric pause instead of rx and tx
-	 */
-	if (fc & FW_PHY_ACT_GET_LINK_INFO_LP_FC_RX)
-		fc ^= FW_PHY_ACT_GET_LINK_INFO_LP_FC_TX;
-
 	/* Negotiate the flow control */
-	status = ixgbe_negotiate_fc(hw, fc, fc,
+	status = ixgbe_negotiate_fc(hw, info[0], info[0],
 				    FW_PHY_ACT_GET_LINK_INFO_FC_RX,
 				    FW_PHY_ACT_GET_LINK_INFO_FC_TX,
 				    FW_PHY_ACT_GET_LINK_INFO_LP_FC_RX,
Signature · 1 line
2.7.4
author
#23 lore raw

PATCH 24/29 net/ixgbe/base: add EEE support for DNL-controlled PHYs

In reply to Wei Dai

This patch adds EEE support for DNL-controlled PHYs. Because DNL does not indicate EEE capability or status, this patch simply assumes that it is supported. As soon as there is a DNL-supported PHY that does not support EEE, there will be defects in this area because the driver will not report the EEE status correctly. This also deletes some now-unused definitions from an earlier Marvell PHY implementation and combines a device ID check into a switch statement.

---
 drivers/net/ixgbe/base/ixgbe_type.h |  8 --------
 drivers/net/ixgbe/base/ixgbe_x550.c | 15 +++++++--------
 2 files changed, 7 insertions(+), 16 deletions(-)
drivers/net/ixgbe/base/ixgbe_type.h +0 -8
index 9ec17a9..f1761a3 100644
@@ -3720,14 +3720,6 @@ enum ixgbe_fc_mode {
 	ixgbe_fc_default
 };
 
-/* Master/slave control */
-enum ixgbe_ms_type {
-	ixgbe_ms_hw_default = 0,
-	ixgbe_ms_force_master,
-	ixgbe_ms_force_slave,
-	ixgbe_ms_auto
-};
-
 /* Smart Speed Settings */
 #define IXGBE_SMARTSPEED_MAX_RETRIES	3
 enum ixgbe_smart_speed {
drivers/net/ixgbe/base/ixgbe_x550.c +7 -8
index 49b59e7..2aaed6b 100644
@@ -896,19 +896,18 @@ s32 ixgbe_init_ops_X550EM_a(struct ixgbe_hw *hw)
 		break;
 	}
 
-	if ((hw->device_id == IXGBE_DEV_ID_X550EM_A_1G_T) ||
-		(hw->device_id == IXGBE_DEV_ID_X550EM_A_1G_T_L)) {
+	switch (hw->device_id) {
+	case IXGBE_DEV_ID_X550EM_A_1G_T:
+	case IXGBE_DEV_ID_X550EM_A_1G_T_L:
 		mac->ops.fc_autoneg = ixgbe_fc_autoneg_sgmii_x550em_a;
 		mac->ops.setup_fc = ixgbe_fc_autoneg_fw;
-	}
-
-	switch (hw->device_id) {
-	case IXGBE_DEV_ID_X550EM_A_KR:
-	case IXGBE_DEV_ID_X550EM_A_KR_L:
 		mac->ops.setup_eee = ixgbe_setup_eee_fw;
+		hw->phy.eee_speeds_supported = IXGBE_LINK_SPEED_100_FULL |
+					       IXGBE_LINK_SPEED_1GB_FULL;
+		hw->phy.eee_speeds_advertised = hw->phy.eee_speeds_supported;
 		break;
 	default:
-		mac->ops.setup_eee = NULL;
+		break;
 	}
 
 	return ret_val;
Signature · 1 line
2.7.4
author
#26 lore raw

PATCH 25/29 net/ixgbe/base: fix incorrect IXGBE LSWFW register

In reply to Wei Dai

This register was incorrect when compared to the data sheet. Even though the Linux kernel and DPDK polling mode driver doesn't currently use this register, it is better to fix it upstream.

Fixes af75078fece3 ("first public release")
---
 drivers/net/ixgbe/base/ixgbe_type.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ixgbe/base/ixgbe_type.h +2 -2
index f1761a3..49b71c5 100644
@@ -153,7 +153,7 @@ POSSIBILITY OF SUCH DAMAGE.
 #define IXGBE_DEV_ID_X550EM_X_VF		0x15A8
 #define IXGBE_DEV_ID_X550EM_X_VF_HV		0x15A9
 
-#define IXGBE_CAT(r, m) IXGBE_##r##m
+#define IXGBE_CAT(r,m) IXGBE_##r##m
 
 #define IXGBE_BY_MAC(_hw, r) ((_hw)->mvals[IXGBE_CAT(r, _IDX)])
 
@@ -1045,7 +1045,7 @@ struct ixgbe_dmac_config {
 #define IXGBE_FTFT		0x09400 /* 0x9400-0x97FC */
 #define IXGBE_METF(_i)		(0x05190 + ((_i) * 4)) /* 4 of these (0-3) */
 #define IXGBE_MDEF_EXT(_i)	(0x05160 + ((_i) * 4)) /* 8 of these (0-7) */
-#define IXGBE_LSWFW		0x15014
+#define IXGBE_LSWFW		0x15F14
 #define IXGBE_BMCIP(_i)		(0x05050 + ((_i) * 4)) /* 0x5050-0x505C */
 #define IXGBE_BMCIPVAL		0x05060
 #define IXGBE_BMCIP_IPADDR_TYPE	0x00000001
Signature · 1 line
2.7.4
author
#27 lore raw

PATCH 26/29 net/ixgbe/base: remove unused old EEE code

In reply to Wei Dai

remove unused old EEE code.

---
 drivers/net/ixgbe/base/ixgbe_x550.c | 113 +-----------------------------------
 drivers/net/ixgbe/base/ixgbe_x550.h |   2 -
 2 files changed, 1 insertion(+), 114 deletions(-)
drivers/net/ixgbe/base/ixgbe_x550.c +1 -112
index 2aaed6b..4a98530 100644
@@ -942,6 +942,7 @@ s32 ixgbe_init_ops_X550EM_x(struct ixgbe_hw *hw)
 				      ixgbe_write_i2c_combined_generic_unlocked;
 	link->addr = IXGBE_CS4227;
 
+
 	return ret_val;
 }
 
@@ -1109,118 +1110,6 @@ s32 ixgbe_init_eeprom_params_X550(struct ixgbe_hw *hw)
 }
 
 /**
- * ixgbe_enable_eee_x550 - Enable EEE support
- * @hw: pointer to hardware structure
- */
-STATIC s32 ixgbe_enable_eee_x550(struct ixgbe_hw *hw)
-{
-	u32 link_reg;
-	s32 status;
-
-	switch (hw->device_id) {
-	case IXGBE_DEV_ID_X550EM_A_KR:
-	case IXGBE_DEV_ID_X550EM_A_KR_L:
-		status = hw->mac.ops.read_iosf_sb_reg(hw,
-					IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
-					IXGBE_SB_IOSF_TARGET_KR_PHY, &link_reg);
-		if (status != IXGBE_SUCCESS)
-			return status;
-
-		link_reg |= IXGBE_KRM_LINK_CTRL_1_TETH_EEE_CAP_KR |
-			    IXGBE_KRM_LINK_CTRL_1_TETH_EEE_CAP_KX;
-
-		/* Don't advertise FEC capability when EEE enabled. */
-		link_reg &= ~IXGBE_KRM_LINK_CTRL_1_TETH_AN_CAP_FEC;
-
-		status = hw->mac.ops.write_iosf_sb_reg(hw,
-					IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
-					IXGBE_SB_IOSF_TARGET_KR_PHY, link_reg);
-		if (status != IXGBE_SUCCESS)
-			return status;
-		break;
-	default:
-		break;
-	}
-
-	return IXGBE_SUCCESS;
-}
-
-/**
- * ixgbe_disable_eee_x550 - Disable EEE support
- * @hw: pointer to hardware structure
- */
-STATIC s32 ixgbe_disable_eee_x550(struct ixgbe_hw *hw)
-{
-	u32 link_reg;
-	s32 status;
-
-	switch (hw->device_id) {
-	case IXGBE_DEV_ID_X550EM_X_KR:
-	case IXGBE_DEV_ID_X550EM_A_KR:
-	case IXGBE_DEV_ID_X550EM_A_KR_L:
-		status = hw->mac.ops.read_iosf_sb_reg(hw,
-					IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
-					IXGBE_SB_IOSF_TARGET_KR_PHY, &link_reg);
-		if (status != IXGBE_SUCCESS)
-			return status;
-
-		link_reg &= ~(IXGBE_KRM_LINK_CTRL_1_TETH_EEE_CAP_KR |
-			      IXGBE_KRM_LINK_CTRL_1_TETH_EEE_CAP_KX);
-
-		/* Advertise FEC capability when EEE is disabled. */
-		link_reg |= IXGBE_KRM_LINK_CTRL_1_TETH_AN_CAP_FEC;
-
-		status = hw->mac.ops.write_iosf_sb_reg(hw,
-					IXGBE_KRM_LINK_CTRL_1(hw->bus.lan_id),
-					IXGBE_SB_IOSF_TARGET_KR_PHY, link_reg);
-		if (status != IXGBE_SUCCESS)
-			return status;
-		break;
-	default:
-		break;
-	}
-
-	return IXGBE_SUCCESS;
-}
-
-/**
- *  ixgbe_setup_eee_X550 - Enable/disable EEE support
- *  @hw: pointer to the HW structure
- *  @enable_eee: boolean flag to enable EEE
- *
- *  Enable/disable EEE based on enable_eee flag.
- *  Auto-negotiation must be started after BASE-T EEE bits in PHY register 7.3C
- *  are modified.
- *
- **/
-s32 ixgbe_setup_eee_X550(struct ixgbe_hw *hw, bool enable_eee)
-{
-	s32 status;
-	u32 eeer;
-
-	DEBUGFUNC("ixgbe_setup_eee_X550");
-
-	eeer = IXGBE_READ_REG(hw, IXGBE_EEER);
-	/* Enable or disable EEE per flag */
-	if (enable_eee) {
-		eeer |= (IXGBE_EEER_TX_LPI_EN | IXGBE_EEER_RX_LPI_EN);
-
-		status = ixgbe_enable_eee_x550(hw);
-		if (status)
-			return status;
-	} else {
-		eeer &= ~(IXGBE_EEER_TX_LPI_EN | IXGBE_EEER_RX_LPI_EN);
-
-		status = ixgbe_disable_eee_x550(hw);
-		if (status)
-			return status;
-	}
-	IXGBE_WRITE_REG(hw, IXGBE_EEER, eeer);
-
-	return IXGBE_SUCCESS;
-}
-
-/**
  * ixgbe_set_source_address_pruning_X550 - Enable/Disbale source address pruning
  * @hw: pointer to hardware structure
  * @enable: enable or disable source address pruning
drivers/net/ixgbe/base/ixgbe_x550.h +0 -2
index 2d1876b..30ca5df 100644
@@ -57,8 +57,6 @@ s32 ixgbe_read_ee_hostif_X550(struct ixgbe_hw *hw, u16 offset,
 u16				*data);
 s32 ixgbe_write_ee_hostif_data_X550(struct ixgbe_hw *hw, u16 offset,
 				    u16 data);
-s32 ixgbe_set_eee_X550(struct ixgbe_hw *hw, bool enable_eee);
-s32 ixgbe_setup_eee_X550(struct ixgbe_hw *hw, bool enable_eee);
 void ixgbe_set_source_address_pruning_X550(struct ixgbe_hw *hw, bool enable,
 					   unsigned int pool);
 void ixgbe_set_ethertype_anti_spoofing_X550(struct ixgbe_hw *hw,
Signature · 1 line
2.7.4
author
#28 lore raw

PATCH 27/29 net/ixgbe/base: add write flush required by Inphi

In reply to Wei Dai

This patch updates Inphi configuration to flush the register write with a reg read. Inphi is configured in ixgbe_setup_mac_link_sfp_x550a. The Inphy setup flow has been updated to read configuration reg, write only linear/non-linear, and then read (write flush).

---
 drivers/net/ixgbe/base/ixgbe_x550.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
drivers/net/ixgbe/base/ixgbe_x550.c +14 -0
index 4a98530..a57ba74 100644
@@ -2834,12 +2834,26 @@ s32 ixgbe_setup_mac_link_sfp_x550a(struct ixgbe_hw *hw,
 
 		/* Configure CS4227/CS4223 LINE side to proper mode. */
 		reg_slice = IXGBE_CS4227_LINE_SPARE24_LSB + slice_offset;
+
+		ret_val = hw->phy.ops.read_reg(hw, reg_slice,
+					IXGBE_MDIO_ZERO_DEV_TYPE, &reg_phy_ext);
+
+		if (ret_val != IXGBE_SUCCESS)
+			return ret_val;
+
+		reg_phy_ext &= ~((IXGBE_CS4227_EDC_MODE_CX1 << 1) |
+				 (IXGBE_CS4227_EDC_MODE_SR << 1));
+
 		if (setup_linear)
 			reg_phy_ext = (IXGBE_CS4227_EDC_MODE_CX1 << 1) | 0x1;
 		else
 			reg_phy_ext = (IXGBE_CS4227_EDC_MODE_SR << 1) | 0x1;
 		ret_val = hw->phy.ops.write_reg(hw, reg_slice,
 					 IXGBE_MDIO_ZERO_DEV_TYPE, reg_phy_ext);
+
+		/* Flush previous write with a read */
+		ret_val = hw->phy.ops.read_reg(hw, reg_slice,
+					IXGBE_MDIO_ZERO_DEV_TYPE, &reg_phy_ext);
 	}
 	return ret_val;
 }
Signature · 1 line
2.7.4
author
#31 lore raw

PATCH 28/29 net/ixgbe/base: report physical layer for SGMII PHY type

In reply to Wei Dai

For the PHY type SGMII, we need to report the physical layer so the OS can display the correct link connection.

---
 drivers/net/ixgbe/base/ixgbe_x550.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/ixgbe/base/ixgbe_x550.c +3 -0
index a57ba74..782ca91 100644
@@ -3693,6 +3693,9 @@ u32 ixgbe_get_supported_physical_layer_X550em(struct ixgbe_hw *hw)
 		if (hw->phy.speeds_supported & IXGBE_LINK_SPEED_10_FULL)
 			physical_layer |= IXGBE_PHYSICAL_LAYER_10BASE_T;
 		break;
+	case ixgbe_phy_sgmii:
+		physical_layer = IXGBE_PHYSICAL_LAYER_1000BASE_KX;
+		break;
 	default:
 		break;
 	}
Signature · 1 line
2.7.4
author
#32 lore raw

PATCH 29/29 net/ixgbe/base: update version of basical codes in README

In reply to Wei Dai

update the version of shared codes to cid-ixgbe.2016.11.21.tar.gz, all files in net/ixgbe/base are developped by another team and DPDK PMD uses them accordingly.

---
 drivers/net/ixgbe/base/README | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ixgbe/base/README +2 -1
index 6b54c31..84773ff 100644
@@ -34,7 +34,8 @@ Intel® IXGBE driver
 ===================
 
 This directory contains source code of FreeBSD ixgbe driver of version
-cid-10g-shared-code.2016.08.15 released by ND. The sub-directory of base/
+cid-10g-shared-code.2016.08.15 released by the team which develop
+basical drivers for any ixgbe NIC. The sub-directory of base/
 contains the original source package.
 This driver is valid for the product(s) listed below
 
Signature · 1 line
2.7.4
#29 lore raw

Re: [PATCH 27/29] net/ixgbe/base: add write flush required by Inphi

In reply to Wei Dai
Quoted 1 line · Wei Dai

This patch updates Inphi configuration to flush the register write with

Do we really need to mention from Inphi here? If so, can you please explain what it is?

Quoted 3 lines

a reg read. Inphi is configured in ixgbe_setup_mac_link_sfp_x550a. The Inphy setup flow has been updated to read configuration reg, write only linear/non-linear, and then read (write flush).

Also patch does [1] seems not mentioned in the commit log, can you please add information for it?

[1]

Quoted 41 lines
drivers/net/ixgbe/base/ixgbe_x550.c +2 -0
+		reg_phy_ext &= ~((IXGBE_CS4227_EDC_MODE_CX1 << 1) |
+				 (IXGBE_CS4227_EDC_MODE_SR << 1));
---
 drivers/net/ixgbe/base/ixgbe_x550.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
drivers/net/ixgbe/base/ixgbe_x550.c +14 -0
index 4a98530..a57ba74 100644
@@ -2834,12 +2834,26 @@ s32 ixgbe_setup_mac_link_sfp_x550a(struct ixgbe_hw *hw,
 
 		/* Configure CS4227/CS4223 LINE side to proper mode. */
 		reg_slice = IXGBE_CS4227_LINE_SPARE24_LSB + slice_offset;
+
+		ret_val = hw->phy.ops.read_reg(hw, reg_slice,
+					IXGBE_MDIO_ZERO_DEV_TYPE, &reg_phy_ext);
+
+		if (ret_val != IXGBE_SUCCESS)
+			return ret_val;
+
+		reg_phy_ext &= ~((IXGBE_CS4227_EDC_MODE_CX1 << 1) |
+				 (IXGBE_CS4227_EDC_MODE_SR << 1));
+
 		if (setup_linear)
 			reg_phy_ext = (IXGBE_CS4227_EDC_MODE_CX1 << 1) | 0x1;
 		else
 			reg_phy_ext = (IXGBE_CS4227_EDC_MODE_SR << 1) | 0x1;
 		ret_val = hw->phy.ops.write_reg(hw, reg_slice,
 					 IXGBE_MDIO_ZERO_DEV_TYPE, reg_phy_ext);
+
+		/* Flush previous write with a read */
+		ret_val = hw->phy.ops.read_reg(hw, reg_slice,
+					IXGBE_MDIO_ZERO_DEV_TYPE, &reg_phy_ext);
 	}
 	return ret_val;
 }
#24 lore raw

Re: [PATCH 24/29] net/ixgbe/base: add EEE support for DNL-controlled PHYs

In reply to Wei Dai
Quoted 1 line · Wei Dai

This patch adds EEE support for DNL-controlled PHYs. Because DNL

What is DNL?

Quoted 20 lines

does not indicate EEE capability or status, this patch simply assumes that it is supported. As soon as there is a DNL-supported PHY that does not support EEE, there will be defects in this area because the driver will not report the EEE status correctly. This also deletes some now-unused definitions from an earlier Marvell PHY implementation and combines a device ID check into a switch statement.

---
 drivers/net/ixgbe/base/ixgbe_type.h |  8 --------
 drivers/net/ixgbe/base/ixgbe_x550.c | 15 +++++++--------
 2 files changed, 7 insertions(+), 16 deletions(-)
drivers/net/ixgbe/base/ixgbe_type.h +0 -0
index 9ec17a9..f1761a3 100644
@@ -3720,14 +3720,6 @@ enum ixgbe_fc_mode {
 	ixgbe_fc_default

drivers/net/ixgbe/base/ixgbe_type.h enum ixgbe_fc_mode { · line 3730

Quoted 10 lines
drivers/net/ixgbe/base/ixgbe_type.h +0 -8
 };
 
-/* Master/slave control */
-enum ixgbe_ms_type {
-	ixgbe_ms_hw_default = 0,
-	ixgbe_ms_force_master,
-	ixgbe_ms_force_slave,
-	ixgbe_ms_auto
-};
-

This seems not related to this patchset, also patch 15/29 has [1] again seems unrelated to that patch, does it make sense to make these a separate patch?

[1]
"
@@ -4046,8 +4112,8 @@ struct ixgbe_phy_info {
bool reset_disable; ixgbe_autoneg_advertised autoneg_advertised; ixgbe_link_speed speeds_supported;
- enum ixgbe_ms_type ms_type;
- enum ixgbe_ms_type original_ms_type;

#33 lore raw

Re: [PATCH 29/29] net/ixgbe/base: update version of basical codes in README

In reply to Wei Dai
Quoted 14 lines · Wei Dai

update the version of shared codes to cid-ixgbe.2016.11.21.tar.gz, all files in net/ixgbe/base are developped by another team and DPDK PMD uses them accordingly.

---
 drivers/net/ixgbe/base/README | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ixgbe/base/README +0 -0
index 6b54c31..84773ff 100644

drivers/net/ixgbe/base/README Intel® IXGBE driver · line 37

Quoted 5 lines
drivers/net/ixgbe/base/README +1 -1
@@ -34,7 +34,8 @@ Intel® IXGBE driver
 ===================
 
 This directory contains source code of FreeBSD ixgbe driver of version
-cid-10g-shared-code.2016.08.15 released by ND. The sub-directory of base/
+cid-10g-shared-code.2016.08.15 released by the team which develop

I guess version needs to be updated to 2016.11.21 ?

Quoted 5 lines
drivers/net/ixgbe/base/README +1 -0
+basical drivers for any ixgbe NIC. The sub-directory of base/
 contains the original source package.
 This driver is valid for the product(s) listed below
 
author
#34 lore raw

Re: [PATCH 29/29] net/ixgbe/base: update version of basical codes in README

Thanks to Yigit Ferruh.

Quoted 26 lines

-----Original Message-----
From: Yigit, Ferruh
Sent: Tuesday, December 6, 2016 3:41 AM
To: Dai, Wei <[email protected]>; Zhang, Helin <[email protected]>; Ananyev, Konstantin <[email protected]>
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH 29/29] net/ixgbe/base: update version of basical codes in README

Quoted 16 lines · Wei Dai

update the version of shared codes to cid-ixgbe.2016.11.21.tar.gz, all files in net/ixgbe/base are developped by another team and DPDK PMD uses them accordingly.

---
 drivers/net/ixgbe/base/README | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
(quoted diff) +0 -0

b/drivers/net/ixgbe/base/README index 6b54c31..84773ff 100644

drivers/net/ixgbe/base/README +0 -0
@@ -34,7 +34,8 @@ Intel® IXGBE driver
 ===================
 
Quoted 7 lines
Quoted 5 lines
drivers/net/ixgbe/base/README +0 -0
 This directory contains source code of FreeBSD ixgbe driver of

version
-cid-10g-shared-code.2016.08.15 released by ND. The sub-directory of base/
+cid-10g-shared-code.2016.08.15 released by the team which develop

I guess version needs to be updated to 2016.11.21 ?

Yes, it should be updated to 2016.11.21 .

Quoted 6 lines
Quoted 6 lines

+basical drivers for any ixgbe NIC. The sub-directory of base/
contains the original source package.
This driver is valid for the product(s) listed below

author
#25 lore raw

Re: [PATCH 24/29] net/ixgbe/base: add EEE support for DNL-controlled PHYs

In reply to Ferruh Yigit
Quoted 9 lines

-----Original Message-----
From: Yigit, Ferruh
Sent: Tuesday, December 6, 2016 3:41 AM
To: Dai, Wei <[email protected]>; Zhang, Helin <[email protected]>; Ananyev, Konstantin <[email protected]>
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH 24/29] net/ixgbe/base: add EEE support for DNL-controlled PHYs

Quoted 4 lines
Quoted 1 line · Wei Dai

This patch adds EEE support for DNL-controlled PHYs. Because DNL

What is DNL?

DNL is short for name of some method to control Marvel PHY. This git log message will be revised in v2 patch set.

Quoted 24 lines
Quoted 24 lines

does not indicate EEE capability or status, this patch simply assumes that it is supported. As soon as there is a DNL-supported PHY that does not support EEE, there will be defects in this area because the driver will not report the EEE status correctly.
This also deletes some now-unused definitions from an earlier Marvell PHY implementation and combines a device ID check into a switch statement.

---
 drivers/net/ixgbe/base/ixgbe_type.h |  8 --------
drivers/net/ixgbe/base/ixgbe_x550.c | 15 +++++++--------
 2 files changed, 7 insertions(+), 16 deletions(-)
drivers/net/ixgbe/base/ixgbe_type.h +0 -0
index 9ec17a9..f1761a3 100644
@@ -3720,14 +3720,6 @@ enum ixgbe_fc_mode {
 	ixgbe_fc_default
 };
 
Quoted 11 lines

drivers/net/ixgbe/base/ixgbe_type.h enum ixgbe_fc_mode { · line 3730

Quoted 8 lines
drivers/net/ixgbe/base/ixgbe_type.h +0 -8
-/* Master/slave control */
-enum ixgbe_ms_type {
-	ixgbe_ms_hw_default = 0,
-	ixgbe_ms_force_master,
-	ixgbe_ms_force_slave,
-	ixgbe_ms_auto
-};
-

This seems not related to this patchset, also patch 15/29 has [1] again seems unrelated to that patch, does it make sense to make these a separate patch?

Yes, in v2 patch set, removing of above enum type will be in a separate one.

Quoted 11 lines

[1]
"

(quoted diff) +0 -2
@@ -4046,8 +4112,8 @@ struct ixgbe_phy_info {
 	bool reset_disable;
 	ixgbe_autoneg_advertised autoneg_advertised;
 	ixgbe_link_speed speeds_supported;
-	enum ixgbe_ms_type ms_type;
-	enum ixgbe_ms_type original_ms_type;
 
 
author
#30 lore raw

Re: [PATCH 27/29] net/ixgbe/base: add write flush required by Inphi

In reply to Ferruh Yigit
Quoted 9 lines

-----Original Message-----
From: Yigit, Ferruh
Sent: Tuesday, December 6, 2016 3:41 AM
To: Dai, Wei <[email protected]>; Zhang, Helin <[email protected]>; Ananyev, Konstantin <[email protected]>
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH 27/29] net/ixgbe/base: add write flush required by Inphi

Quoted 6 lines
Quoted 2 lines · Wei Dai

This patch updates Inphi configuration to flush the register write with

Do we really need to mention from Inphi here? If so, can you please explain what it is?

Inphi (www.inphi.com) is a company which provides PHYs. So I will use "Inphi PHY" instead of "Inphi" in v2 patch set.

Quoted 7 lines
Quoted 4 lines

a reg read. Inphi is configured in ixgbe_setup_mac_link_sfp_x550a. The Inphy setup flow has been updated to read configuration reg, write only linear/non-linear, and then read (write flush).

Also patch does [1] seems not mentioned in the commit log, can you please add information for it?

Yes, following statement is redundant, but in order to simplify the process to keep up with the shared code provided by another team (Intel Network Division), I'd like to keep it here. Anyway it is harmless.

Quoted 45 lines

[1]

Quoted 43 lines
drivers/net/ixgbe/base/ixgbe_x550.c +2 -0
+		reg_phy_ext &= ~((IXGBE_CS4227_EDC_MODE_CX1 << 1) |
+				 (IXGBE_CS4227_EDC_MODE_SR << 1));
---
 drivers/net/ixgbe/base/ixgbe_x550.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
drivers/net/ixgbe/base/ixgbe_x550.c +14 -0
index 4a98530..a57ba74 100644
@@ -2834,12 +2834,26 @@ s32 ixgbe_setup_mac_link_sfp_x550a(struct
 ixgbe_hw *hw,
 
 		/* Configure CS4227/CS4223 LINE side to proper mode. */
 		reg_slice = IXGBE_CS4227_LINE_SPARE24_LSB + slice_offset;
+
+		ret_val = hw->phy.ops.read_reg(hw, reg_slice,
+					IXGBE_MDIO_ZERO_DEV_TYPE, &reg_phy_ext);
+
+		if (ret_val != IXGBE_SUCCESS)
+			return ret_val;
+
+		reg_phy_ext &= ~((IXGBE_CS4227_EDC_MODE_CX1 << 1) |
+				 (IXGBE_CS4227_EDC_MODE_SR << 1));
+
 		if (setup_linear)
 			reg_phy_ext = (IXGBE_CS4227_EDC_MODE_CX1 << 1) | 0x1;
 		else
 			reg_phy_ext = (IXGBE_CS4227_EDC_MODE_SR << 1) | 0x1;
 		ret_val = hw->phy.ops.write_reg(hw, reg_slice,
 					 IXGBE_MDIO_ZERO_DEV_TYPE, reg_phy_ext);
+
+		/* Flush previous write with a read */
+		ret_val = hw->phy.ops.read_reg(hw, reg_slice,
+					IXGBE_MDIO_ZERO_DEV_TYPE, &reg_phy_ext);
 	}
 	return ret_val;

}

author
#35 lore raw

Re: [PATCH 29/29] net/ixgbe/base: update version of basical codes in README

In reply to Ferruh Yigit

Thanks for your correcting.

Quoted 26 lines

-----Original Message-----
From: Yigit, Ferruh
Sent: Tuesday, December 6, 2016 3:41 AM
To: Dai, Wei <[email protected]>; Zhang, Helin <[email protected]>; Ananyev, Konstantin <[email protected]>
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH 29/29] net/ixgbe/base: update version of basical codes in README

Quoted 16 lines · Wei Dai

update the version of shared codes to cid-ixgbe.2016.11.21.tar.gz, all files in net/ixgbe/base are developped by another team and DPDK PMD uses them accordingly.

---
 drivers/net/ixgbe/base/README | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
(quoted diff) +0 -0

b/drivers/net/ixgbe/base/README index 6b54c31..84773ff 100644

drivers/net/ixgbe/base/README +0 -0
@@ -34,7 +34,8 @@ Intel® IXGBE driver
 ===================
 
Quoted 7 lines
Quoted 5 lines
drivers/net/ixgbe/base/README +0 -0
 This directory contains source code of FreeBSD ixgbe driver of

version
-cid-10g-shared-code.2016.08.15 released by ND. The sub-directory of base/
+cid-10g-shared-code.2016.08.15 released by the team which develop

I guess version needs to be updated to 2016.11.21 ?

Yes, it should be 2016.11.21.
It will be corrected in v2 patch.

Quoted 6 lines
Quoted 6 lines

+basical drivers for any ixgbe NIC. The sub-directory of base/
contains the original source package.
This driver is valid for the product(s) listed below