Skip to content

Commit e4d4a27

Browse files
committed
Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue
Nguyen, Anthony L says: ==================== Intel Wired LAN Driver Updates 2021-05-07 This series contains updates to i40e driver only. Magnus fixes XDP by adding and correcting checks that were caused by a previous commit which introduced a new variable but did not account for it in all paths. Yunjian Wang adds a return in an error path to prevent reading a freed pointer. Jaroslaw forces link reset when changing FEC so that changes take affect. Mateusz fixes PHY types for 2.5G and 5G as there is a differentiation on PHY identifiers based on operation. Arkadiusz removes filtering of LLDP frames for software DCB as this is preventing them from being properly transmitted. * '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: i40e: Remove LLDP frame filters i40e: Fix PHY type identifiers for 2.5G and 5G adapters i40e: fix the restart auto-negotiation after FEC modified i40e: Fix use-after-free in i40e_client_subtask() i40e: fix broken XDP support ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 7d18dbd + 8085a36 commit e4d4a27

File tree

8 files changed

+15
-62
lines changed

8 files changed

+15
-62
lines changed

drivers/net/ethernet/intel/i40e/i40e.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1144,7 +1144,6 @@ static inline bool i40e_is_sw_dcb(struct i40e_pf *pf)
11441144
return !!(pf->flags & I40E_FLAG_DISABLE_FW_LLDP);
11451145
}
11461146

1147-
void i40e_set_lldp_forwarding(struct i40e_pf *pf, bool enable);
11481147
#ifdef CONFIG_I40E_DCB
11491148
void i40e_dcbnl_flush_apps(struct i40e_pf *pf,
11501149
struct i40e_dcbx_config *old_cfg,

drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1566,8 +1566,10 @@ enum i40e_aq_phy_type {
15661566
I40E_PHY_TYPE_25GBASE_LR = 0x22,
15671567
I40E_PHY_TYPE_25GBASE_AOC = 0x23,
15681568
I40E_PHY_TYPE_25GBASE_ACC = 0x24,
1569-
I40E_PHY_TYPE_2_5GBASE_T = 0x30,
1570-
I40E_PHY_TYPE_5GBASE_T = 0x31,
1569+
I40E_PHY_TYPE_2_5GBASE_T = 0x26,
1570+
I40E_PHY_TYPE_5GBASE_T = 0x27,
1571+
I40E_PHY_TYPE_2_5GBASE_T_LINK_STATUS = 0x30,
1572+
I40E_PHY_TYPE_5GBASE_T_LINK_STATUS = 0x31,
15711573
I40E_PHY_TYPE_MAX,
15721574
I40E_PHY_TYPE_NOT_SUPPORTED_HIGH_TEMP = 0xFD,
15731575
I40E_PHY_TYPE_EMPTY = 0xFE,

drivers/net/ethernet/intel/i40e/i40e_client.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,7 @@ void i40e_client_subtask(struct i40e_pf *pf)
375375
clear_bit(__I40E_CLIENT_INSTANCE_OPENED,
376376
&cdev->state);
377377
i40e_client_del_instance(pf);
378+
return;
378379
}
379380
}
380381
}

drivers/net/ethernet/intel/i40e/i40e_common.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,8 +1154,8 @@ static enum i40e_media_type i40e_get_media_type(struct i40e_hw *hw)
11541154
break;
11551155
case I40E_PHY_TYPE_100BASE_TX:
11561156
case I40E_PHY_TYPE_1000BASE_T:
1157-
case I40E_PHY_TYPE_2_5GBASE_T:
1158-
case I40E_PHY_TYPE_5GBASE_T:
1157+
case I40E_PHY_TYPE_2_5GBASE_T_LINK_STATUS:
1158+
case I40E_PHY_TYPE_5GBASE_T_LINK_STATUS:
11591159
case I40E_PHY_TYPE_10GBASE_T:
11601160
media = I40E_MEDIA_TYPE_BASET;
11611161
break;

