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

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


Jeff Kirsher says:

====================
40GbE Intel Wired LAN Driver Updates 2017-08-25

This series contains updates to i40e and i40evf only.

Mitch adjusts the max packet size to account for two VLAN tags.

Sudheer provides a fix to ensure that the watchdog timer is scheduled
immediately after admin queue operations are scheduled in i40evf_down().
Fixes an issue by adding locking around the admin queue command and
update of state variables so that adminq_subtask will have the accurate
information whenever it gets scheduled.

Anjali fixes a bug where the PF flag setup should happen before the VMDq
RSS queue count is initialized for VMDq VSI to get the right number of
queues for RSS in the case of x722 devices.  Fixed a problem with the
hardware ATR eviction feature where the NVM setting was incorrect.

Jake separates the flags into two types, hw_features and flags.  The
hw_features flags contain a set of features which are enabled at init
time and will not contain feature flags that can be toggled.  Everything
else will remain in the flags variable, and can be modified anytime
during run time.  We should not be directly copying a cpumask_t, since
it is bitmap and might not be copied correctly, so use cpumask_copy()
instead.

Stefan Assmann makes vf _offload_flags more "generic" by renaming it to
vf_cap_flags, which allows other capabilities besides offloading to be
added.

Alan makes it such that if adaptive-rx/tx is enabled, the user cannot
make any manual adjustments to interrupt moderation.  Also makes it so
that if ITR is disabled by adaptive-rx/tx is then enabled, ITR will be
re-enabled.

v2: Dropped patches #1 & #8 from the original patch series submission,
    while Jesse and Jake re-work their patches based on feedback from
    David Miller.  Also removed the duplicate patch 3 that was
    accidentally sent out twice in the previous submission.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents fac0cef9 2bf01935
Loading
Loading
Loading
Loading
+23 −21
Original line number Diff line number Diff line
@@ -75,11 +75,11 @@
#define I40E_MIN_VSI_ALLOC		83 /* LAN, ATR, FCOE, 64 VF */
/* max 16 qps */
#define i40e_default_queues_per_vmdq(pf) \
		(((pf)->flags & I40E_FLAG_RSS_AQ_CAPABLE) ? 4 : 1)
		(((pf)->hw_features & I40E_HW_RSS_AQ_CAPABLE) ? 4 : 1)
#define I40E_DEFAULT_QUEUES_PER_VF	4
#define I40E_DEFAULT_QUEUES_PER_TC	1 /* should be a power of 2 */
#define i40e_pf_get_max_q_per_tc(pf) \
		(((pf)->flags & I40E_FLAG_128_QP_RSS_CAPABLE) ? 128 : 64)
		(((pf)->hw_features & I40E_HW_128_QP_RSS_CAPABLE) ? 128 : 64)
#define I40E_FDIR_RING			0
#define I40E_FDIR_RING_COUNT		32
#define I40E_MAX_AQ_BUF_SIZE		4096
@@ -401,6 +401,27 @@ 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)

	u64 flags;
