Skip to content

Commit a2ddf8a

Browse files
committed
Merge branch '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue
Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2025-09-09 (igb, i40e) For igb: Tianyu Xu removes passing of, no longer needed, NAPI id to avoid NULL pointer dereference on ethtool loopback testing. Kohei Enju corrects reporting/testing of link state when interface is down. For i40e: Michal Schmidt corrects value being passed to free_irq(). Jake sets hardware maximum frame size on probe to ensure expected/consistent state. * '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: i40e: fix Jumbo Frame support after iPXE boot i40e: fix IRQ freeing in i40e_vsi_request_irq_msix error path igb: fix link test skipping when interface is admin down igb: Fix NULL pointer dereference in ethtool loopback test ==================== Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 5537a46 + 503f1c7 commit a2ddf8a

File tree

6 files changed

+50
-13
lines changed

6 files changed

+50
-13
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1561,6 +1561,7 @@ I40E_CHECK_CMD_LENGTH(i40e_aq_set_phy_config);
15611561
struct i40e_aq_set_mac_config {
15621562
__le16 max_frame_size;
15631563
u8 params;
1564+
#define I40E_AQ_SET_MAC_CONFIG_CRC_EN BIT(2)
15641565
u8 tx_timer_priority; /* bitmap */
15651566
__le16 tx_timer_value;
15661567
__le16 fc_refresh_threshold;

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

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,6 +1189,40 @@ int i40e_set_fc(struct i40e_hw *hw, u8 *aq_failures,
11891189
return status;
11901190
}
11911191

1192+
/**
1193+
* i40e_aq_set_mac_config - Configure MAC settings
1194+
* @hw: pointer to the hw struct
1195+
* @max_frame_size: Maximum Frame Size to be supported by the port
1196+
* @cmd_details: pointer to command details structure or NULL
1197+
*
1198+
* Set MAC configuration (0x0603). Note that max_frame_size must be greater
1199+
* than zero.
1200+
*
1201+
* Return: 0 on success, or a negative error code on failure.
1202+
*/
1203+
int i40e_aq_set_mac_config(struct i40e_hw *hw, u16 max_frame_size,
1204+
struct i40e_asq_cmd_details *cmd_details)
1205+
{
1206+
struct i40e_aq_set_mac_config *cmd;
1207+
struct libie_aq_desc desc;
1208+
1209+
cmd = libie_aq_raw(&desc);
1210+
1211+
if (max_frame_size == 0)
1212+
return -EINVAL;
1213+
1214+
i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_set_mac_config);
1215+
1216+
cmd->max_frame_size = cpu_to_le16(max_frame_size);
1217+
cmd->params = I40E_AQ_SET_MAC_CONFIG_CRC_EN;
1218+
1219+
#define I40E_AQ_SET_MAC_CONFIG_FC_DEFAULT_THRESHOLD 0x7FFF
1220+
cmd->fc_refresh_threshold =
1221+
cpu_to_le16(I40E_AQ_SET_MAC_CONFIG_FC_DEFAULT_THRESHOLD);
1222+
1223+
return i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details);
1224+
}
1225+
11921226
/**
11931227
* i40e_aq_clear_pxe_mode
11941228
* @hw: pointer to the hw struct

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

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4156,7 +4156,7 @@ static int i40e_vsi_request_irq_msix(struct i40e_vsi *vsi, char *basename)
41564156
irq_num = pf->msix_entries[base + vector].vector;
41574157
irq_set_affinity_notifier(irq_num, NULL);
41584158
irq_update_affinity_hint(irq_num, NULL);
4159-
free_irq(irq_num, &vsi->q_vectors[vector]);
4159+
free_irq(irq_num, vsi->q_vectors[vector]);
41604160
}
41614161
return err;
41624162
}
@@ -16045,13 +16045,17 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1604516045
dev_dbg(&pf->pdev->dev, "get supported phy types ret = %pe last_status = %s\n",
1604616046
ERR_PTR(err), libie_aq_str(pf->hw.aq.asq_last_status));
1604716047

16048-
/* make sure the MFS hasn't been set lower than the default */
1604916048
#define MAX_FRAME_SIZE_DEFAULT 0x2600
16050-
val = FIELD_GET(I40E_PRTGL_SAH_MFS_MASK,
16051-
rd32(&pf->hw, I40E_PRTGL_SAH));
16052-
if (val < MAX_FRAME_SIZE_DEFAULT)
16053-
dev_warn(&pdev->dev, "MFS for port %x (%d) has been set below the default (%d)\n",
16054-
pf->hw.port, val, MAX_FRAME_SIZE_DEFAULT);
16049+
16050+
err = i40e_aq_set_mac_config(hw, MAX_FRAME_SIZE_DEFAULT, NULL);
16051+
if (err)
16052+
dev_warn(&pdev->dev, "set mac config ret = %pe last_status = %s\n",
16053+
ERR_PTR(err), libie_aq_str(pf->hw.aq.asq_last_status));
16054+
16055+
/* Make sure the MFS is set to the expected value */
16056+
val = rd32(hw, I40E_PRTGL_SAH);
16057+
FIELD_MODIFY(I40E_PRTGL_SAH_MFS_MASK, &val, MAX_FRAME_SIZE_DEFAULT);
16058+
wr32(hw, I40E_PRTGL_SAH, val);
1605516059

1605616060
/* Add a filter to drop all Flow control frames from any VSI from being
1605716061
* transmitted. By doing so we stop a malicious VF from sending out

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ int i40e_aq_set_mac_loopback(struct i40e_hw *hw,
9898
struct i40e_asq_cmd_details *cmd_details);
9999
int i40e_aq_set_phy_int_mask(struct i40e_hw *hw, u16 mask,
100100
struct i40e_asq_cmd_details *cmd_details);
101+
int i40e_aq_set_mac_config(struct i40e_hw *hw, u16 max_frame_size,
102+
struct i40e_asq_cmd_details *cmd_details);
101103
int i40e_aq_clear_pxe_mode(struct i40e_hw *hw,
102104
struct i40e_asq_cmd_details *cmd_details);
103105
int i40e_aq_set_link_restart_an(struct i40e_hw *hw,

drivers/net/ethernet/intel/igb/igb_ethtool.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2081,11 +2081,8 @@ static void igb_diag_test(struct net_device *netdev,
20812081
} else {
20822082
dev_info(&adapter->pdev->dev, "online testing starting\n");
20832083

2084-
/* PHY is powered down when interface is down */
2085-
if (if_running && igb_link_test(adapter, &data[TEST_LINK]))
2084+
if (igb_link_test(adapter, &data[TEST_LINK]))
20862085
eth_test->flags |= ETH_TEST_FL_FAILED;
2087-
else
2088-
data[TEST_LINK] = 0;
20892086

20902087
/* Online tests aren't run; pass by default */
20912088
data[TEST_REG] = 0;

drivers/net/ethernet/intel/igb/igb_main.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4453,8 +4453,7 @@ int igb_setup_rx_resources(struct igb_ring *rx_ring)
44534453
if (xdp_rxq_info_is_reg(&rx_ring->xdp_rxq))
44544454
xdp_rxq_info_unreg(&rx_ring->xdp_rxq);
44554455
res = xdp_rxq_info_reg(&rx_ring->xdp_rxq, rx_ring->netdev,
4456-
rx_ring->queue_index,
4457-
rx_ring->q_vector->napi.napi_id);
4456+
rx_ring->queue_index, 0);
44584457
if (res < 0) {
44594458
dev_err(dev, "Failed to register xdp_rxq index %u\n",
44604459
rx_ring->queue_index);

0 commit comments

Comments
 (0)