Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 19e1190a authored by David S. Miller's avatar David S. Miller
Browse files


Jeff Kirsher says:

====================
Intel Wired LAN Driver Updates

This series contains updates to i40e only.

Christopher Pau provides a patch to set pf_id based on device and
function numbers since NICs with ARI enabled can have function
numbers larger than 8.

Anjali provides 3 i40e patches to update hardware defines to keep
in sync with hardware updates.

Shannon provides the majority of i40e patches, with 7.  First patch
clears the admin queue head and tail registers during admin queue
shutdown. Then simplifies the admin queue head-tail-len setups to
use more virtual registers.  Provides several patches to cleanup
and fix driver load and reset procedures to make more robust.  Lastly,
provides an ethtool test for interrupts using the software interrupt.

Mitch provides some i40e patches which fixes up VF code in the PF
driver, specifically the number of vectors per VF are reported by the
hardware does not include vector 0, so we need to account for this
when checking.  In addition, cleans up debugging messages.

Kamil provides an i40e patch to fix the diagnostics test by restricting
the diagnostic test length.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents f1abb346 91612c33
Loading
Loading
Loading
Loading
+11 −8
Original line number Diff line number Diff line
@@ -81,11 +81,14 @@
#define I40E_DEFAULT_MSG_ENABLE       4

#define I40E_NVM_VERSION_LO_SHIFT  0
#define I40E_NVM_VERSION_LO_MASK   (0xf << I40E_NVM_VERSION_LO_SHIFT)
#define I40E_NVM_VERSION_MID_SHIFT 4
#define I40E_NVM_VERSION_MID_MASK  (0xff << I40E_NVM_VERSION_MID_SHIFT)
#define I40E_NVM_VERSION_HI_SHIFT  12
#define I40E_NVM_VERSION_HI_MASK   (0xf << I40E_NVM_VERSION_HI_SHIFT)
#define I40E_NVM_VERSION_LO_MASK   (0xff << I40E_NVM_VERSION_LO_SHIFT)
#define I40E_NVM_VERSION_HI_SHIFT  8
#define I40E_NVM_VERSION_HI_MASK   (0xff << I40E_NVM_VERSION_HI_SHIFT)

/* The values in here are decimal coded as hex as is the case in the NVM map*/
#define I40E_CURRENT_NVM_VERSION_HI 0x2
#define I40E_CURRENT_NVM_VERSION_LO 0x1


/* magic for getting defines into strings */
#define STRINGIFY(foo)  #foo
@@ -127,6 +130,7 @@ enum i40e_state_t {
	__I40E_PF_RESET_REQUESTED,
	__I40E_CORE_RESET_REQUESTED,
	__I40E_GLOBAL_RESET_REQUESTED,
	__I40E_EMP_RESET_REQUESTED,
	__I40E_FILTER_OVERFLOW_PROMISC,
};

@@ -247,6 +251,7 @@ struct i40e_pf {
	u16 globr_count; /* Global reset count */
	u16 empr_count; /* EMP reset count */
	u16 pfr_count; /* PF reset count */
	u16 sw_int_count; /* SW interrupt count */

	struct mutex switch_mutex;
	u16 lan_vsi;       /* our default LAN VSI */
@@ -441,13 +446,11 @@ static inline char *i40e_fw_version_str(struct i40e_hw *hw)
	static char buf[32];

	snprintf(buf, sizeof(buf),
		 "f%d.%d a%d.%d n%02d.%02d.%02d e%08x",
		 "f%d.%d a%d.%d n%02x.%02x e%08x",
		 hw->aq.fw_maj_ver, hw->aq.fw_min_ver,
		 hw->aq.api_maj_ver, hw->aq.api_min_ver,
		 (hw->nvm.version & I40E_NVM_VERSION_HI_MASK)
						>> I40E_NVM_VERSION_HI_SHIFT,
		 (hw->nvm.version & I40E_NVM_VERSION_MID_MASK)
						>> I40E_NVM_VERSION_MID_SHIFT,
		 (hw->nvm.version & I40E_NVM_VERSION_LO_MASK)
						>> I40E_NVM_VERSION_LO_SHIFT,
		 hw->nvm.eetrack);
+34 −32
Original line number Diff line number Diff line
@@ -43,13 +43,17 @@ static void i40e_adminq_init_regs(struct i40e_hw *hw)
	if (hw->mac.type == I40E_MAC_VF) {
		hw->aq.asq.tail = I40E_VF_ATQT1;
		hw->aq.asq.head = I40E_VF_ATQH1;
		hw->aq.asq.len  = I40E_VF_ATQLEN1;
		hw->aq.arq.tail = I40E_VF_ARQT1;
		hw->aq.arq.head = I40E_VF_ARQH1;
		hw->aq.arq.len  = I40E_VF_ARQLEN1;
	} else {
		hw->aq.asq.tail = I40E_PF_ATQT;
		hw->aq.asq.head = I40E_PF_ATQH;
		hw->aq.asq.len  = I40E_PF_ATQLEN;
		hw->aq.arq.tail = I40E_PF_ARQT;
		hw->aq.arq.head = I40E_PF_ARQH;
		hw->aq.arq.len  = I40E_PF_ARQLEN;
	}
}

@@ -466,10 +470,9 @@ static i40e_status i40e_shutdown_asq(struct i40e_hw *hw)
		return I40E_ERR_NOT_READY;

	/* Stop firmware AdminQ processing */
	if (hw->mac.type == I40E_MAC_VF)
		wr32(hw, I40E_VF_ATQLEN1, 0);
	else
		wr32(hw, I40E_PF_ATQLEN, 0);
	wr32(hw, hw->aq.asq.head, 0);
	wr32(hw, hw->aq.asq.tail, 0);
	wr32(hw, hw->aq.asq.len, 0);

	/* make sure lock is available */
	mutex_lock(&hw->aq.asq_mutex);