#define I40E_FLAG_RX_CSUM_ENABLED		BIT_ULL(1)
#define I40E_FLAG_MSI_ENABLED			BIT_ULL(2)
@@ -420,33 +441,14 @@ struct i40e_pf {
#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_PORT_ID_VALID			BIT_ULL(28)
#define I40E_FLAG_DCB_CAPABLE			BIT_ULL(29)
#define I40E_FLAG_RSS_AQ_CAPABLE		BIT_ULL(31)
#define I40E_FLAG_HW_ATR_EVICT_CAPABLE		BIT_ULL(32)
#define I40E_FLAG_OUTER_UDP_CSUM_CAPABLE	BIT_ULL(33)
#define I40E_FLAG_128_QP_RSS_CAPABLE		BIT_ULL(34)
#define I40E_FLAG_WB_ON_ITR_CAPABLE		BIT_ULL(35)
#define I40E_FLAG_VEB_STATS_ENABLED		BIT_ULL(37)
#define I40E_FLAG_MULTIPLE_TCP_UDP_RSS_PCTYPE	BIT_ULL(38)
#define I40E_FLAG_LINK_POLLING_ENABLED		BIT_ULL(39)
#define I40E_FLAG_VEB_MODE_ENABLED		BIT_ULL(40)
#define I40E_FLAG_GENEVE_OFFLOAD_CAPABLE	BIT_ULL(41)
#define I40E_FLAG_NO_PCI_LINK_CHECK		BIT_ULL(42)
#define I40E_FLAG_100M_SGMII_CAPABLE		BIT_ULL(43)
#define I40E_FLAG_RESTART_AUTONEG		BIT_ULL(44)
#define I40E_FLAG_NO_DCB_SUPPORT		BIT_ULL(45)
#define I40E_FLAG_USE_SET_LLDP_MIB		BIT_ULL(46)
#define I40E_FLAG_STOP_FW_LLDP			BIT_ULL(47)
#define I40E_FLAG_PHY_CONTROLS_LEDS		BIT_ULL(48)
#define I40E_FLAG_PF_MAC			BIT_ULL(50)
#define I40E_FLAG_TRUE_PROMISC_SUPPORT		BIT_ULL(51)
#define I40E_FLAG_HAVE_CRT_RETIMER		BIT_ULL(52)
#define I40E_FLAG_PTP_L4_CAPABLE		BIT_ULL(53)
#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_WOL_MC_MAGIC_PKT_WAKE		BIT_ULL(57)
#define I40E_FLAG_LEGACY_RX			BIT_ULL(58)

	struct i40e_client_instance *cinst;
+98 −56
Original line number Diff line number Diff line
@@ -271,7 +271,7 @@ static void i40e_phy_type_to_ethtool(struct i40e_pf *pf, u32 *supported,
		*advertising |= ADVERTISED_Autoneg;
		if (hw_link_info->requested_speeds & I40E_LINK_SPEED_1GB)
			*advertising |= ADVERTISED_1000baseT_Full;
		if (pf->flags & I40E_FLAG_100M_SGMII_CAPABLE) {
		if (pf->hw_features & I40E_HW_100M_SGMII_CAPABLE) {
			*supported |= SUPPORTED_100baseT_Full;
			*advertising |= ADVERTISED_100baseT_Full;
		}
@@ -340,12 +340,12 @@ static void i40e_phy_type_to_ethtool(struct i40e_pf *pf, u32 *supported,
			*advertising |= ADVERTISED_20000baseKR2_Full;
	}
	if (phy_types & I40E_CAP_PHY_TYPE_10GBASE_KR) {
		if (!(pf->flags & I40E_FLAG_HAVE_CRT_RETIMER))
		if (!(pf->hw_features & I40E_HW_HAVE_CRT_RETIMER))
			*supported |= SUPPORTED_10000baseKR_Full |
				      SUPPORTED_Autoneg;
		*advertising |= ADVERTISED_Autoneg;
		if (hw_link_info->requested_speeds & I40E_LINK_SPEED_10GB)
			if (!(pf->flags & I40E_FLAG_HAVE_CRT_RETIMER))
			if (!(pf->hw_features & I40E_HW_HAVE_CRT_RETIMER))
				*advertising |= ADVERTISED_10000baseKR_Full;
	}
	if (phy_types & I40E_CAP_PHY_TYPE_10GBASE_KX4) {
@@ -356,12 +356,12 @@ static void i40e_phy_type_to_ethtool(struct i40e_pf *pf, u32 *supported,
			*advertising |= ADVERTISED_10000baseKX4_Full;
	}
	if (phy_types & I40E_CAP_PHY_TYPE_1000BASE_KX) {
		if (!(pf->flags & I40E_FLAG_HAVE_CRT_RETIMER))
		if (!(pf->hw_features & I40E_HW_HAVE_CRT_RETIMER))
			*supported |= SUPPORTED_1000baseKX_Full |
				      SUPPORTED_Autoneg;
		*advertising |= ADVERTISED_Autoneg;
		if (hw_link_info->requested_speeds & I40E_LINK_SPEED_1GB)
			if (!(pf->flags & I40E_FLAG_HAVE_CRT_RETIMER))
			if (!(pf->hw_features & I40E_HW_HAVE_CRT_RETIMER))
				*advertising |= ADVERTISED_1000baseKX_Full;
	}
	if (phy_types & I40E_CAP_PHY_TYPE_25GBASE_KR ||
@@ -474,7 +474,7 @@ static void i40e_get_settings_link_up(struct i40e_hw *hw,
			    SUPPORTED_1000baseT_Full;
		if (hw_link_info->requested_speeds & I40E_LINK_SPEED_1GB)
			advertising |= ADVERTISED_1000baseT_Full;
		if (pf->flags & I40E_FLAG_100M_SGMII_CAPABLE) {
		if (pf->hw_features & I40E_HW_100M_SGMII_CAPABLE) {
			supported |= SUPPORTED_100baseT_Full;
			if (hw_link_info->requested_speeds &
			    I40E_LINK_SPEED_100MB)
@@ -1765,7 +1765,7 @@ static int i40e_get_ts_info(struct net_device *dev,
			   BIT(HWTSTAMP_FILTER_PTP_V2_L2_SYNC) |
			   BIT(HWTSTAMP_FILTER_PTP_V2_L2_DELAY_REQ);

	if (pf->flags & I40E_FLAG_PTP_L4_CAPABLE)
	if (pf->hw_features & I40E_HW_PTP_L4_CAPABLE)
		info->rx_filters |= BIT(HWTSTAMP_FILTER_PTP_V1_L4_SYNC) |
				    BIT(HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ) |
				    BIT(HWTSTAMP_FILTER_PTP_V2_EVENT) |
@@ -2005,7 +2005,7 @@ static int i40e_set_phys_id(struct net_device *netdev,

	switch (state) {
	case ETHTOOL_ID_ACTIVE:
		if (!(pf->flags & I40E_FLAG_PHY_CONTROLS_LEDS)) {
		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);
@@ -2015,19 +2015,19 @@ static int i40e_set_phys_id(struct net_device *netdev,
		}
		return blink_freq;
	case ETHTOOL_ID_ON:
		if (!(pf->flags & I40E_FLAG_PHY_CONTROLS_LEDS))
		if (!(pf->hw_features & I40E_HW_PHY_CONTROLS_LEDS))
			i40e_led_set(hw, 0xf, false);
		else
			ret = i40e_led_set_phy(hw, true, pf->led_status, 0);
		break;
	case ETHTOOL_ID_OFF:
		if (!(pf->flags & I40E_FLAG_PHY_CONTROLS_LEDS))
		if (!(pf->hw_features & I40E_HW_PHY_CONTROLS_LEDS))
			i40e_led_set(hw, 0x0, false);
		else
			ret = i40e_led_set_phy(hw, false, pf->led_status, 0);
		break;
	case ETHTOOL_ID_INACTIVE:
		if (!(pf->flags & I40E_FLAG_PHY_CONTROLS_LEDS)) {
		if (!(pf->hw_features & I40E_HW_PHY_CONTROLS_LEDS)) {
			i40e_led_set(hw, pf->led_status, false);
		} else {
			ret = i40e_led_set_phy(hw, false, pf->led_status,
@@ -2194,14 +2194,29 @@ static int __i40e_set_coalesce(struct net_device *netdev,
			       int queue)
{
	struct i40e_netdev_priv *np = netdev_priv(netdev);
	u16 intrl_reg, cur_rx_itr, cur_tx_itr;
	struct i40e_vsi *vsi = np->vsi;
	struct i40e_pf *pf = vsi->back;
	u16 intrl_reg;
	int i;

	if (ec->tx_max_coalesced_frames_irq || ec->rx_max_coalesced_frames_irq)
		vsi->work_limit = ec->tx_max_coalesced_frames_irq;

	if (queue < 0) {
		cur_rx_itr = vsi->rx_rings[0]->rx_itr_setting;
		cur_tx_itr = vsi->tx_rings[0]->tx_itr_setting;
	} else if (queue < vsi->num_queue_pairs) {
		cur_rx_itr = vsi->rx_rings[queue]->rx_itr_setting;
		cur_tx_itr = vsi->tx_rings[queue]->tx_itr_setting;
	} else {
		netif_info(pf, drv, netdev, "Invalid queue value, queue range is 0 - %d\n",
			   vsi->num_queue_pairs - 1);
		return -EINVAL;
	}

	cur_tx_itr &= ~I40E_ITR_DYNAMIC;
	cur_rx_itr &= ~I40E_ITR_DYNAMIC;

	/* tx_coalesce_usecs_high is ignored, use rx-usecs-high instead */
	if (ec->tx_coalesce_usecs_high != vsi->int_rate_limit) {
		netif_info(pf, drv, netdev, "tx-usecs-high is not used, please program rx-usecs-high\n");
@@ -2214,15 +2229,34 @@ static int __i40e_set_coalesce(struct net_device *netdev,
		return -EINVAL;
	}

	if (ec->rx_coalesce_usecs == 0) {
		if (ec->use_adaptive_rx_coalesce)
			netif_info(pf, drv, netdev, "rx-usecs=0, need to disable adaptive-rx for a complete disable\n");
	} else if ((ec->rx_coalesce_usecs < (I40E_MIN_ITR << 1)) ||
		   (ec->rx_coalesce_usecs > (I40E_MAX_ITR << 1))) {
	if (ec->rx_coalesce_usecs != cur_rx_itr &&
	    ec->use_adaptive_rx_coalesce) {
		netif_info(pf, drv, netdev, "RX interrupt moderation cannot be changed if adaptive-rx is enabled.\n");
		return -EINVAL;
	}

	if (ec->rx_coalesce_usecs > (I40E_MAX_ITR << 1)) {
		netif_info(pf, drv, netdev, "Invalid value, rx-usecs range is 0-8160\n");
		return -EINVAL;
	}

	if (ec->tx_coalesce_usecs != cur_tx_itr &&
	    ec->use_adaptive_tx_coalesce) {
		netif_info(pf, drv, netdev, "TX interrupt moderation cannot be changed if adaptive-tx is enabled.\n");
		return -EINVAL;
	}

	if (ec->tx_coalesce_usecs > (I40E_MAX_ITR << 1)) {
		netif_info(pf, drv, netdev, "Invalid value, tx-usecs range is 0-8160\n");
		return -EINVAL;
	}

	if (ec->use_adaptive_rx_coalesce && !cur_rx_itr)
		ec->rx_coalesce_usecs = I40E_MIN_ITR << 1;

	if (ec->use_adaptive_tx_coalesce && !cur_tx_itr)
		ec->tx_coalesce_usecs = I40E_MIN_ITR << 1;

	intrl_reg = i40e_intrl_usec_to_reg(ec->rx_coalesce_usecs_high);
	vsi->int_rate_limit = INTRL_REG_TO_USEC(intrl_reg);
	if (vsi->int_rate_limit != ec->rx_coalesce_usecs_high) {
@@ -2230,27 +2264,14 @@ static int __i40e_set_coalesce(struct net_device *netdev,
			   vsi->int_rate_limit);
	}

	if (ec->tx_coalesce_usecs == 0) {
		if (ec->use_adaptive_tx_coalesce)
			netif_info(pf, drv, netdev, "tx-usecs=0, need to disable adaptive-tx for a complete disable\n");
	} else if ((ec->tx_coalesce_usecs < (I40E_MIN_ITR << 1)) ||
		   (ec->tx_coalesce_usecs > (I40E_MAX_ITR << 1))) {
			netif_info(pf, drv, netdev, "Invalid value, tx-usecs range is 0-8160\n");
			return -EINVAL;
	}

	/* rx and tx usecs has per queue value. If user doesn't specify the queue,
	 * apply to all queues.
	 */
	if (queue < 0) {
		for (i = 0; i < vsi->num_queue_pairs; i++)
			i40e_set_itr_per_queue(vsi, ec, i);
	} else if (queue < vsi->num_queue_pairs) {
		i40e_set_itr_per_queue(vsi, ec, queue);
	} else {
		netif_info(pf, drv, netdev, "Invalid queue value, queue range is 0 - %d\n",
			   vsi->num_queue_pairs - 1);
		return -EINVAL;
		i40e_set_itr_per_queue(vsi, ec, queue);
	}

	return 0;
@@ -2727,22 +2748,22 @@ static int i40e_set_rss_hash_opt(struct i40e_pf *pf, struct ethtool_rxnfc *nfc)
	switch (nfc->flow_type) {
	case TCP_V4_FLOW:
		flow_pctype = I40E_FILTER_PCTYPE_NONF_IPV4_TCP;
		if (pf->flags & I40E_FLAG_MULTIPLE_TCP_UDP_RSS_PCTYPE)
		if (pf->hw_features & I40E_HW_MULTIPLE_TCP_UDP_RSS_PCTYPE)
			hena |=
			  BIT_ULL(I40E_FILTER_PCTYPE_NONF_IPV4_TCP_SYN_NO_ACK);
		break;
	case TCP_V6_FLOW:
		flow_pctype = I40E_FILTER_PCTYPE_NONF_IPV6_TCP;
		if (pf->flags & I40E_FLAG_MULTIPLE_TCP_UDP_RSS_PCTYPE)
		if (pf->hw_features & I40E_HW_MULTIPLE_TCP_UDP_RSS_PCTYPE)
			hena |=
			  BIT_ULL(I40E_FILTER_PCTYPE_NONF_IPV4_TCP_SYN_NO_ACK);
		if (pf->flags & I40E_FLAG_MULTIPLE_TCP_UDP_RSS_PCTYPE)
		if (pf->hw_features & I40E_HW_MULTIPLE_TCP_UDP_RSS_PCTYPE)
			hena |=
			  BIT_ULL(I40E_FILTER_PCTYPE_NONF_IPV6_TCP_SYN_NO_ACK);
		break;
	case UDP_V4_FLOW:
		flow_pctype = I40E_FILTER_PCTYPE_NONF_IPV4_UDP;
		if (pf->flags & I40E_FLAG_MULTIPLE_TCP_UDP_RSS_PCTYPE)
		if (pf->hw_features & I40E_HW_MULTIPLE_TCP_UDP_RSS_PCTYPE)
			hena |=
			  BIT_ULL(I40E_FILTER_PCTYPE_NONF_UNICAST_IPV4_UDP) |
			  BIT_ULL(I40E_FILTER_PCTYPE_NONF_MULTICAST_IPV4_UDP);
@@ -2751,7 +2772,7 @@ static int i40e_set_rss_hash_opt(struct i40e_pf *pf, struct ethtool_rxnfc *nfc)
		break;
	case UDP_V6_FLOW:
		flow_pctype = I40E_FILTER_PCTYPE_NONF_IPV6_UDP;
		if (pf->flags & I40E_FLAG_MULTIPLE_TCP_UDP_RSS_PCTYPE)
		if (pf->hw_features & I40E_HW_MULTIPLE_TCP_UDP_RSS_PCTYPE)
			hena |=
			  BIT_ULL(I40E_FILTER_PCTYPE_NONF_UNICAST_IPV6_UDP) |
			  BIT_ULL(I40E_FILTER_PCTYPE_NONF_MULTICAST_IPV6_UDP);
@@ -4069,23 +4090,26 @@ 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 changed_flags;
	u64 orig_flags, new_flags, changed_flags;
	u32 i, j;

	changed_flags = pf->flags;
	orig_flags = READ_ONCE(pf->flags);
	new_flags = orig_flags;

	for (i = 0; i < I40E_PRIV_FLAGS_STR_LEN; i++) {
		const struct i40e_priv_flags *priv_flags;

		priv_flags = &i40e_gstrings_priv_flags[i];

		if (priv_flags->read_only)
			continue;

		if (flags & BIT(i))
			pf->flags |= priv_flags->flag;
			new_flags |= priv_flags->flag;
		else
			pf->flags &= ~(priv_flags->flag);
			new_flags &= ~(priv_flags->flag);

		/* If this is a read-only flag, it can't be changed */
		if (priv_flags->read_only &&
		    ((orig_flags ^ new_flags) & ~BIT(i)))
			return -EOPNOTSUPP;
	}

	if (pf->hw.pf_id != 0)
@@ -4096,18 +4120,40 @@ static int i40e_set_priv_flags(struct net_device *dev, u32 flags)

		priv_flags = &i40e_gl_gstrings_priv_flags[j];

		if (priv_flags->read_only)
			continue;

		if (flags & BIT(i + j))
			pf->flags |= priv_flags->flag;
			new_flags |= priv_flags->flag;
		else
			pf->flags &= ~(priv_flags->flag);
			new_flags &= ~(priv_flags->flag);

		/* If this is a read-only flag, it can't be changed */
		if (priv_flags->read_only &&
		    ((orig_flags ^ new_flags) & ~BIT(i)))
			return -EOPNOTSUPP;
	}

flags_complete:
	/* check for flags that changed */
	changed_flags ^= pf->flags;
	/* Before we finalize any flag changes, we need to perform some
	 * checks to ensure that the changes are supported and safe.
	 */

	/* ATR eviction is not supported on all devices */
	if ((new_flags & I40E_FLAG_HW_ATR_EVICT_ENABLED) &&
	    !(pf->hw_features & I40E_HW_ATR_EVICT_CAPABLE))
		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
	 * 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) {
		dev_warn(&pf->pdev->dev,
			 "Unable to update pf->flags as it was modified by another thread...\n");
		return -EAGAIN;
	}

	changed_flags = orig_flags ^ new_flags;

	/* Process any additional changes needed as a result of flag changes.
	 * The changed_flags value reflects the list of bits that were
@@ -4121,10 +4167,6 @@ static int i40e_set_priv_flags(struct net_device *dev, u32 flags)
		set_bit(__I40E_FD_FLUSH_REQUESTED, pf->state);
	}

	/* Only allow ATR evict on hardware that is capable of handling it */
	if (pf->flags & I40E_FLAG_HW_ATR_EVICT_CAPABLE)
		pf->flags &= ~I40E_FLAG_HW_ATR_EVICT_ENABLED;

	if (changed_flags & I40E_FLAG_TRUE_PROMISC_SUPPORT) {
		u16 sw_flags = 0, valid_flags = 0;
		int ret;
+69 −119

File changed.

Preview size limit exceeded, changes collapsed.

+6 −0
Original line number Diff line number Diff line
@@ -753,6 +753,11 @@ i40e_status i40e_nvmupd_command(struct i40e_hw *hw,
		hw->nvmupd_state = I40E_NVMUPD_STATE_INIT;
	}

	/* Acquire lock to prevent race condition where adminq_task
	 * can execute after i40e_nvmupd_nvm_read/write but before state
	 * variables (nvm_wait_opcode, nvm_release_on_done) are updated
	 */
	mutex_lock(&hw->aq.arq_mutex);
	switch (hw->nvmupd_state) {
	case I40E_NVMUPD_STATE_INIT:
		status = i40e_nvmupd_state_init(hw, cmd, bytes, perrno);
@@ -788,6 +793,7 @@ i40e_status i40e_nvmupd_command(struct i40e_hw *hw,
		*perrno = -ESRCH;
		break;
	}
	mutex_unlock(&hw->aq.arq_mutex);
	return status;
}

+3 −3
Original line number Diff line number Diff line
@@ -569,7 +569,7 @@ static int i40e_ptp_set_timestamp_mode(struct i40e_pf *pf,
	case HWTSTAMP_FILTER_PTP_V1_L4_SYNC:
	case HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ:
	case HWTSTAMP_FILTER_PTP_V1_L4_EVENT:
		if (!(pf->flags & I40E_FLAG_PTP_L4_CAPABLE))
		if (!(pf->hw_features & I40E_HW_PTP_L4_CAPABLE))
			return -ERANGE;
		pf->ptp_rx = true;
		tsyntype = I40E_PRTTSYN_CTL1_V1MESSTYPE0_MASK |
@@ -583,7 +583,7 @@ static int i40e_ptp_set_timestamp_mode(struct i40e_pf *pf,
	case HWTSTAMP_FILTER_PTP_V2_L4_SYNC:
	case HWTSTAMP_FILTER_PTP_V2_DELAY_REQ:
	case HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ:
		if (!(pf->flags & I40E_FLAG_PTP_L4_CAPABLE))
		if (!(pf->hw_features & I40E_HW_PTP_L4_CAPABLE))
			return -ERANGE;
		/* fall through */
	case HWTSTAMP_FILTER_PTP_V2_L2_EVENT:
@@ -592,7 +592,7 @@ static int i40e_ptp_set_timestamp_mode(struct i40e_pf *pf,
		pf->ptp_rx = true;
		tsyntype = I40E_PRTTSYN_CTL1_V2MESSTYPE0_MASK |
			   I40E_PRTTSYN_CTL1_TSYNTYPE_V2;
		if (pf->flags & I40E_FLAG_PTP_L4_CAPABLE) {
		if (pf->hw_features & I40E_HW_PTP_L4_CAPABLE) {
			tsyntype |= I40E_PRTTSYN_CTL1_UDP_ENA_MASK;
			config->rx_filter = HWTSTAMP_FILTER_PTP_V2_EVENT;
		} else {
Loading