Merge branch '10GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue
Jeff Kirsher says: ==================== Intel Wired LAN Driver Updates 2020-05-28 This series contains updates to e1000, e1000e, igc, igb, ixgbe and i40e. Takashi Iwai, from SUSE, replaces some uses of snprintf() with scnprintf() since the succeeding calls may go beyond the given buffer limit in i40e. Jesper Dangaard Brouer fixes up code comments in i40e_xsk.c Xie XiuQi, from Huawei, fixes a signed-integer-overflow warning ixgbe driver. Jason Yan, from Huawei, converts '==' expression to bool to resolve warnings, also fixed a warning for assigning 0/1 to a bool variable in the ixgbe driver. Converts functions that always return 0 to void in the igb and i40e drivers. YueHaibing, from Hauwei, cleans up dead code in ixgbe driver. Sasha cleans up more dead code which is not used in the igc driver. Added receive error counter to reflect the total number of non-filtered packets received with errors. Fixed a register define name to properly reflect the register address being used. Andre updates the igc driver to reject NFC rules that have multiple matches, which is not supported in i225 devices. Updates the total number of NFC rules supported and added a code comment to explain what is supported. Punit Agrawal, from Toshiba, relaxes the condition to trigger a reset for ME, which was leading to inconsistency between the state of the hardware as expected by the driver in e1000e. Hari, from the Linux community, cleaned up a code comment in the e1000 driver. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
commit
cdde95bc89
|
@ -3960,7 +3960,7 @@ static s32 e1000_do_read_eeprom(struct e1000_hw *hw, u16 offset, u16 words,
|
|||
* @hw: Struct containing variables accessed by shared code
|
||||
*
|
||||
* Reads the first 64 16 bit words of the EEPROM and sums the values read.
|
||||
* If the the sum of the 64 16 bit words is 0xBABA, the EEPROM's checksum is
|
||||
* If the sum of the 64 16 bit words is 0xBABA, the EEPROM's checksum is
|
||||
* valid.
|
||||
*/
|
||||
s32 e1000_validate_eeprom_checksum(struct e1000_hw *hw)
|
||||
|
|
|
@ -576,7 +576,6 @@ static inline u32 __er32(struct e1000_hw *hw, unsigned long reg)
|
|||
|
||||
#define er32(reg) __er32(hw, E1000_##reg)
|
||||
|
||||
s32 __ew32_prepare(struct e1000_hw *hw);
|
||||
void __ew32(struct e1000_hw *hw, unsigned long reg, u32 val);
|
||||
|
||||
#define ew32(reg, val) __ew32(hw, E1000_##reg, (val))
|
||||
|
|
|
@ -158,14 +158,12 @@ static bool e1000e_check_me(u16 device_id)
|
|||
* has bit 24 set while ME is accessing MAC CSR registers, wait if it is set
|
||||
* and try again a number of times.
|
||||
**/
|
||||
s32 __ew32_prepare(struct e1000_hw *hw)
|
||||
static void __ew32_prepare(struct e1000_hw *hw)
|
||||
{
|
||||
s32 i = E1000_ICH_FWSM_PCIM2PCI_COUNT;
|
||||
|
||||
while ((er32(FWSM) & E1000_ICH_FWSM_PCIM2PCI) && --i)
|
||||
udelay(50);
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
void __ew32(struct e1000_hw *hw, unsigned long reg, u32 val)
|
||||
|
@ -646,11 +644,11 @@ static void e1000e_update_rdt_wa(struct e1000_ring *rx_ring, unsigned int i)
|
|||
{
|
||||
struct e1000_adapter *adapter = rx_ring->adapter;
|
||||
struct e1000_hw *hw = &adapter->hw;
|
||||
s32 ret_val = __ew32_prepare(hw);
|
||||
|
||||
__ew32_prepare(hw);
|
||||
writel(i, rx_ring->tail);
|
||||
|
||||
if (unlikely(!ret_val && (i != readl(rx_ring->tail)))) {
|
||||
if (unlikely(i != readl(rx_ring->tail))) {
|
||||
u32 rctl = er32(RCTL);
|
||||
|
||||
ew32(RCTL, rctl & ~E1000_RCTL_EN);
|
||||
|
@ -663,11 +661,11 @@ static void e1000e_update_tdt_wa(struct e1000_ring *tx_ring, unsigned int i)
|
|||
{
|
||||
struct e1000_adapter *adapter = tx_ring->adapter;
|
||||
struct e1000_hw *hw = &adapter->hw;
|
||||
s32 ret_val = __ew32_prepare(hw);
|
||||
|
||||
__ew32_prepare(hw);
|
||||
writel(i, tx_ring->tail);
|
||||
|
||||
if (unlikely(!ret_val && (i != readl(tx_ring->tail)))) {
|
||||
if (unlikely(i != readl(tx_ring->tail))) {
|
||||
u32 tctl = er32(TCTL);
|
||||
|
||||
ew32(TCTL, tctl & ~E1000_TCTL_EN);
|
||||
|
|
|
@ -694,10 +694,8 @@ init_adminq_exit:
|
|||
* i40e_shutdown_adminq - shutdown routine for the Admin Queue
|
||||
* @hw: pointer to the hardware structure
|
||||
**/
|
||||
i40e_status i40e_shutdown_adminq(struct i40e_hw *hw)
|
||||
void i40e_shutdown_adminq(struct i40e_hw *hw)
|
||||
{
|
||||
i40e_status ret_code = 0;
|
||||
|
||||
if (i40e_check_asq_alive(hw))
|
||||
i40e_aq_queue_shutdown(hw, true);
|
||||
|
||||
|
@ -706,8 +704,6 @@ i40e_status i40e_shutdown_adminq(struct i40e_hw *hw)
|
|||
|
||||
if (hw->nvm_buff.va)
|
||||
i40e_free_virt_mem(hw, &hw->nvm_buff);
|
||||
|
||||
return ret_code;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -14486,29 +14486,29 @@ static void i40e_print_features(struct i40e_pf *pf)
|
|||
|
||||
i = snprintf(buf, INFO_STRING_LEN, "Features: PF-id[%d]", hw->pf_id);
|
||||
#ifdef CONFIG_PCI_IOV
|
||||
i += snprintf(&buf[i], REMAIN(i), " VFs: %d", pf->num_req_vfs);
|
||||
i += scnprintf(&buf[i], REMAIN(i), " VFs: %d", pf->num_req_vfs);
|
||||
#endif
|
||||
i += snprintf(&buf[i], REMAIN(i), " VSIs: %d QP: %d",
|
||||
i += scnprintf(&buf[i], REMAIN(i), " VSIs: %d QP: %d",
|
||||
pf->hw.func_caps.num_vsis,
|
||||
pf->vsi[pf->lan_vsi]->num_queue_pairs);
|
||||
if (pf->flags & I40E_FLAG_RSS_ENABLED)
|
||||
i += snprintf(&buf[i], REMAIN(i), " RSS");
|
||||
i += scnprintf(&buf[i], REMAIN(i), " RSS");
|
||||
if (pf->flags & I40E_FLAG_FD_ATR_ENABLED)
|
||||
i += snprintf(&buf[i], REMAIN(i), " FD_ATR");
|
||||
i += scnprintf(&buf[i], REMAIN(i), " FD_ATR");
|
||||
if (pf->flags & I40E_FLAG_FD_SB_ENABLED) {
|
||||
i += snprintf(&buf[i], REMAIN(i), " FD_SB");
|
||||
i += snprintf(&buf[i], REMAIN(i), " NTUPLE");
|
||||
i += scnprintf(&buf[i], REMAIN(i), " FD_SB");
|
||||
i += scnprintf(&buf[i], REMAIN(i), " NTUPLE");
|
||||
}
|
||||
if (pf->flags & I40E_FLAG_DCB_CAPABLE)
|
||||
i += snprintf(&buf[i], REMAIN(i), " DCB");
|
||||
i += snprintf(&buf[i], REMAIN(i), " VxLAN");
|
||||
i += snprintf(&buf[i], REMAIN(i), " Geneve");
|
||||
i += scnprintf(&buf[i], REMAIN(i), " DCB");
|
||||
i += scnprintf(&buf[i], REMAIN(i), " VxLAN");
|
||||
i += scnprintf(&buf[i], REMAIN(i), " Geneve");
|
||||
if (pf->flags & I40E_FLAG_PTP)
|
||||
i += snprintf(&buf[i], REMAIN(i), " PTP");
|
||||
i += scnprintf(&buf[i], REMAIN(i), " PTP");
|
||||
if (pf->flags & I40E_FLAG_VEB_MODE_ENABLED)
|
||||
i += snprintf(&buf[i], REMAIN(i), " VEB");
|
||||
i += scnprintf(&buf[i], REMAIN(i), " VEB");
|
||||
else
|
||||
i += snprintf(&buf[i], REMAIN(i), " VEPA");
|
||||
i += scnprintf(&buf[i], REMAIN(i), " VEPA");
|
||||
|
||||
dev_info(&pf->pdev->dev, "%s\n", buf);
|
||||
kfree(buf);
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
/* adminq functions */
|
||||
i40e_status i40e_init_adminq(struct i40e_hw *hw);
|
||||
i40e_status i40e_shutdown_adminq(struct i40e_hw *hw);
|
||||
void i40e_shutdown_adminq(struct i40e_hw *hw);
|
||||
void i40e_adminq_init_ring_data(struct i40e_hw *hw);
|
||||
i40e_status i40e_clean_arq_element(struct i40e_hw *hw,
|
||||
struct i40e_arq_event_info *e,
|
||||
|
|
|
@ -139,8 +139,6 @@ int i40e_xsk_umem_setup(struct i40e_vsi *vsi, struct xdp_umem *umem,
|
|||
* @rx_ring: Rx ring
|
||||
* @xdp: xdp_buff used as input to the XDP program
|
||||
*
|
||||
* This function enables or disables a UMEM to a certain ring.
|
||||
*
|
||||
* Returns any of I40E_XDP_{PASS, CONSUMED, TX, REDIR}
|
||||
**/
|
||||
static int i40e_run_xdp_zc(struct i40e_ring *rx_ring, struct xdp_buff *xdp)
|
||||
|
@ -224,7 +222,7 @@ no_buffers:
|
|||
}
|
||||
|
||||
/**
|
||||
* i40e_construct_skb_zc - Create skbufff from zero-copy Rx buffer
|
||||
* i40e_construct_skb_zc - Create skbuff from zero-copy Rx buffer
|
||||
* @rx_ring: Rx ring
|
||||
* @xdp: xdp_buff
|
||||
*
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#include "igb.h"
|
||||
|
||||
static s32 igb_set_default_fc(struct e1000_hw *hw);
|
||||
static s32 igb_set_fc_watermarks(struct e1000_hw *hw);
|
||||
static void igb_set_fc_watermarks(struct e1000_hw *hw);
|
||||
|
||||
/**
|
||||
* igb_get_bus_info_pcie - Get PCIe bus information
|
||||
|
@ -687,7 +687,7 @@ s32 igb_setup_link(struct e1000_hw *hw)
|
|||
|
||||
wr32(E1000_FCTTV, hw->fc.pause_time);
|
||||
|
||||
ret_val = igb_set_fc_watermarks(hw);
|
||||
igb_set_fc_watermarks(hw);
|
||||
|
||||
out:
|
||||
|
||||
|
@ -723,9 +723,8 @@ void igb_config_collision_dist(struct e1000_hw *hw)
|
|||
* flow control XON frame transmission is enabled, then set XON frame
|
||||
* tansmission as well.
|
||||
**/
|
||||
static s32 igb_set_fc_watermarks(struct e1000_hw *hw)
|
||||
static void igb_set_fc_watermarks(struct e1000_hw *hw)
|
||||
{
|
||||
s32 ret_val = 0;
|
||||
u32 fcrtl = 0, fcrth = 0;
|
||||
|
||||
/* Set the flow control receive threshold registers. Normally,
|
||||
|
@ -747,8 +746,6 @@ static s32 igb_set_fc_watermarks(struct e1000_hw *hw)
|
|||
}
|
||||
wr32(E1000_FCRTL, fcrtl);
|
||||
wr32(E1000_FCRTH, fcrth);
|
||||
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -457,7 +457,10 @@ struct igc_nfc_rule {
|
|||
u16 action;
|
||||
};
|
||||
|
||||
#define IGC_MAX_RXNFC_RULES 16
|
||||
/* IGC supports a total of 32 NFC rules: 16 MAC address based,, 8 VLAN priority
|
||||
* based, and 8 ethertype based.
|
||||
*/
|
||||
#define IGC_MAX_RXNFC_RULES 32
|
||||
|
||||
/* igc_desc_unused - calculate if we have unused descriptors */
|
||||
static inline u16 igc_desc_unused(const struct igc_ring *ring)
|
||||
|
|
|
@ -269,13 +269,9 @@
|
|||
#define IGC_TXD_CMD_DEXT 0x20000000 /* Desc extension (0 = legacy) */
|
||||
#define IGC_TXD_CMD_VLE 0x40000000 /* Add VLAN tag */
|
||||
#define IGC_TXD_STAT_DD 0x00000001 /* Descriptor Done */
|
||||
#define IGC_TXD_STAT_EC 0x00000002 /* Excess Collisions */
|
||||
#define IGC_TXD_STAT_LC 0x00000004 /* Late Collisions */
|
||||
#define IGC_TXD_STAT_TU 0x00000008 /* Transmit underrun */
|
||||
#define IGC_TXD_CMD_TCP 0x01000000 /* TCP packet */
|
||||
#define IGC_TXD_CMD_IP 0x02000000 /* IP packet */
|
||||
#define IGC_TXD_CMD_TSE 0x04000000 /* TCP Seg enable */
|
||||
#define IGC_TXD_STAT_TC 0x00000004 /* Tx Underrun */
|
||||
#define IGC_TXD_EXTCMD_TSTAMP 0x00000010 /* IEEE1588 Timestamp packet */
|
||||
|
||||
/* IPSec Encrypt Enable */
|
||||
|
|
|
@ -1222,8 +1222,8 @@ static void igc_ethtool_init_nfc_rule(struct igc_nfc_rule *rule,
|
|||
* @adapter: Pointer to adapter
|
||||
* @rule: Rule under evaluation
|
||||
*
|
||||
* Rules with both destination and source MAC addresses are considered invalid
|
||||
* since the driver doesn't support them.
|
||||
* The driver doesn't support rules with multiple matches so if more than
|
||||
* one bit in filter flags is set, @rule is considered invalid.
|
||||
*
|
||||
* Also, if there is already another rule with the same filter in a different
|
||||
* location, @rule is considered invalid.
|
||||
|
@ -1244,9 +1244,8 @@ static int igc_ethtool_check_nfc_rule(struct igc_adapter *adapter,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (flags & IGC_FILTER_FLAG_DST_MAC_ADDR &&
|
||||
flags & IGC_FILTER_FLAG_SRC_MAC_ADDR) {
|
||||
netdev_dbg(dev, "Filters with both dst and src are not supported\n");
|
||||
if (flags & (flags - 1)) {
|
||||
netdev_dbg(dev, "Rule with multiple matches not supported\n");
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
|
|
|
@ -235,15 +235,14 @@ out:
|
|||
void igc_clear_hw_cntrs_base(struct igc_hw *hw)
|
||||
{
|
||||
rd32(IGC_CRCERRS);
|
||||
rd32(IGC_SYMERRS);
|
||||
rd32(IGC_MPC);
|
||||
rd32(IGC_SCC);
|
||||
rd32(IGC_ECOL);
|
||||
rd32(IGC_MCC);
|
||||
rd32(IGC_LATECOL);
|
||||
rd32(IGC_COLC);
|
||||
rd32(IGC_RERC);
|
||||
rd32(IGC_DC);
|
||||
rd32(IGC_SEC);
|
||||
rd32(IGC_RLEC);
|
||||
rd32(IGC_XONRXC);
|
||||
rd32(IGC_XONTXC);
|
||||
|
@ -288,7 +287,7 @@ void igc_clear_hw_cntrs_base(struct igc_hw *hw)
|
|||
rd32(IGC_ALGNERRC);
|
||||
rd32(IGC_RXERRC);
|
||||
rd32(IGC_TNCRS);
|
||||
rd32(IGC_CEXTERR);
|
||||
rd32(IGC_HTDPMC);
|
||||
rd32(IGC_TSCTC);
|
||||
rd32(IGC_TSCTFC);
|
||||
|
||||
|
|
|
@ -3701,8 +3701,6 @@ void igc_update_stats(struct igc_adapter *adapter)
|
|||
adapter->stats.prc511 += rd32(IGC_PRC511);
|
||||
adapter->stats.prc1023 += rd32(IGC_PRC1023);
|
||||
adapter->stats.prc1522 += rd32(IGC_PRC1522);
|
||||
adapter->stats.symerrs += rd32(IGC_SYMERRS);
|
||||
adapter->stats.sec += rd32(IGC_SEC);
|
||||
|
||||
mpc = rd32(IGC_MPC);
|
||||
adapter->stats.mpc += mpc;
|
||||
|
@ -3741,6 +3739,7 @@ void igc_update_stats(struct igc_adapter *adapter)
|
|||
|
||||
adapter->stats.tpt += rd32(IGC_TPT);
|
||||
adapter->stats.colc += rd32(IGC_COLC);
|
||||
adapter->stats.colc += rd32(IGC_RERC);
|
||||
|
||||
adapter->stats.algnerrc += rd32(IGC_ALGNERRC);
|
||||
|
||||
|
|
|
@ -127,7 +127,6 @@
|
|||
/* Statistics Register Descriptions */
|
||||
#define IGC_CRCERRS 0x04000 /* CRC Error Count - R/clr */
|
||||
#define IGC_ALGNERRC 0x04004 /* Alignment Error Count - R/clr */
|
||||
#define IGC_SYMERRS 0x04008 /* Symbol Error Count - R/clr */
|
||||
#define IGC_RXERRC 0x0400C /* Receive Error Count - R/clr */
|
||||
#define IGC_MPC 0x04010 /* Missed Packet Count - R/clr */
|
||||
#define IGC_SCC 0x04014 /* Single Collision Count - R/clr */
|
||||
|
@ -135,10 +134,10 @@
|
|||
#define IGC_MCC 0x0401C /* Multiple Collision Count - R/clr */
|
||||
#define IGC_LATECOL 0x04020 /* Late Collision Count - R/clr */
|
||||
#define IGC_COLC 0x04028 /* Collision Count - R/clr */
|
||||
#define IGC_RERC 0x0402C /* Receive Error Count - R/clr */
|
||||
#define IGC_DC 0x04030 /* Defer Count - R/clr */
|
||||
#define IGC_TNCRS 0x04034 /* Tx-No CRS - R/clr */
|
||||
#define IGC_SEC 0x04038 /* Sequence Error Count - R/clr */
|
||||
#define IGC_CEXTERR 0x0403C /* Carrier Extension Error Count - R/clr */
|
||||
#define IGC_HTDPMC 0x0403C /* Host Transmit Discarded by MAC - R/clr */
|
||||
#define IGC_RLEC 0x04040 /* Receive Length Error Count - R/clr */
|
||||
#define IGC_XONRXC 0x04048 /* XON Rx Count - R/clr */
|
||||
#define IGC_XONTXC 0x0404C /* XON Tx Count - R/clr */
|
||||
|
|
|
@ -64,8 +64,7 @@ bool ixgbe_device_supports_autoneg_fc(struct ixgbe_hw *hw)
|
|||
hw->mac.ops.check_link(hw, &speed, &link_up, false);
|
||||
/* if link is down, assume supported */
|
||||
if (link_up)
|
||||
supported = speed == IXGBE_LINK_SPEED_1GB_FULL ?
|
||||
true : false;
|
||||
supported = speed == IXGBE_LINK_SPEED_1GB_FULL;
|
||||
else
|
||||
supported = true;
|
||||
}
|
||||
|
@ -2243,7 +2242,7 @@ s32 ixgbe_fc_enable_generic(struct ixgbe_hw *hw)
|
|||
}
|
||||
|
||||
/* Configure pause time (2 TCs per register) */
|
||||
reg = hw->fc.pause_time * 0x00010001;
|
||||
reg = hw->fc.pause_time * 0x00010001U;
|
||||
for (i = 0; i < (MAX_TRAFFIC_CLASS / 2); i++)
|
||||
IXGBE_WRITE_REG(hw, IXGBE_FCTTV(i), reg);
|
||||
|
||||
|
|
|
@ -2973,35 +2973,6 @@ static inline void ixgbe_irq_enable_queues(struct ixgbe_adapter *adapter,
|
|||
/* skip the flush */
|
||||
}
|
||||
|
||||
static inline void ixgbe_irq_disable_queues(struct ixgbe_adapter *adapter,
|
||||
u64 qmask)
|
||||
{
|
||||
u32 mask;
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
|
||||
switch (hw->mac.type) {
|
||||
case ixgbe_mac_82598EB:
|
||||
mask = (IXGBE_EIMS_RTX_QUEUE & qmask);
|
||||
IXGBE_WRITE_REG(hw, IXGBE_EIMC, mask);
|
||||
break;
|
||||
case ixgbe_mac_82599EB:
|
||||
case ixgbe_mac_X540:
|
||||
case ixgbe_mac_X550:
|
||||
case ixgbe_mac_X550EM_x:
|
||||
case ixgbe_mac_x550em_a:
|
||||
mask = (qmask & 0xFFFFFFFF);
|
||||
if (mask)
|
||||
IXGBE_WRITE_REG(hw, IXGBE_EIMC_EX(0), mask);
|
||||
mask = (qmask >> 32);
|
||||
if (mask)
|
||||
IXGBE_WRITE_REG(hw, IXGBE_EIMC_EX(1), mask);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
/* skip the flush */
|
||||
}
|
||||
|
||||
/**
|
||||
* ixgbe_irq_enable - Enable default interrupt generation settings
|
||||
* @adapter: board private structure
|
||||
|
|
|
@ -102,7 +102,7 @@ static int __ixgbe_enable_sriov(struct ixgbe_adapter *adapter,
|
|||
* indirection table and RSS hash key with PF therefore
|
||||
* we want to disable the querying by default.
|
||||
*/
|
||||
adapter->vfinfo[i].rss_query_enabled = 0;
|
||||
adapter->vfinfo[i].rss_query_enabled = false;
|
||||
|
||||
/* Untrust all VFs */
|
||||
adapter->vfinfo[i].trusted = false;
|
||||
|
|
Loading…
Reference in New Issue