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

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


Jeff Kirsher says:

====================
100GbE Intel Wired LAN Driver Updates 2016-07-20

This series contains updates to fm10k only.

Ngai-Mint provides a fix to clear PCIE_GMBX bits to ensure the proper
functioning of the mailbox global interrupt after a data path reset.

Jake provides most of the patches in the series, starting with a early
return from fm10k_down() if we are already down to prevent conflict with
other threads.  Fixed an issue where fm10k_update_stats() could cause
a null pointer dereference, specifically if it is called when we are going
down and the rings have been removed.  Cleans up and fixes the data path
reset flow, Tx hang routine and stop_hw().  Re-worked the fm10k_reinit()
to be more maintainable and fixed several inconsistencies with the work
flow.  Implemented fm10k_prepare_suspend() and fm10k_handle_resume()
which abstract around the now existing fm10k_prepare_for_reset and
fm10k_handle_reset. The new functions also handle stopping the service
task, which is something that the original re-init flow does not need.
Fixed an issue where if an FLR occurs, VF devices will be knocked out of
bus master mode, and the driver will be unable to recover from the reset
properly, so ensure bus master is enabled after every reset.  Fixed an
issue where a reset will occur as if for no reason, regularly every few
minutes until the switch manager software is loaded, which is caused
by continuously requesting the lport map so only do the request after
we have verified the switch mailbox is tx_ready.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 4c37fb15 5264cc63
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -362,6 +362,7 @@ enum fm10k_state_t {
	__FM10K_SERVICE_DISABLE,
	__FM10K_MBX_LOCK,
	__FM10K_LINK_DOWN,
	__FM10K_UPDATING_STATS,
};

static inline void fm10k_mbx_lock(struct fm10k_intfc *interface)
@@ -457,6 +458,7 @@ __be16 fm10k_tx_encap_offload(struct sk_buff *skb);
netdev_tx_t fm10k_xmit_frame_ring(struct sk_buff *skb,
				  struct fm10k_ring *tx_ring);
void fm10k_tx_timeout_reset(struct fm10k_intfc *interface);
u64 fm10k_get_tx_pending(struct fm10k_ring *ring);
bool fm10k_check_tx_hang(struct fm10k_ring *tx_ring);
void fm10k_alloc_rx_buffers(struct fm10k_ring *rx_ring, u16 cleaned_count);

+5 −1
Original line number Diff line number Diff line
@@ -519,8 +519,12 @@ s32 fm10k_get_host_state_generic(struct fm10k_hw *hw, bool *host_ready)
		goto out;

	/* interface cannot receive traffic without logical ports */
	if (mac->dglort_map == FM10K_DGLORTMAP_NONE)
	if (mac->dglort_map == FM10K_DGLORTMAP_NONE) {
		if (hw->mac.ops.request_lport_map)
			ret_val = hw->mac.ops.request_lport_map(hw);

		goto out;
	}

	/* if we passed all the tests above then the switch is ready and we no
	 * longer need to check for link
+2 −0
Original line number Diff line number Diff line
@@ -76,6 +76,8 @@ static const struct fm10k_stats fm10k_gstrings_global_stats[] = {
	FM10K_STAT("mac_rules_used", hw.swapi.mac.used),
	FM10K_STAT("mac_rules_avail", hw.swapi.mac.avail),

	FM10K_STAT("reset_while_pending", hw.mac.reset_while_pending),

	FM10K_STAT("tx_hang_count", tx_timeout_count),
};

+8 −6
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@

#include "fm10k.h"

#define DRV_VERSION	"0.19.3-k"
#define DRV_VERSION	"0.21.2-k"
#define DRV_SUMMARY	"Intel(R) Ethernet Switch Host Interface Driver"
const char fm10k_driver_version[] = DRV_VERSION;
char fm10k_driver_name[] = "fm10k";
@@ -1128,11 +1128,13 @@ static u64 fm10k_get_tx_completed(struct fm10k_ring *ring)
	return ring->stats.packets;
}

static u64 fm10k_get_tx_pending(struct fm10k_ring *ring)
u64 fm10k_get_tx_pending(struct fm10k_ring *ring)
{
	/* use SW head and tail until we have real hardware */
	u32 head = ring->next_to_clean;
	u32 tail = ring->next_to_use;
	struct fm10k_intfc *interface = ring->q_vector->interface;
	struct fm10k_hw *hw = &interface->hw;

	u32 head = fm10k_read_reg(hw, FM10K_TDH(ring->reg_idx));
	u32 tail = fm10k_read_reg(hw, FM10K_TDT(ring->reg_idx));

	return ((head <= tail) ? tail : tail + ring->count) - head;
}
@@ -1856,7 +1858,7 @@ static int fm10k_init_msix_capability(struct fm10k_intfc *interface)
	if (v_budget < 0) {
		kfree(interface->msix_entries);
		interface->msix_entries = NULL;
		return -ENOMEM;
		return v_budget;
	}

	/* record the number of queues available for q_vectors */
+2 −0
Original line number Diff line number Diff line
@@ -41,6 +41,8 @@ struct fm10k_mbx_info;
#define FM10K_MBX_ACK_INTERRUPT			0x00000010
#define FM10K_MBX_INTERRUPT_ENABLE		0x00000020
#define FM10K_MBX_INTERRUPT_DISABLE		0x00000040
#define FM10K_MBX_GLOBAL_REQ_INTERRUPT		0x00000200
#define FM10K_MBX_GLOBAL_ACK_INTERRUPT		0x00000400
#define FM10K_MBICR(_n)		((_n) + 0x18840)
#define FM10K_GMBX		0x18842

Loading