drivers/net/ethernet/intel/i40e/i40e_ethtool.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -841,8 +841,8 @@ static void i40e_get_settings_link_up(struct i40e_hw *hw,
841841
10000baseT_Full);
842842
break;
843843
case I40E_PHY_TYPE_10GBASE_T:
844-
case I40E_PHY_TYPE_5GBASE_T:
845-
case I40E_PHY_TYPE_2_5GBASE_T:
844+
case I40E_PHY_TYPE_5GBASE_T_LINK_STATUS:
845+
case I40E_PHY_TYPE_2_5GBASE_T_LINK_STATUS:
846846
case I40E_PHY_TYPE_1000BASE_T:
847847
case I40E_PHY_TYPE_100BASE_TX:
848848
ethtool_link_ksettings_add_link_mode(ks, supported, Autoneg);
@@ -1409,7 +1409,8 @@ static int i40e_set_fec_cfg(struct net_device *netdev, u8 fec_cfg)
14091409

14101410
memset(&config, 0, sizeof(config));
14111411
config.phy_type = abilities.phy_type;
1412-
config.abilities = abilities.abilities;
1412+
config.abilities = abilities.abilities |
1413+
I40E_AQ_PHY_ENABLE_ATOMIC_LINK;
14131414
config.phy_type_ext = abilities.phy_type_ext;
14141415
config.link_speed = abilities.link_speed;
14151416
config.eee_capability = abilities.eee_capability;
@@ -5281,7 +5282,6 @@ static int i40e_set_priv_flags(struct net_device *dev, u32 flags)
52815282
i40e_aq_cfg_lldp_mib_change_event(&pf->hw, false, NULL);
52825283
i40e_aq_stop_lldp(&pf->hw, true, false, NULL);
52835284
} else {
5284-
i40e_set_lldp_forwarding(pf, false);
52855285
status = i40e_aq_start_lldp(&pf->hw, false, NULL);
52865286
if (status) {
52875287
adq_err = pf->hw.aq.asq_last_status;

drivers/net/ethernet/intel/i40e/i40e_main.c

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -6879,40 +6879,6 @@ static int i40e_init_pf_dcb(struct i40e_pf *pf)
68796879
}
68806880
#endif /* CONFIG_I40E_DCB */
68816881

6882-
/**
6883-
* i40e_set_lldp_forwarding - set forwarding of lldp frames
6884-
* @pf: PF being configured
6885-
* @enable: if forwarding to OS shall be enabled
6886-
*
6887-
* Toggle forwarding of lldp frames behavior,
6888-
* When passing DCB control from firmware to software
6889-
* lldp frames must be forwarded to the software based
6890-
* lldp agent.
6891-
*/
6892-
void i40e_set_lldp_forwarding(struct i40e_pf *pf, bool enable)
6893-
{
6894-
if (pf->lan_vsi == I40E_NO_VSI)
6895-
return;
6896-
6897-
if (!pf->vsi[pf->lan_vsi])
6898-
return;
6899-
6900-
/* No need to check the outcome, commands may fail
6901-
* if desired value is already set
6902-
*/
6903-
i40e_aq_add_rem_control_packet_filter(&pf->hw, NULL, ETH_P_LLDP,
6904-
I40E_AQC_ADD_CONTROL_PACKET_FLAGS_TX |
6905-
I40E_AQC_ADD_CONTROL_PACKET_FLAGS_IGNORE_MAC,
6906-
pf->vsi[pf->lan_vsi]->seid, 0,
6907-
enable, NULL, NULL);
6908-
6909-
i40e_aq_add_rem_control_packet_filter(&pf->hw, NULL, ETH_P_LLDP,
6910-
I40E_AQC_ADD_CONTROL_PACKET_FLAGS_RX |
6911-
I40E_AQC_ADD_CONTROL_PACKET_FLAGS_IGNORE_MAC,
6912-
pf->vsi[pf->lan_vsi]->seid, 0,
6913-
enable, NULL, NULL);
6914-
}
6915-
69166882
/**
69176883
* i40e_print_link_message - print link up or down
69186884
* @vsi: the VSI for which link needs a message
@@ -10736,10 +10702,6 @@ static void i40e_rebuild(struct i40e_pf *pf, bool reinit, bool lock_acquired)
1073610702
*/
1073710703
i40e_add_filter_to_drop_tx_flow_control_frames(&pf->hw,
1073810704
pf->main_vsi_seid);
10739-
#ifdef CONFIG_I40E_DCB
10740-
if (pf->flags & I40E_FLAG_DISABLE_FW_LLDP)
10741-
i40e_set_lldp_forwarding(pf, true);
10742-
#endif /* CONFIG_I40E_DCB */
1074310705

1074410706
/* restart the VSIs that were rebuilt and running before the reset */
1074510707
i40e_pf_unquiesce_all_vsi(pf);
@@ -15772,10 +15734,6 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1577215734
*/
1577315735
i40e_add_filter_to_drop_tx_flow_control_frames(&pf->hw,
1577415736
pf->main_vsi_seid);
15775-
#ifdef CONFIG_I40E_DCB
15776-
if (pf->flags & I40E_FLAG_DISABLE_FW_LLDP)
15777-
i40e_set_lldp_forwarding(pf, true);
15778-
#endif /* CONFIG_I40E_DCB */
1577915737

1578015738
if ((pf->hw.device_id == I40E_DEV_ID_10G_BASE_T) ||
1578115739
(pf->hw.device_id == I40E_DEV_ID_10G_BASE_T4))

drivers/net/ethernet/intel/i40e/i40e_txrx.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1961,10 +1961,6 @@ static bool i40e_cleanup_headers(struct i40e_ring *rx_ring, struct sk_buff *skb,
19611961
union i40e_rx_desc *rx_desc)
19621962

19631963
{
1964-
/* XDP packets use error pointer so abort at this point */
1965-
if (IS_ERR(skb))
1966-
return true;
1967-
19681964
/* ERR_MASK will only have valid bits if EOP set, and
19691965
* what we are doing here is actually checking
19701966
* I40E_RX_DESC_ERROR_RXE_SHIFT, since it is the zeroth bit in
@@ -2534,7 +2530,7 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget)
25342530
}
25352531

25362532
/* exit if we failed to retrieve a buffer */
2537-
if (!skb) {
2533+
if (!xdp_res && !skb) {
25382534
rx_ring->rx_stats.alloc_buff_failed++;
25392535
rx_buffer->pagecnt_bias++;
25402536
break;
@@ -2547,7 +2543,7 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget)
25472543
if (i40e_is_non_eop(rx_ring, rx_desc))
25482544
continue;
25492545

2550-
if (i40e_cleanup_headers(rx_ring, skb, rx_desc)) {
2546+
if (xdp_res || i40e_cleanup_headers(rx_ring, skb, rx_desc)) {
25512547
skb = NULL;
25522548
continue;
25532549
}

drivers/net/ethernet/intel/i40e/i40e_type.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -239,11 +239,8 @@ struct i40e_phy_info {
239239
#define I40E_CAP_PHY_TYPE_25GBASE_ACC BIT_ULL(I40E_PHY_TYPE_25GBASE_ACC + \
240240
I40E_PHY_TYPE_OFFSET)
241241
/* Offset for 2.5G/5G PHY Types value to bit number conversion */
242-
#define I40E_PHY_TYPE_OFFSET2 (-10)
243-
#define I40E_CAP_PHY_TYPE_2_5GBASE_T BIT_ULL(I40E_PHY_TYPE_2_5GBASE_T + \
244-
I40E_PHY_TYPE_OFFSET2)
245-
#define I40E_CAP_PHY_TYPE_5GBASE_T BIT_ULL(I40E_PHY_TYPE_5GBASE_T + \
246-
I40E_PHY_TYPE_OFFSET2)
242+
#define I40E_CAP_PHY_TYPE_2_5GBASE_T BIT_ULL(I40E_PHY_TYPE_2_5GBASE_T)
243+
#define I40E_CAP_PHY_TYPE_5GBASE_T BIT_ULL(I40E_PHY_TYPE_5GBASE_T)
247244
#define I40E_HW_CAP_MAX_GPIO 30
248245
/* Capabilities of a PF or a VF or the whole device */
249246
struct i40e_hw_capabilities {

0 commit comments

Comments
 (0)