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

Commit 9243b25b authored by David S. Miller's avatar David S. Miller
Browse files


Jeff Kirsher says:

====================
Intel Wired LAN Driver Updates 2015-07-14

This series contains updates to i40e and i40evf only.

Joe Stringer and Jesse Gross add a ndo_features_check function to ensure
that the i40e driver does not try to offload packets that exceed 80 bytes
in length.

Anjali adds additional stats to track flow director ATR and SB current
state and flow director flush count which will help the need for verbose
debug logs with respect to flow director.  Also refines an error message
to avoid confusion, so that it indicates what may have really happened
when the init_shared_code() call possibly fails.

Pawel adds new fields to the capabilities structures to handle Flex-10
device/function capabilities which is needed to support Flex-10 configs.

Jesse improves the transmit performance by added a prefetch for the
next transmit descriptor to be used when we know there are more coming.

Mitch modifies i40evf driver to handle/allow an abundance of vectors.
Currently the driver only maps transmit and receive queues to a single
MSI-X vector per queue if there are exactly enough vectors for this, but
if we have too many vectors, it will fail and allocate queues to vectors
in a suboptimal manner.  So change the condition check to allow for an
excess number of vectors and won't use the extras.  Also update the
driver to just return success if the user attempts to set a port VLAN on
a VF that already has the same port VLAN configured, instead of going
through unnecessary filter removals & adds.  Fix the MAC filters for VFs,
which were being programmed with 0 for the VLAN value when there was no
VLAN assigned.  Instead, we must use -1 to indicate that no VLAN is in
use.  Fix the VF disable code, which was not properly cleaning up the VF
and would leave the VF in an indeterminate state, so fix this by
notifying the VF and then call the normal VF reset routine.  Fix the
logic in the driver so that MAC filters are added and removed correctly
and added a check for the driver's hardware MAC address so that this
filter does not get removed incorrectly.

Carolyn removes incorrect #ifdef's which should not have been added in
the first place and with the #ifdef's removed, make the necessary
changes in the driver to resolve compile errors.

Greg updates the admin queue command header defines.

v2: fix indentation in patch 12 based on feedback from Sergei Shtylyov
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 40bdc536 76945bf9
Loading
Loading
Loading
Loading
+13 −11
Original line number Original line Diff line number Diff line
@@ -34,7 +34,7 @@
 */
 */


#define I40E_FW_API_VERSION_MAJOR	0x0001
#define I40E_FW_API_VERSION_MAJOR	0x0001
#define I40E_FW_API_VERSION_MINOR	0x0002
#define I40E_FW_API_VERSION_MINOR	0x0004


