Skip to content

Commit

Permalink
Merge branch '40GbE' of ra.kernel.org:/pub/scm/linux/kernel/git/jkirs…
Browse files Browse the repository at this point in the history
…her/next-queue

Jeff Kirsher says:

====================
40GbE Intel Wired LAN Driver Updates 2017-10-06

This series contains updates to i40e and i40evf only.

Rami fixes a typo in the code comments.

Mitch adds an ethtool private flag to control source pruning to resolve an
issue where our default behavior is to enable source pruning which breaks ARP
monitoring in channel bonding.  Fixes a couple of register definitions, which
were incorrect.

Jake fixes an issue with multiple logical CPUs per core (simultaneous
multithreading - SMT) and how we set an affinity hint based on the v_idx of
that q_vector, which is an incremental value and might lead to multiple
offline CPUs being assigned to a q_vector.  Instead, we should only assign
hints for CPUs which are online, so look to use cpumask_local_spread().
Also fixed a VF VLAN tag stripping issue, where the flag created to change
this feature was seen as unchangeable.  Lastly, organized and re-numbered
the feature flags.

Alan re-enables PTP L4 for XL710 devices with firmware version 6.0 or
greater, now that the previous bug in the older firmware is fixed.
Implements the PCI error handlers for reset_prepare() and reset_done() to
allow us to handle function level resets.

Alice cleans up code that was added to the incorrect function during a
merge.