@@ -500,10 +503,9 @@ static i40e_status i40e_shutdown_arq(struct i40e_hw *hw)
		return I40E_ERR_NOT_READY;

	/* Stop firmware AdminQ processing */
	if (hw->mac.type == I40E_MAC_VF)
		wr32(hw, I40E_VF_ARQLEN1, 0);
	else
		wr32(hw, I40E_PF_ARQLEN, 0);
	wr32(hw, hw->aq.arq.head, 0);
	wr32(hw, hw->aq.arq.tail, 0);
	wr32(hw, hw->aq.arq.len, 0);

	/* make sure lock is available */
	mutex_lock(&hw->aq.arq_mutex);
@@ -533,8 +535,9 @@ static i40e_status i40e_shutdown_arq(struct i40e_hw *hw)
 **/
i40e_status i40e_init_adminq(struct i40e_hw *hw)
{
	u16 eetrack_lo, eetrack_hi;
	i40e_status ret_code;
	u16 eetrack_lo, eetrack_hi;
	int retry = 0;

	/* verify input for valid configuration */
	if ((hw->aq.num_arq_entries == 0) ||
@@ -562,11 +565,24 @@ i40e_status i40e_init_adminq(struct i40e_hw *hw)
	if (ret_code)
		goto init_adminq_free_asq;

	/* There are some cases where the firmware may not be quite ready
	 * for AdminQ operations, so we retry the AdminQ setup a few times
	 * if we see timeouts in this first AQ call.
	 */
	do {
		ret_code = i40e_aq_get_firmware_version(hw,
				     &hw->aq.fw_maj_ver, &hw->aq.fw_min_ver,
				     &hw->aq.api_maj_ver, &hw->aq.api_min_ver,
							&hw->aq.fw_maj_ver,
							&hw->aq.fw_min_ver,
							&hw->aq.api_maj_ver,
							&hw->aq.api_min_ver,
							NULL);
	if (ret_code)
		if (ret_code != I40E_ERR_ADMIN_QUEUE_TIMEOUT)
			break;
		retry++;
		msleep(100);
		i40e_resume_aq(hw);
	} while (retry < 10);
	if (ret_code != I40E_SUCCESS)
		goto init_adminq_free_arq;

	if (hw->aq.api_maj_ver != I40E_FW_API_VERSION_MAJOR ||
@@ -956,27 +972,13 @@ void i40e_resume_aq(struct i40e_hw *hw)
	hw->aq.asq.next_to_clean = 0;

	i40e_config_asq_regs(hw);
	reg = hw->aq.num_asq_entries;

	if (hw->mac.type == I40E_MAC_VF) {
		reg |= I40E_VF_ATQLEN_ATQENABLE_MASK;
		wr32(hw, I40E_VF_ATQLEN1, reg);
	} else {
		reg |= I40E_PF_ATQLEN_ATQENABLE_MASK;
		wr32(hw, I40E_PF_ATQLEN, reg);
	}
	reg = hw->aq.num_asq_entries | I40E_PF_ATQLEN_ATQENABLE_MASK;
	wr32(hw, hw->aq.asq.len, reg);

	hw->aq.arq.next_to_use = 0;
	hw->aq.arq.next_to_clean = 0;

	i40e_config_arq_regs(hw);
	reg = hw->aq.num_arq_entries;

	if (hw->mac.type == I40E_MAC_VF) {
		reg |= I40E_VF_ATQLEN_ATQENABLE_MASK;
		wr32(hw, I40E_VF_ARQLEN1, reg);
	} else {
		reg |= I40E_PF_ATQLEN_ATQENABLE_MASK;
		wr32(hw, I40E_PF_ARQLEN, reg);
	}
	reg = hw->aq.num_arq_entries | I40E_PF_ATQLEN_ATQENABLE_MASK;
	wr32(hw, hw->aq.arq.len, reg);
}
+1 −0
Original line number Diff line number Diff line
@@ -56,6 +56,7 @@ struct i40e_adminq_ring {
	/* used for queue tracking */
	u32 head;
	u32 tail;
	u32 len;
};

/* ASQ transaction details */
+5 −1
Original line number Diff line number Diff line
@@ -297,6 +297,10 @@ i40e_status i40e_pf_reset(struct i40e_hw *hw)
	}

	/* Determine the PF number based on the PCI fn */
	reg = rd32(hw, I40E_GLPCI_CAPSUP);
	if (reg & I40E_GLPCI_CAPSUP_ARI_EN_MASK)
		hw->pf_id = (u8)((hw->bus.device << 3) | hw->bus.func);
	else
		hw->pf_id = (u8)hw->bus.func;

	/* If there was a Global Reset in progress when we got here,
+4 −0
Original line number Diff line number Diff line
@@ -1472,6 +1472,10 @@ static ssize_t i40e_dbg_command_write(struct file *filp,
		dev_info(&pf->pdev->dev, "forcing GlobR\n");
		i40e_do_reset(pf, (1 << __I40E_GLOBAL_RESET_REQUESTED));

	} else if (strncmp(cmd_buf, "empr", 4) == 0) {
		dev_info(&pf->pdev->dev, "forcing EMPR\n");
		i40e_do_reset(pf, (1 << __I40E_EMP_RESET_REQUESTED));

	} else if (strncmp(cmd_buf, "read", 4) == 0) {
		u32 address;
		u32 value;
Loading