struct i40e_aq_desc {
struct i40e_aq_desc {
	__le16 flags;
	__le16 flags;
@@ -132,12 +132,7 @@ enum i40e_admin_queue_opc {
	i40e_aqc_opc_list_func_capabilities	= 0x000A,
	i40e_aqc_opc_list_func_capabilities	= 0x000A,
	i40e_aqc_opc_list_dev_capabilities	= 0x000B,
	i40e_aqc_opc_list_dev_capabilities	= 0x000B,


	i40e_aqc_opc_set_cppm_configuration	= 0x0103,
	i40e_aqc_opc_set_arp_proxy_entry	= 0x0104,
	i40e_aqc_opc_set_ns_proxy_entry		= 0x0105,

	/* LAA */
	/* LAA */
	i40e_aqc_opc_mng_laa		= 0x0106,   /* AQ obsolete */
	i40e_aqc_opc_mac_address_read	= 0x0107,
	i40e_aqc_opc_mac_address_read	= 0x0107,
	i40e_aqc_opc_mac_address_write	= 0x0108,
	i40e_aqc_opc_mac_address_write	= 0x0108,


@@ -262,7 +257,6 @@ enum i40e_admin_queue_opc {
	/* Tunnel commands */
	/* Tunnel commands */
	i40e_aqc_opc_add_udp_tunnel	= 0x0B00,
	i40e_aqc_opc_add_udp_tunnel	= 0x0B00,
	i40e_aqc_opc_del_udp_tunnel	= 0x0B01,
	i40e_aqc_opc_del_udp_tunnel	= 0x0B01,
	i40e_aqc_opc_tunnel_key_structure	= 0x0B10,


	/* Async Events */
	/* Async Events */
	i40e_aqc_opc_event_lan_overflow		= 0x1001,
	i40e_aqc_opc_event_lan_overflow		= 0x1001,
@@ -274,8 +268,6 @@ enum i40e_admin_queue_opc {
	i40e_aqc_opc_oem_ocbb_initialize	= 0xFE03,
	i40e_aqc_opc_oem_ocbb_initialize	= 0xFE03,


	/* debug commands */
	/* debug commands */
	i40e_aqc_opc_debug_get_deviceid		= 0xFF00,
	i40e_aqc_opc_debug_set_mode		= 0xFF01,
	i40e_aqc_opc_debug_read_reg		= 0xFF03,
	i40e_aqc_opc_debug_read_reg		= 0xFF03,
	i40e_aqc_opc_debug_write_reg		= 0xFF04,
	i40e_aqc_opc_debug_write_reg		= 0xFF04,
	i40e_aqc_opc_debug_modify_reg		= 0xFF07,
	i40e_aqc_opc_debug_modify_reg		= 0xFF07,
@@ -509,7 +501,8 @@ struct i40e_aqc_mac_address_read {
#define I40E_AQC_SAN_ADDR_VALID		0x20
#define I40E_AQC_SAN_ADDR_VALID		0x20
#define I40E_AQC_PORT_ADDR_VALID	0x40
#define I40E_AQC_PORT_ADDR_VALID	0x40
#define I40E_AQC_WOL_ADDR_VALID		0x80
#define I40E_AQC_WOL_ADDR_VALID		0x80
#define I40E_AQC_ADDR_VALID_MASK	0xf0
#define I40E_AQC_MC_MAG_EN_VALID	0x100
#define I40E_AQC_ADDR_VALID_MASK	0x1F0
	u8	reserved[6];
	u8	reserved[6];
	__le32	addr_high;
	__le32	addr_high;
	__le32	addr_low;
	__le32	addr_low;
@@ -532,7 +525,9 @@ struct i40e_aqc_mac_address_write {
#define I40E_AQC_WRITE_TYPE_LAA_ONLY	0x0000
#define I40E_AQC_WRITE_TYPE_LAA_ONLY	0x0000
#define I40E_AQC_WRITE_TYPE_LAA_WOL	0x4000
#define I40E_AQC_WRITE_TYPE_LAA_WOL	0x4000
#define I40E_AQC_WRITE_TYPE_PORT	0x8000
#define I40E_AQC_WRITE_TYPE_PORT	0x8000
#define I40E_AQC_WRITE_TYPE_MASK	0xc000
#define I40E_AQC_WRITE_TYPE_UPDATE_MC_MAG	0xC000
#define I40E_AQC_WRITE_TYPE_MASK	0xC000

	__le16	mac_sah;
	__le16	mac_sah;
	__le32	mac_sal;
	__le32	mac_sal;
	u8	reserved[8];
	u8	reserved[8];
@@ -1068,6 +1063,7 @@ struct i40e_aqc_set_vsi_promiscuous_modes {
	__le16	seid;
	__le16	seid;
#define I40E_AQC_VSI_PROM_CMD_SEID_MASK		0x3FF
#define I40E_AQC_VSI_PROM_CMD_SEID_MASK		0x3FF
	__le16	vlan_tag;
	__le16	vlan_tag;
#define I40E_AQC_SET_VSI_VLAN_MASK		0x0FFF
#define I40E_AQC_SET_VSI_VLAN_VALID		0x8000
#define I40E_AQC_SET_VSI_VLAN_VALID		0x8000
	u8	reserved[8];
	u8	reserved[8];
};
};
@@ -2064,6 +2060,12 @@ I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_start);
#define I40E_AQC_CEE_PFC_STATUS_MASK	(0x7 << I40E_AQC_CEE_PFC_STATUS_SHIFT)
#define I40E_AQC_CEE_PFC_STATUS_MASK	(0x7 << I40E_AQC_CEE_PFC_STATUS_SHIFT)
#define I40E_AQC_CEE_APP_STATUS_SHIFT	0x8
#define I40E_AQC_CEE_APP_STATUS_SHIFT	0x8
#define I40E_AQC_CEE_APP_STATUS_MASK	(0x7 << I40E_AQC_CEE_APP_STATUS_SHIFT)
#define I40E_AQC_CEE_APP_STATUS_MASK	(0x7 << I40E_AQC_CEE_APP_STATUS_SHIFT)
#define I40E_AQC_CEE_FCOE_STATUS_SHIFT	0x8
#define I40E_AQC_CEE_FCOE_STATUS_MASK	(0x7 << I40E_AQC_CEE_FCOE_STATUS_SHIFT)
#define I40E_AQC_CEE_ISCSI_STATUS_SHIFT	0xA
#define I40E_AQC_CEE_ISCSI_STATUS_MASK	(0x7 << I40E_AQC_CEE_ISCSI_STATUS_SHIFT)
#define I40E_AQC_CEE_FIP_STATUS_SHIFT	0x10
#define I40E_AQC_CEE_FIP_STATUS_MASK	(0x7 << I40E_AQC_CEE_FIP_STATUS_SHIFT)
struct i40e_aqc_get_cee_dcb_cfg_v1_resp {
struct i40e_aqc_get_cee_dcb_cfg_v1_resp {
	u8	reserved1;
	u8	reserved1;
	u8	oper_num_tc;
	u8	oper_num_tc;
+19 −5
Original line number Original line Diff line number Diff line
@@ -2391,7 +2391,7 @@ i40e_status i40e_aq_erase_nvm(struct i40e_hw *hw, u8 module_pointer,
#define I40E_DEV_FUNC_CAP_MSIX_VF	0x44
#define I40E_DEV_FUNC_CAP_MSIX_VF	0x44
#define I40E_DEV_FUNC_CAP_FLOW_DIRECTOR	0x45
#define I40E_DEV_FUNC_CAP_FLOW_DIRECTOR	0x45
#define I40E_DEV_FUNC_CAP_IEEE_1588	0x46
#define I40E_DEV_FUNC_CAP_IEEE_1588	0x46
#define I40E_DEV_FUNC_CAP_MFP_MODE_1	0xF1
#define I40E_DEV_FUNC_CAP_FLEX10	0xF1
#define I40E_DEV_FUNC_CAP_CEM		0xF2
#define I40E_DEV_FUNC_CAP_CEM		0xF2
#define I40E_DEV_FUNC_CAP_IWARP		0x51
#define I40E_DEV_FUNC_CAP_IWARP		0x51
#define I40E_DEV_FUNC_CAP_LED		0x61
#define I40E_DEV_FUNC_CAP_LED		0x61
@@ -2416,6 +2416,7 @@ static void i40e_parse_discover_capabilities(struct i40e_hw *hw, void *buff,
	u32 valid_functions, num_functions;
	u32 valid_functions, num_functions;
	u32 number, logical_id, phys_id;
	u32 number, logical_id, phys_id;
	struct i40e_hw_capabilities *p;
	struct i40e_hw_capabilities *p;
	u8 major_rev;
	u32 i = 0;
	u32 i = 0;
	u16 id;
	u16 id;


@@ -2433,6 +2434,7 @@ static void i40e_parse_discover_capabilities(struct i40e_hw *hw, void *buff,
		number = le32_to_cpu(cap->number);
		number = le32_to_cpu(cap->number);
		logical_id = le32_to_cpu(cap->logical_id);
		logical_id = le32_to_cpu(cap->logical_id);
		phys_id = le32_to_cpu(cap->phys_id);
		phys_id = le32_to_cpu(cap->phys_id);
		major_rev = cap->major_rev;


		switch (id) {
		switch (id) {
		case I40E_DEV_FUNC_CAP_SWITCH_MODE:
		case I40E_DEV_FUNC_CAP_SWITCH_MODE:
@@ -2507,9 +2509,21 @@ static void i40e_parse_discover_capabilities(struct i40e_hw *hw, void *buff,
		case I40E_DEV_FUNC_CAP_MSIX_VF:
		case I40E_DEV_FUNC_CAP_MSIX_VF:
			p->num_msix_vectors_vf = number;
			p->num_msix_vectors_vf = number;
			break;
			break;
		case I40E_DEV_FUNC_CAP_MFP_MODE_1:
		case I40E_DEV_FUNC_CAP_FLEX10:
			if (number == 1)
			if (major_rev == 1) {
				p->mfp_mode_1 = true;
				if (number == 1) {
					p->flex10_enable = true;
					p->flex10_capable = true;
				}
			} else {
				/* Capability revision >= 2 */
				if (number & 1)
					p->flex10_enable = true;
				if (number & 2)
					p->flex10_capable = true;
			}
			p->flex10_mode = logical_id;
			p->flex10_status = phys_id;
			break;
			break;
		case I40E_DEV_FUNC_CAP_CEM:
		case I40E_DEV_FUNC_CAP_CEM:
			if (number == 1)
			if (number == 1)
@@ -2557,7 +2571,7 @@ static void i40e_parse_discover_capabilities(struct i40e_hw *hw, void *buff,
	/* Software override ensuring FCoE is disabled if npar or mfp
	/* Software override ensuring FCoE is disabled if npar or mfp
	 * mode because it is not supported in these modes.
	 * mode because it is not supported in these modes.
	 */
	 */
	if (p->npar_enable || p->mfp_mode_1)
	if (p->npar_enable || p->flex10_enable)
		p->fcoe = false;
		p->fcoe = false;


	/* count the enabled ports (aka the "not disabled" ports) */
	/* count the enabled ports (aka the "not disabled" ports) */
+2 −0
Original line number Original line Diff line number Diff line
@@ -148,7 +148,9 @@ static struct i40e_stats i40e_gstrings_stats[] = {
	I40E_PF_STAT("fdir_flush_cnt", fd_flush_cnt),
	I40E_PF_STAT("fdir_flush_cnt", fd_flush_cnt),
	I40E_PF_STAT("fdir_atr_match", stats.fd_atr_match),
	I40E_PF_STAT("fdir_atr_match", stats.fd_atr_match),
	I40E_PF_STAT("fdir_atr_tunnel_match", stats.fd_atr_tunnel_match),
	I40E_PF_STAT("fdir_atr_tunnel_match", stats.fd_atr_tunnel_match),
	I40E_PF_STAT("fdir_atr_status", stats.fd_atr_status),
	I40E_PF_STAT("fdir_sb_match", stats.fd_sb_match),
	I40E_PF_STAT("fdir_sb_match", stats.fd_sb_match),
	I40E_PF_STAT("fdir_sb_status", stats.fd_sb_status),


	/* LPI stats */
	/* LPI stats */
	I40E_PF_STAT("tx_lpi_status", stats.tx_lpi_status),
	I40E_PF_STAT("tx_lpi_status", stats.tx_lpi_status),
+20 −10
Original line number Original line Diff line number Diff line
@@ -116,6 +116,7 @@ i40e_status i40e_add_sd_table_entry(struct i40e_hw *hw,
 * @hw: pointer to our HW structure
 * @hw: pointer to our HW structure
 * @hmc_info: pointer to the HMC configuration information structure
 * @hmc_info: pointer to the HMC configuration information structure
 * @pd_index: which page descriptor index to manipulate
 * @pd_index: which page descriptor index to manipulate
 * @rsrc_pg: if not NULL, use preallocated page instead of allocating new one.
 *
 *
 * This function:
 * This function:
 *	1. Initializes the pd entry
 *	1. Initializes the pd entry
@@ -129,12 +130,14 @@ i40e_status i40e_add_sd_table_entry(struct i40e_hw *hw,
 **/
 **/
i40e_status i40e_add_pd_table_entry(struct i40e_hw *hw,
i40e_status i40e_add_pd_table_entry(struct i40e_hw *hw,
					      struct i40e_hmc_info *hmc_info,
					      struct i40e_hmc_info *hmc_info,
					      u32 pd_index)
					      u32 pd_index,
					      struct i40e_dma_mem *rsrc_pg)
{
{
	i40e_status ret_code = 0;
	i40e_status ret_code = 0;
	struct i40e_hmc_pd_table *pd_table;
	struct i40e_hmc_pd_table *pd_table;
	struct i40e_hmc_pd_entry *pd_entry;
	struct i40e_hmc_pd_entry *pd_entry;
	struct i40e_dma_mem mem;
	struct i40e_dma_mem mem;
	struct i40e_dma_mem *page = &mem;
	u32 sd_idx, rel_pd_idx;
	u32 sd_idx, rel_pd_idx;
	u64 *pd_addr;
	u64 *pd_addr;
	u64 page_desc;
	u64 page_desc;
@@ -155,18 +158,24 @@ i40e_status i40e_add_pd_table_entry(struct i40e_hw *hw,
	pd_table = &hmc_info->sd_table.sd_entry[sd_idx].u.pd_table;
	pd_table = &hmc_info->sd_table.sd_entry[sd_idx].u.pd_table;
	pd_entry = &pd_table->pd_entry[rel_pd_idx];
	pd_entry = &pd_table->pd_entry[rel_pd_idx];
	if (!pd_entry->valid) {
	if (!pd_entry->valid) {
		if (rsrc_pg) {
			pd_entry->rsrc_pg = true;
			page = rsrc_pg;
		} else {
			/* allocate a 4K backing page */
			/* allocate a 4K backing page */
		ret_code = i40e_allocate_dma_mem(hw, &mem, i40e_mem_bp,
			ret_code = i40e_allocate_dma_mem(hw, page, i40e_mem_bp,
						I40E_HMC_PAGED_BP_SIZE,
						I40E_HMC_PAGED_BP_SIZE,
						I40E_HMC_PD_BP_BUF_ALIGNMENT);
						I40E_HMC_PD_BP_BUF_ALIGNMENT);
			if (ret_code)
			if (ret_code)
				goto exit;
				goto exit;
			pd_entry->rsrc_pg = false;
		}


		pd_entry->bp.addr = mem;
		pd_entry->bp.addr = *page;
		pd_entry->bp.sd_pd_index = pd_index;
		pd_entry->bp.sd_pd_index = pd_index;
		pd_entry->bp.entry_type = I40E_SD_TYPE_PAGED;
		pd_entry->bp.entry_type = I40E_SD_TYPE_PAGED;
		/* Set page address and valid bit */
		/* Set page address and valid bit */
		page_desc = mem.pa | 0x1;
		page_desc = page->pa | 0x1;


		pd_addr = (u64 *)pd_table->pd_page_addr.va;
		pd_addr = (u64 *)pd_table->pd_page_addr.va;
		pd_addr += rel_pd_idx;
		pd_addr += rel_pd_idx;
@@ -240,7 +249,8 @@ i40e_status i40e_remove_pd_bp(struct i40e_hw *hw,
	I40E_INVALIDATE_PF_HMC_PD(hw, sd_idx, idx);
	I40E_INVALIDATE_PF_HMC_PD(hw, sd_idx, idx);


	/* free memory here */
	/* free memory here */
	ret_code = i40e_free_dma_mem(hw, &(pd_entry->bp.addr));
	if (!pd_entry->rsrc_pg)
		ret_code = i40e_free_dma_mem(hw, &pd_entry->bp.addr);
	if (ret_code)
	if (ret_code)
		goto exit;
		goto exit;
	if (!pd_table->ref_cnt)
	if (!pd_table->ref_cnt)
+3 −1
Original line number Original line Diff line number Diff line
@@ -62,6 +62,7 @@ struct i40e_hmc_bp {
struct i40e_hmc_pd_entry {
struct i40e_hmc_pd_entry {
	struct i40e_hmc_bp bp;
	struct i40e_hmc_bp bp;
	u32 sd_index;
	u32 sd_index;
	bool rsrc_pg;
	bool valid;
	bool valid;
};
};


@@ -218,7 +219,8 @@ i40e_status i40e_add_sd_table_entry(struct i40e_hw *hw,


i40e_status i40e_add_pd_table_entry(struct i40e_hw *hw,
i40e_status i40e_add_pd_table_entry(struct i40e_hw *hw,
					      struct i40e_hmc_info *hmc_info,
					      struct i40e_hmc_info *hmc_info,
					      u32 pd_index);
					      u32 pd_index,
					      struct i40e_dma_mem *rsrc_pg);
i40e_status i40e_remove_pd_bp(struct i40e_hw *hw,
i40e_status i40e_remove_pd_bp(struct i40e_hw *hw,
					struct i40e_hmc_info *hmc_info,
					struct i40e_hmc_info *hmc_info,
					u32 idx);
					u32 idx);
Loading