mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 10:04:04 +02:00
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/20250909203236.3603960-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
commit
a2ddf8a51c
|
|
@ -1561,6 +1561,7 @@ I40E_CHECK_CMD_LENGTH(i40e_aq_set_phy_config);
|
|||
struct i40e_aq_set_mac_config {
|
||||
__le16 max_frame_size;
|
||||
u8 params;
|
||||
#define I40E_AQ_SET_MAC_CONFIG_CRC_EN BIT(2)
|
||||
u8 tx_timer_priority; /* bitmap */
|
||||
__le16 tx_timer_value;
|
||||
__le16 fc_refresh_threshold;
|
||||
|
|
|
|||
|
|
@ -1189,6 +1189,40 @@ int i40e_set_fc(struct i40e_hw *hw, u8 *aq_failures,
|
|||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* i40e_aq_set_mac_config - Configure MAC settings
|
||||
* @hw: pointer to the hw struct
|
||||
* @max_frame_size: Maximum Frame Size to be supported by the port
|
||||
* @cmd_details: pointer to command details structure or NULL
|
||||
*
|
||||
* Set MAC configuration (0x0603). Note that max_frame_size must be greater
|
||||
* than zero.
|
||||
*
|
||||
* Return: 0 on success, or a negative error code on failure.
|
||||
*/
|
||||
int i40e_aq_set_mac_config(struct i40e_hw *hw, u16 max_frame_size,
|
||||
struct i40e_asq_cmd_details *cmd_details)
|
||||
{
|
||||
struct i40e_aq_set_mac_config *cmd;
|
||||
struct libie_aq_desc desc;
|
||||
|
||||
cmd = libie_aq_raw(&desc);
|
||||
|
||||
if (max_frame_size == 0)
|
||||
return -EINVAL;
|
||||
|
||||
i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_set_mac_config);
|
||||
|
||||
cmd->max_frame_size = cpu_to_le16(max_frame_size);
|
||||
cmd->params = I40E_AQ_SET_MAC_CONFIG_CRC_EN;
|
||||
|
||||
#define I40E_AQ_SET_MAC_CONFIG_FC_DEFAULT_THRESHOLD 0x7FFF
|
||||
cmd->fc_refresh_threshold =
|
||||
cpu_to_le16(I40E_AQ_SET_MAC_CONFIG_FC_DEFAULT_THRESHOLD);
|
||||
|
||||
return i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details);
|
||||
}
|
||||
|
||||
/**
|
||||
* i40e_aq_clear_pxe_mode
|
||||
* @hw: pointer to the hw struct
|
||||
|
|
|
|||
|
|
@ -4156,7 +4156,7 @@ static int i40e_vsi_request_irq_msix(struct i40e_vsi *vsi, char *basename)
|
|||
irq_num = pf->msix_entries[base + vector].vector;
|
||||
irq_set_affinity_notifier(irq_num, NULL);
|
||||
irq_update_affinity_hint(irq_num, NULL);
|
||||
free_irq(irq_num, &vsi->q_vectors[vector]);
|
||||
free_irq(irq_num, vsi->q_vectors[vector]);
|
||||
}
|
||||
return err;
|
||||
}
|
||||
|
|
@ -16045,13 +16045,17 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|||
dev_dbg(&pf->pdev->dev, "get supported phy types ret = %pe last_status = %s\n",
|
||||
ERR_PTR(err), libie_aq_str(pf->hw.aq.asq_last_status));
|
||||
|
||||
/* make sure the MFS hasn't been set lower than the default */
|
||||
#define MAX_FRAME_SIZE_DEFAULT 0x2600
|
||||
val = FIELD_GET(I40E_PRTGL_SAH_MFS_MASK,
|
||||
rd32(&pf->hw, I40E_PRTGL_SAH));
|
||||
if (val < MAX_FRAME_SIZE_DEFAULT)
|
||||
dev_warn(&pdev->dev, "MFS for port %x (%d) has been set below the default (%d)\n",
|
||||
pf->hw.port, val, MAX_FRAME_SIZE_DEFAULT);
|
||||
|
||||
err = i40e_aq_set_mac_config(hw, MAX_FRAME_SIZE_DEFAULT, NULL);
|
||||
if (err)
|
||||
dev_warn(&pdev->dev, "set mac config ret = %pe last_status = %s\n",
|
||||
ERR_PTR(err), libie_aq_str(pf->hw.aq.asq_last_status));
|
||||
|
||||
/* Make sure the MFS is set to the expected value */
|
||||
val = rd32(hw, I40E_PRTGL_SAH);
|
||||
FIELD_MODIFY(I40E_PRTGL_SAH_MFS_MASK, &val, MAX_FRAME_SIZE_DEFAULT);
|
||||
wr32(hw, I40E_PRTGL_SAH, val);
|
||||
|
||||
/* Add a filter to drop all Flow control frames from any VSI from being
|
||||
* transmitted. By doing so we stop a malicious VF from sending out
|
||||
|
|
|
|||
|
|
@ -98,6 +98,8 @@ int i40e_aq_set_mac_loopback(struct i40e_hw *hw,
|
|||
struct i40e_asq_cmd_details *cmd_details);
|
||||
int i40e_aq_set_phy_int_mask(struct i40e_hw *hw, u16 mask,
|
||||
struct i40e_asq_cmd_details *cmd_details);
|
||||
int i40e_aq_set_mac_config(struct i40e_hw *hw, u16 max_frame_size,
|
||||
struct i40e_asq_cmd_details *cmd_details);
|
||||
int i40e_aq_clear_pxe_mode(struct i40e_hw *hw,
|
||||
struct i40e_asq_cmd_details *cmd_details);
|
||||
int i40e_aq_set_link_restart_an(struct i40e_hw *hw,
|
||||
|
|
|
|||
|
|
@ -2081,11 +2081,8 @@ static void igb_diag_test(struct net_device *netdev,
|
|||
} else {
|
||||
dev_info(&adapter->pdev->dev, "online testing starting\n");
|
||||
|
||||
/* PHY is powered down when interface is down */
|
||||
if (if_running && igb_link_test(adapter, &data[TEST_LINK]))
|
||||
if (igb_link_test(adapter, &data[TEST_LINK]))
|
||||
eth_test->flags |= ETH_TEST_FL_FAILED;
|
||||
else
|
||||
data[TEST_LINK] = 0;
|
||||
|
||||
/* Online tests aren't run; pass by default */
|
||||
data[TEST_REG] = 0;
|
||||
|
|
|
|||
|
|
@ -4453,8 +4453,7 @@ int igb_setup_rx_resources(struct igb_ring *rx_ring)
|
|||
if (xdp_rxq_info_is_reg(&rx_ring->xdp_rxq))
|
||||
xdp_rxq_info_unreg(&rx_ring->xdp_rxq);
|
||||
res = xdp_rxq_info_reg(&rx_ring->xdp_rxq, rx_ring->netdev,
|
||||
rx_ring->queue_index,
|
||||
rx_ring->q_vector->napi.napi_id);
|
||||
rx_ring->queue_index, 0);
|
||||
if (res < 0) {
|
||||
dev_err(dev, "Failed to register xdp_rxq index %u\n",
|
||||
rx_ring->queue_index);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user