Filip adds a change to display an error message when a module is inserted
that does not meet the thermal requirements, Talking Heads "Burning Down
the House" comes to mind.  Also fixed a flow director filter issue where
a variable was not being cleared which stores the filter number to be
removed from the list when the firmware refused to add the requested
filter.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Oct 6, 2017
2 parents 4bc4e64 + b74f571 commit f5333f8
Show file tree
Hide file tree
Showing 12 changed files with 203 additions and 138 deletions.
98 changes: 50 additions & 48 deletions drivers/net/ethernet/intel/i40e/i40e.h
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ struct i40e_pf {
u16 num_vmdq_vsis; /* num vmdq vsis this PF has set up */
u16 num_vmdq_qps; /* num queue pairs per vmdq pool */
u16 num_vmdq_msix; /* num queue vectors per vmdq pool */
u16 num_req_vfs; /* num VFs requested for this VF */
u16 num_req_vfs; /* num VFs requested for this PF */
u16 num_vf_qps; /* num queue pairs per VF */
u16 num_lan_qps; /* num lan queues this PF has set up */
u16 num_lan_msix; /* num queue vectors for the base PF vsi */
Expand Down Expand Up @@ -403,55 +403,57 @@ struct i40e_pf {
struct timer_list service_timer;
struct work_struct service_task;

u64 hw_features;
#define I40E_HW_RSS_AQ_CAPABLE BIT_ULL(0)
#define I40E_HW_128_QP_RSS_CAPABLE BIT_ULL(1)
#define I40E_HW_ATR_EVICT_CAPABLE BIT_ULL(2)
#define I40E_HW_WB_ON_ITR_CAPABLE BIT_ULL(3)
#define I40E_HW_MULTIPLE_TCP_UDP_RSS_PCTYPE BIT_ULL(4)
#define I40E_HW_NO_PCI_LINK_CHECK BIT_ULL(5)
#define I40E_HW_100M_SGMII_CAPABLE BIT_ULL(6)
#define I40E_HW_NO_DCB_SUPPORT BIT_ULL(7)
#define I40E_HW_USE_SET_LLDP_MIB BIT_ULL(8)
#define I40E_HW_GENEVE_OFFLOAD_CAPABLE BIT_ULL(9)
#define I40E_HW_PTP_L4_CAPABLE BIT_ULL(10)
#define I40E_HW_WOL_MC_MAGIC_PKT_WAKE BIT_ULL(11)
#define I40E_HW_MPLS_HDR_OFFLOAD_CAPABLE BIT_ULL(12)
#define I40E_HW_HAVE_CRT_RETIMER BIT_ULL(13)
#define I40E_HW_OUTER_UDP_CSUM_CAPABLE BIT_ULL(14)
#define I40E_HW_PHY_CONTROLS_LEDS BIT_ULL(15)
#define I40E_HW_STOP_FW_LLDP BIT_ULL(16)
#define I40E_HW_PORT_ID_VALID BIT_ULL(17)
#define I40E_HW_RESTART_AUTONEG BIT_ULL(18)
u32 hw_features;
#define I40E_HW_RSS_AQ_CAPABLE BIT(0)
#define I40E_HW_128_QP_RSS_CAPABLE BIT(1)
#define I40E_HW_ATR_EVICT_CAPABLE BIT(2)
#define I40E_HW_WB_ON_ITR_CAPABLE BIT(3)
#define I40E_HW_MULTIPLE_TCP_UDP_RSS_PCTYPE BIT(4)
#define I40E_HW_NO_PCI_LINK_CHECK BIT(5)
#define I40E_HW_100M_SGMII_CAPABLE BIT(6)
#define I40E_HW_NO_DCB_SUPPORT BIT(7)
#define I40E_HW_USE_SET_LLDP_MIB BIT(8)
#define I40E_HW_GENEVE_OFFLOAD_CAPABLE BIT(9)
#define I40E_HW_PTP_L4_CAPABLE BIT(10)
#define I40E_HW_WOL_MC_MAGIC_PKT_WAKE BIT(11)
#define I40E_HW_MPLS_HDR_OFFLOAD_CAPABLE BIT(12)
#define I40E_HW_HAVE_CRT_RETIMER BIT(13)
#define I40E_HW_OUTER_UDP_CSUM_CAPABLE BIT(14)
#define I40E_HW_PHY_CONTROLS_LEDS BIT(15)
#define I40E_HW_STOP_FW_LLDP BIT(16)
#define I40E_HW_PORT_ID_VALID BIT(17)
#define I40E_HW_RESTART_AUTONEG BIT(18)

u64 flags;
#define I40E_FLAG_RX_CSUM_ENABLED BIT_ULL(1)
#define I40E_FLAG_MSI_ENABLED BIT_ULL(2)
#define I40E_FLAG_MSIX_ENABLED BIT_ULL(3)
#define I40E_FLAG_HW_ATR_EVICT_ENABLED BIT_ULL(4)
#define I40E_FLAG_RSS_ENABLED BIT_ULL(6)
#define I40E_FLAG_VMDQ_ENABLED BIT_ULL(7)
#define I40E_FLAG_IWARP_ENABLED BIT_ULL(10)
#define I40E_FLAG_FILTER_SYNC BIT_ULL(15)
#define I40E_FLAG_SERVICE_CLIENT_REQUESTED BIT_ULL(16)
#define I40E_FLAG_SRIOV_ENABLED BIT_ULL(19)
#define I40E_FLAG_DCB_ENABLED BIT_ULL(20)
#define I40E_FLAG_FD_SB_ENABLED BIT_ULL(21)
#define I40E_FLAG_FD_ATR_ENABLED BIT_ULL(22)
#define I40E_FLAG_FD_SB_AUTO_DISABLED BIT_ULL(23)
#define I40E_FLAG_FD_ATR_AUTO_DISABLED BIT_ULL(24)
#define I40E_FLAG_PTP BIT_ULL(25)
#define I40E_FLAG_MFP_ENABLED BIT_ULL(26)
#define I40E_FLAG_UDP_FILTER_SYNC BIT_ULL(27)
#define I40E_FLAG_DCB_CAPABLE BIT_ULL(29)
#define I40E_FLAG_VEB_STATS_ENABLED BIT_ULL(37)
#define I40E_FLAG_LINK_POLLING_ENABLED BIT_ULL(39)
#define I40E_FLAG_VEB_MODE_ENABLED BIT_ULL(40)
#define I40E_FLAG_TRUE_PROMISC_SUPPORT BIT_ULL(51)
#define I40E_FLAG_CLIENT_RESET BIT_ULL(54)
#define I40E_FLAG_TEMP_LINK_POLLING BIT_ULL(55)
#define I40E_FLAG_CLIENT_L2_CHANGE BIT_ULL(56)
#define I40E_FLAG_LEGACY_RX BIT_ULL(58)
#define I40E_FLAG_RX_CSUM_ENABLED BIT(0)
#define I40E_FLAG_MSI_ENABLED BIT(1)
#define I40E_FLAG_MSIX_ENABLED BIT(2)
#define I40E_FLAG_RSS_ENABLED BIT(3)
#define I40E_FLAG_VMDQ_ENABLED BIT(4)
#define I40E_FLAG_FILTER_SYNC BIT(5)
#define I40E_FLAG_SRIOV_ENABLED BIT(6)
#define I40E_FLAG_DCB_CAPABLE BIT(7)
#define I40E_FLAG_DCB_ENABLED BIT(8)
#define I40E_FLAG_FD_SB_ENABLED BIT(9)
#define I40E_FLAG_FD_ATR_ENABLED BIT(10)
#define I40E_FLAG_FD_SB_AUTO_DISABLED BIT(11)
#define I40E_FLAG_FD_ATR_AUTO_DISABLED BIT(12)
#define I40E_FLAG_MFP_ENABLED BIT(13)
#define I40E_FLAG_UDP_FILTER_SYNC BIT(14)
#define I40E_FLAG_HW_ATR_EVICT_ENABLED BIT(15)
#define I40E_FLAG_VEB_MODE_ENABLED BIT(16)
#define I40E_FLAG_VEB_STATS_ENABLED BIT(17)
#define I40E_FLAG_LINK_POLLING_ENABLED BIT(18)
#define I40E_FLAG_TRUE_PROMISC_SUPPORT BIT(19)
#define I40E_FLAG_TEMP_LINK_POLLING BIT(20)
#define I40E_FLAG_LEGACY_RX BIT(21)
#define I40E_FLAG_PTP BIT(22)
#define I40E_FLAG_IWARP_ENABLED BIT(23)
#define I40E_FLAG_SERVICE_CLIENT_REQUESTED BIT(24)
#define I40E_FLAG_CLIENT_L2_CHANGE BIT(25)
#define I40E_FLAG_CLIENT_RESET BIT(26)
#define I40E_FLAG_LINK_DOWN_ON_CLOSE_ENABLED BIT(27)
#define I40E_FLAG_SOURCE_PRUNING_DISABLED BIT(28)

struct i40e_client_instance *cinst;
bool stat_offsets_loaded;
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -1771,9 +1771,10 @@ enum i40e_aq_phy_type {
I40E_PHY_TYPE_25GBASE_CR = 0x20,
I40E_PHY_TYPE_25GBASE_SR = 0x21,
I40E_PHY_TYPE_25GBASE_LR = 0x22,
I40E_PHY_TYPE_MAX,
I40E_PHY_TYPE_NOT_SUPPORTED_HIGH_TEMP = 0xFD,
I40E_PHY_TYPE_EMPTY = 0xFE,
I40E_PHY_TYPE_DEFAULT = 0xFF,
I40E_PHY_TYPE_MAX
};

#define I40E_LINK_SPEED_100MB_SHIFT 0x1
Expand Down
8 changes: 4 additions & 4 deletions drivers/net/ethernet/intel/i40e/i40e_debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,8 @@ static void i40e_dbg_dump_vsi_seid(struct i40e_pf *pf, int seid)
rx_ring->netdev,
rx_ring->rx_bi);
dev_info(&pf->pdev->dev,
" rx_rings[%i]: state = %li, queue_index = %d, reg_idx = %d\n",
i, rx_ring->state,
" rx_rings[%i]: state = %lu, queue_index = %d, reg_idx = %d\n",
i, *rx_ring->state,
rx_ring->queue_index,
rx_ring->reg_idx);
dev_info(&pf->pdev->dev,
Expand Down Expand Up @@ -334,8 +334,8 @@ static void i40e_dbg_dump_vsi_seid(struct i40e_pf *pf, int seid)
tx_ring->netdev,
tx_ring->tx_bi);
dev_info(&pf->pdev->dev,
" tx_rings[%i]: state = %li, queue_index = %d, reg_idx = %d\n",
i, tx_ring->state,
" tx_rings[%i]: state = %lu, queue_index = %d, reg_idx = %d\n",
i, *tx_ring->state,
tx_ring->queue_index,
tx_ring->reg_idx);
dev_info(&pf->pdev->dev,
Expand Down
20 changes: 13 additions & 7 deletions drivers/net/ethernet/intel/i40e/i40e_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ static const struct i40e_priv_flags i40e_gstrings_priv_flags[] = {
I40E_PRIV_FLAG("veb-stats", I40E_FLAG_VEB_STATS_ENABLED, 0),
I40E_PRIV_FLAG("hw-atr-eviction", I40E_FLAG_HW_ATR_EVICT_ENABLED, 0),
I40E_PRIV_FLAG("legacy-rx", I40E_FLAG_LEGACY_RX, 0),
I40E_PRIV_FLAG("disable-source-pruning",
I40E_FLAG_SOURCE_PRUNING_DISABLED, 0),
};

#define I40E_PRIV_FLAGS_STR_LEN ARRAY_SIZE(i40e_gstrings_priv_flags)
Expand Down Expand Up @@ -2008,7 +2010,9 @@ static int i40e_set_phys_id(struct net_device *netdev,
if (!(pf->hw_features & I40E_HW_PHY_CONTROLS_LEDS)) {
pf->led_status = i40e_led_get(hw);
} else {
i40e_aq_set_phy_debug(hw, I40E_PHY_DEBUG_ALL, NULL);
if (!(hw->flags & I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE))
i40e_aq_set_phy_debug(hw, I40E_PHY_DEBUG_ALL,
NULL);
ret = i40e_led_get_phy(hw, &temp_status,
&pf->phy_led_val);
pf->led_status = temp_status;
Expand All @@ -2033,7 +2037,8 @@ static int i40e_set_phys_id(struct net_device *netdev,
ret = i40e_led_set_phy(hw, false, pf->led_status,
(pf->phy_led_val |
I40E_PHY_LED_MODE_ORIG));
i40e_aq_set_phy_debug(hw, 0, NULL);
if (!(hw->flags & I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE))
i40e_aq_set_phy_debug(hw, 0, NULL);
}
break;
default:
Expand Down Expand Up @@ -4090,7 +4095,7 @@ static int i40e_set_priv_flags(struct net_device *dev, u32 flags)
struct i40e_netdev_priv *np = netdev_priv(dev);
struct i40e_vsi *vsi = np->vsi;
struct i40e_pf *pf = vsi->back;
u64 orig_flags, new_flags, changed_flags;
u32 orig_flags, new_flags, changed_flags;
u32 i, j;

orig_flags = READ_ONCE(pf->flags);
Expand Down Expand Up @@ -4142,12 +4147,12 @@ static int i40e_set_priv_flags(struct net_device *dev, u32 flags)
return -EOPNOTSUPP;

/* Compare and exchange the new flags into place. If we failed, that
* is if cmpxchg64 returns anything but the old value, this means that
* is if cmpxchg returns anything but the old value, this means that
* something else has modified the flags variable since we copied it
* originally. We'll just punt with an error and log something in the
* message buffer.
*/
if (cmpxchg64(&pf->flags, orig_flags, new_flags) != orig_flags) {
if (cmpxchg(&pf->flags, orig_flags, new_flags) != orig_flags) {
dev_warn(&pf->pdev->dev,
"Unable to update pf->flags as it was modified by another thread...\n");
return -EAGAIN;
Expand Down Expand Up @@ -4189,8 +4194,9 @@ static int i40e_set_priv_flags(struct net_device *dev, u32 flags)
/* Issue reset to cause things to take effect, as additional bits
* are added we will need to create a mask of bits requiring reset
*/
if ((changed_flags & I40E_FLAG_VEB_STATS_ENABLED) ||
((changed_flags & I40E_FLAG_LEGACY_RX) && netif_running(dev)))
if (changed_flags & (I40E_FLAG_VEB_STATS_ENABLED |
I40E_FLAG_LEGACY_RX |
I40E_FLAG_SOURCE_PRUNING_DISABLED))
i40e_do_reset(pf, BIT(__I40E_PF_RESET_REQUESTED), true);

return 0;
Expand Down
Loading

0 comments on commit f5333f8

Please sign in to comment.