|
@@ -5350,7 +5350,7 @@ static int i40e_init_pf_dcb(struct i40e_pf *pf)
|
|
|
int err = 0;
|
|
|
|
|
|
/* Do not enable DCB for SW1 and SW2 images even if the FW is capable */
|
|
|
- if (pf->flags & I40E_FLAG_NO_DCB_SUPPORT)
|
|
|
+ if (pf->hw_features & I40E_HW_NO_DCB_SUPPORT)
|
|
|
goto out;
|
|
|
|
|
|
/* Get the initial DCB configuration */
|
|
@@ -7332,7 +7332,7 @@ static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired)
|
|
|
wr32(hw, I40E_REG_MSS, val);
|
|
|
}
|
|
|
|
|
|
- if (pf->flags & I40E_FLAG_RESTART_AUTONEG) {
|
|
|
+ if (pf->hw_features & I40E_HW_RESTART_AUTONEG) {
|
|
|
msleep(75);
|
|
|
ret = i40e_aq_set_link_restart_an(&pf->hw, true, NULL);
|
|
|
if (ret)
|
|
@@ -7970,7 +7970,7 @@ static int i40e_alloc_rings(struct i40e_vsi *vsi)
|
|
|
ring->count = vsi->num_desc;
|
|
|
ring->size = 0;
|
|
|
ring->dcb_tc = 0;
|
|
|
- if (vsi->back->flags & I40E_FLAG_WB_ON_ITR_CAPABLE)
|
|
|
+ if (vsi->back->hw_features & I40E_HW_WB_ON_ITR_CAPABLE)
|
|
|
ring->flags = I40E_TXR_FLAGS_WB_ON_ITR;
|
|
|
ring->tx_itr_setting = pf->tx_itr_default;
|
|
|
vsi->tx_rings[i] = ring++;
|
|
@@ -7987,7 +7987,7 @@ static int i40e_alloc_rings(struct i40e_vsi *vsi)
|
|
|
ring->count = vsi->num_desc;
|
|
|
ring->size = 0;
|
|
|
ring->dcb_tc = 0;
|
|
|
- if (vsi->back->flags & I40E_FLAG_WB_ON_ITR_CAPABLE)
|
|
|
+ if (vsi->back->hw_features & I40E_HW_WB_ON_ITR_CAPABLE)
|
|
|
ring->flags = I40E_TXR_FLAGS_WB_ON_ITR;
|
|
|
set_ring_xdp(ring);
|
|
|
ring->tx_itr_setting = pf->tx_itr_default;
|
|
@@ -8523,7 +8523,7 @@ static int i40e_vsi_config_rss(struct i40e_vsi *vsi)
|
|
|
u8 *lut;
|
|
|
int ret;
|
|
|
|
|
|
- if (!(pf->flags & I40E_FLAG_RSS_AQ_CAPABLE))
|
|
|
+ if (!(pf->hw_features & I40E_HW_RSS_AQ_CAPABLE))
|
|
|
return 0;
|
|
|
|
|
|
if (!vsi->rss_size)
|
|
@@ -8653,7 +8653,7 @@ int i40e_config_rss(struct i40e_vsi *vsi, u8 *seed, u8 *lut, u16 lut_size)
|
|
|
{
|
|
|
struct i40e_pf *pf = vsi->back;
|
|
|
|
|
|
- if (pf->flags & I40E_FLAG_RSS_AQ_CAPABLE)
|
|
|
+ if (pf->hw_features & I40E_HW_RSS_AQ_CAPABLE)
|
|
|
return i40e_config_rss_aq(vsi, seed, lut, lut_size);
|
|
|
else
|
|
|
return i40e_config_rss_reg(vsi, seed, lut, lut_size);
|
|
@@ -8672,7 +8672,7 @@ int i40e_get_rss(struct i40e_vsi *vsi, u8 *seed, u8 *lut, u16 lut_size)
|
|
|
{
|
|
|
struct i40e_pf *pf = vsi->back;
|
|
|
|
|
|
- if (pf->flags & I40E_FLAG_RSS_AQ_CAPABLE)
|
|
|
+ if (pf->hw_features & I40E_HW_RSS_AQ_CAPABLE)
|
|
|
return i40e_get_rss_aq(vsi, seed, lut, lut_size);
|
|
|
else
|
|
|
return i40e_get_rss_reg(vsi, seed, lut, lut_size);
|
|
@@ -9001,47 +9001,47 @@ static int i40e_sw_init(struct i40e_pf *pf)
|
|
|
}
|
|
|
|
|
|
if (pf->hw.mac.type == I40E_MAC_X722) {
|
|
|
- pf->flags |= I40E_FLAG_RSS_AQ_CAPABLE
|
|
|
- | I40E_FLAG_128_QP_RSS_CAPABLE
|
|
|
- | I40E_FLAG_HW_ATR_EVICT_CAPABLE
|
|
|
- | I40E_FLAG_OUTER_UDP_CSUM_CAPABLE
|
|
|
- | I40E_FLAG_WB_ON_ITR_CAPABLE
|
|
|
- | I40E_FLAG_MULTIPLE_TCP_UDP_RSS_PCTYPE
|
|
|
- | I40E_FLAG_NO_PCI_LINK_CHECK
|
|
|
- | I40E_FLAG_USE_SET_LLDP_MIB
|
|
|
- | I40E_FLAG_GENEVE_OFFLOAD_CAPABLE
|
|
|
- | I40E_FLAG_PTP_L4_CAPABLE
|
|
|
- | I40E_FLAG_WOL_MC_MAGIC_PKT_WAKE;
|
|
|
+ pf->hw_features |= (I40E_HW_RSS_AQ_CAPABLE |
|
|
|
+ I40E_HW_128_QP_RSS_CAPABLE |
|
|
|
+ I40E_HW_ATR_EVICT_CAPABLE |
|
|
|
+ I40E_HW_WB_ON_ITR_CAPABLE |
|
|
|
+ I40E_HW_MULTIPLE_TCP_UDP_RSS_PCTYPE |
|
|
|
+ I40E_HW_NO_PCI_LINK_CHECK |
|
|
|
+ I40E_HW_USE_SET_LLDP_MIB |
|
|
|
+ I40E_HW_GENEVE_OFFLOAD_CAPABLE |
|
|
|
+ I40E_HW_PTP_L4_CAPABLE |
|
|
|
+ I40E_HW_WOL_MC_MAGIC_PKT_WAKE |
|
|
|
+ I40E_HW_OUTER_UDP_CSUM_CAPABLE);
|
|
|
} else if ((pf->hw.aq.api_maj_ver > 1) ||
|
|
|
((pf->hw.aq.api_maj_ver == 1) &&
|
|
|
(pf->hw.aq.api_min_ver > 4))) {
|
|
|
/* Supported in FW API version higher than 1.4 */
|
|
|
- pf->flags |= I40E_FLAG_GENEVE_OFFLOAD_CAPABLE;
|
|
|
+ pf->hw_features |= I40E_HW_GENEVE_OFFLOAD_CAPABLE;
|
|
|
}
|
|
|
|
|
|
/* Enable HW ATR eviction if possible */
|
|
|
- if (pf->flags & I40E_FLAG_HW_ATR_EVICT_CAPABLE)
|
|
|
+ if (pf->hw_features & I40E_HW_ATR_EVICT_CAPABLE)
|
|
|
pf->flags |= I40E_FLAG_HW_ATR_EVICT_ENABLED;
|
|
|
|
|
|
if ((pf->hw.mac.type == I40E_MAC_XL710) &&
|
|
|
(((pf->hw.aq.fw_maj_ver == 4) && (pf->hw.aq.fw_min_ver < 33)) ||
|
|
|
(pf->hw.aq.fw_maj_ver < 4))) {
|
|
|
- pf->flags |= I40E_FLAG_RESTART_AUTONEG;
|
|
|
+ pf->hw_features |= I40E_HW_RESTART_AUTONEG;
|
|
|
/* No DCB support for FW < v4.33 */
|
|
|
- pf->flags |= I40E_FLAG_NO_DCB_SUPPORT;
|
|
|
+ pf->hw_features |= I40E_HW_NO_DCB_SUPPORT;
|
|
|
}
|
|
|
|
|
|
/* Disable FW LLDP if FW < v4.3 */
|
|
|
if ((pf->hw.mac.type == I40E_MAC_XL710) &&
|
|
|
(((pf->hw.aq.fw_maj_ver == 4) && (pf->hw.aq.fw_min_ver < 3)) ||
|
|
|
(pf->hw.aq.fw_maj_ver < 4)))
|
|
|
- pf->flags |= I40E_FLAG_STOP_FW_LLDP;
|
|
|
+ pf->hw_features |= I40E_HW_STOP_FW_LLDP;
|
|
|
|
|
|
/* Use the FW Set LLDP MIB API if FW > v4.40 */
|
|
|
if ((pf->hw.mac.type == I40E_MAC_XL710) &&
|
|
|
(((pf->hw.aq.fw_maj_ver == 4) && (pf->hw.aq.fw_min_ver >= 40)) ||
|
|
|
(pf->hw.aq.fw_maj_ver >= 5)))
|
|
|
- pf->flags |= I40E_FLAG_USE_SET_LLDP_MIB;
|
|
|
+ pf->hw_features |= I40E_HW_USE_SET_LLDP_MIB;
|
|
|
|
|
|
if (pf->hw.func_caps.vmdq) {
|
|
|
pf->num_vmdq_vsis = I40E_DEFAULT_NUM_VMDQ_VSI;
|
|
@@ -9244,7 +9244,7 @@ static void i40e_udp_tunnel_add(struct net_device *netdev,
|
|
|
pf->udp_ports[next_idx].type = I40E_AQC_TUNNEL_TYPE_VXLAN;
|
|
|
break;
|
|
|
case UDP_TUNNEL_TYPE_GENEVE:
|
|
|
- if (!(pf->flags & I40E_FLAG_GENEVE_OFFLOAD_CAPABLE))
|
|
|
+ if (!(pf->hw_features & I40E_HW_GENEVE_OFFLOAD_CAPABLE))
|
|
|
return;
|
|
|
pf->udp_ports[next_idx].type = I40E_AQC_TUNNEL_TYPE_NGE;
|
|
|
break;
|
|
@@ -9311,7 +9311,7 @@ static int i40e_get_phys_port_id(struct net_device *netdev,
|
|
|
struct i40e_pf *pf = np->vsi->back;
|
|
|
struct i40e_hw *hw = &pf->hw;
|
|
|
|
|
|
- if (!(pf->flags & I40E_FLAG_PORT_ID_VALID))
|
|
|
+ if (!(pf->hw_features & I40E_HW_PORT_ID_VALID))
|
|
|
return -EOPNOTSUPP;
|
|
|
|
|
|
ppid->id_len = min_t(int, sizeof(hw->mac.port_addr), sizeof(ppid->id));
|
|
@@ -9689,7 +9689,7 @@ static int i40e_config_netdev(struct i40e_vsi *vsi)
|
|
|
NETIF_F_RXCSUM |
|
|
|
0;
|
|
|
|
|
|
- if (!(pf->flags & I40E_FLAG_OUTER_UDP_CSUM_CAPABLE))
|
|
|
+ if (!(pf->hw_features & I40E_HW_OUTER_UDP_CSUM_CAPABLE))
|
|
|
netdev->gso_partial_features |= NETIF_F_GSO_UDP_TUNNEL_CSUM;
|
|
|
|
|
|
netdev->gso_partial_features |= NETIF_F_GSO_GRE_CSUM;
|
|
@@ -10447,7 +10447,7 @@ struct i40e_vsi *i40e_vsi_setup(struct i40e_pf *pf, u8 type,
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
- if ((pf->flags & I40E_FLAG_RSS_AQ_CAPABLE) &&
|
|
|
+ if ((pf->hw_features & I40E_HW_RSS_AQ_CAPABLE) &&
|
|
|
(vsi->type == I40E_VSI_VMDQ2)) {
|
|
|
ret = i40e_vsi_config_rss(vsi);
|
|
|
}
|
|
@@ -11456,7 +11456,7 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|
|
* Ignore error return codes because if it was already disabled via
|
|
|
* hardware settings this will fail
|
|
|
*/
|
|
|
- if (pf->flags & I40E_FLAG_STOP_FW_LLDP) {
|
|
|
+ if (pf->hw_features & I40E_HW_STOP_FW_LLDP) {
|
|
|
dev_info(&pdev->dev, "Stopping firmware LLDP agent.\n");
|
|
|
i40e_aq_stop_lldp(hw, true, NULL);
|
|
|
}
|
|
@@ -11473,7 +11473,7 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|
|
ether_addr_copy(hw->mac.perm_addr, hw->mac.addr);
|
|
|
i40e_get_port_mac_addr(hw, hw->mac.port_addr);
|
|
|
if (is_valid_ether_addr(hw->mac.port_addr))
|
|
|
- pf->flags |= I40E_FLAG_PORT_ID_VALID;
|
|
|
+ pf->hw_features |= I40E_HW_PORT_ID_VALID;
|
|
|
|
|
|
pci_set_drvdata(pdev, pf);
|
|
|
pci_save_state(pdev);
|
|
@@ -11589,7 +11589,7 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|
|
wr32(hw, I40E_REG_MSS, val);
|
|
|
}
|
|
|
|
|
|
- if (pf->flags & I40E_FLAG_RESTART_AUTONEG) {
|
|
|
+ if (pf->hw_features & I40E_HW_RESTART_AUTONEG) {
|
|
|
msleep(75);
|
|
|
err = i40e_aq_set_link_restart_an(&pf->hw, true, NULL);
|
|
|
if (err)
|
|
@@ -11676,7 +11676,7 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|
|
* and will report PCI Gen 1 x 1 by default so don't bother
|
|
|
* checking them.
|
|
|
*/
|
|
|
- if (!(pf->flags & I40E_FLAG_NO_PCI_LINK_CHECK)) {
|
|
|
+ if (!(pf->hw_features & I40E_HW_NO_PCI_LINK_CHECK)) {
|
|
|
char speed[PCI_SPEED_SIZE] = "Unknown";
|
|
|
char width[PCI_WIDTH_SIZE] = "Unknown";
|
|
|
|
|
@@ -11747,9 +11747,9 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|
|
|
|
|
if ((pf->hw.device_id == I40E_DEV_ID_10G_BASE_T) ||
|
|
|
(pf->hw.device_id == I40E_DEV_ID_10G_BASE_T4))
|
|
|
- pf->flags |= I40E_FLAG_PHY_CONTROLS_LEDS;
|
|
|
+ pf->hw_features |= I40E_HW_PHY_CONTROLS_LEDS;
|
|
|
if (pf->hw.device_id == I40E_DEV_ID_SFP_I_X722)
|
|
|
- pf->flags |= I40E_FLAG_HAVE_CRT_RETIMER;
|
|
|
+ pf->hw_features |= I40E_HW_HAVE_CRT_RETIMER;
|
|
|
/* print a string summarizing features */
|
|
|
i40e_print_features(pf);
|
|
|
|
|
@@ -12061,7 +12061,7 @@ static void i40e_shutdown(struct pci_dev *pdev)
|
|
|
*/
|
|
|
i40e_notify_client_of_netdev_close(pf->vsi[pf->lan_vsi], false);
|
|
|
|
|
|
- if (pf->wol_en && (pf->flags & I40E_FLAG_WOL_MC_MAGIC_PKT_WAKE))
|
|
|
+ if (pf->wol_en && (pf->hw_features & I40E_HW_WOL_MC_MAGIC_PKT_WAKE))
|
|
|
i40e_enable_mc_magic_wake(pf);
|
|
|
|
|
|
i40e_prep_for_reset(pf, false);
|
|
@@ -12093,7 +12093,7 @@ static int i40e_suspend(struct pci_dev *pdev, pm_message_t state)
|
|
|
set_bit(__I40E_SUSPENDED, pf->state);
|
|
|
set_bit(__I40E_DOWN, pf->state);
|
|
|
|
|
|
- if (pf->wol_en && (pf->flags & I40E_FLAG_WOL_MC_MAGIC_PKT_WAKE))
|
|
|
+ if (pf->wol_en && (pf->hw_features & I40E_HW_WOL_MC_MAGIC_PKT_WAKE))
|
|
|
i40e_enable_mc_magic_wake(pf);
|
|
|
|
|
|
i40e_prep_for_reset(pf, false);
|