Skip to content

Commit 352df98

Browse files
author
Paolo Abeni
committed
Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue
Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2025-12-17 (i40e, iavf, idpf, e1000) For i40e: Przemyslaw immediately schedules service task following changes to filters to ensure timely setup for PTP. Gregory Herrero adjusts VF descriptor size checks to be device specific. For iavf: Kohei Enju corrects a couple of condition checks which caused off-by-one issues. For idpf: Larysa fixes LAN memory region call to follow expected requirements. Brian Vazquez reduces mailbox wait time during init to avoid lengthy delays. For e1000: Guangshuo Li adds validation of data length to prevent out-of-bounds access. * '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: e1000: fix OOB in e1000_tbi_should_accept() idpf: reduce mbx_task schedule delay to 300us idpf: fix LAN memory regions command on some NVMs iavf: fix off-by-one issues in iavf_config_rss_reg() i40e: validate ring_len parameter against hardware-specific values i40e: fix scheduling in set_rx_mode ==================== Link: https://patch.msgid.link/ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2 parents d5dc283 + 9c72a51 commit 352df98

8 files changed

Lines changed: 31 additions & 18 deletions

File tree

drivers/net/ethernet/intel/e1000/e1000_main.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4094,7 +4094,15 @@ static bool e1000_tbi_should_accept(struct e1000_adapter *adapter,
40944094
u32 length, const u8 *data)
40954095
{
40964096
struct e1000_hw *hw = &adapter->hw;
4097-
u8 last_byte = *(data + length - 1);
4097+
u8 last_byte;
4098+
4099+
/* Guard against OOB on data[length - 1] */
4100+
if (unlikely(!length))
4101+
return false;
4102+
/* Upper bound: length must not exceed rx_buffer_len */
4103+
if (unlikely(length > adapter->rx_buffer_len))
4104+
return false;
4105+
last_byte = *(data + length - 1);
40984106

40994107
if (TBI_ACCEPT(hw, status, errors, length, last_byte)) {
41004108
unsigned long irq_flags;

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1422,4 +1422,15 @@ static inline struct i40e_veb *i40e_pf_get_main_veb(struct i40e_pf *pf)
14221422
return (pf->lan_veb != I40E_NO_VEB) ? pf->veb[pf->lan_veb] : NULL;
14231423
}
14241424

1425+
static inline u32 i40e_get_max_num_descriptors(const struct i40e_pf *pf)
1426+
{
1427+
const struct i40e_hw *hw = &pf->hw;
1428+
1429+
switch (hw->mac.type) {
1430+
case I40E_MAC_XL710:
1431+
return I40E_MAX_NUM_DESCRIPTORS_XL710;
1432+
default:
1433+
return I40E_MAX_NUM_DESCRIPTORS;
1434+
}
1435+
}
14251436
#endif /* _I40E_H_ */

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

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2013,18 +2013,6 @@ static void i40e_get_drvinfo(struct net_device *netdev,
20132013
drvinfo->n_priv_flags += I40E_GL_PRIV_FLAGS_STR_LEN;
20142014
}
20152015

2016-
static u32 i40e_get_max_num_descriptors(struct i40e_pf *pf)
2017-
{
2018-
struct i40e_hw *hw = &pf->hw;
2019-
2020-
switch (hw->mac.type) {
2021-
case I40E_MAC_XL710:
2022-
return I40E_MAX_NUM_DESCRIPTORS_XL710;
2023-
default:
2024-
return I40E_MAX_NUM_DESCRIPTORS;
2025-
}
2026-
}
2027-
20282016
static void i40e_get_ringparam(struct net_device *netdev,
20292017
struct ethtool_ringparam *ring,
20302018
struct kernel_ethtool_ringparam *kernel_ring,

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2234,6 +2234,7 @@ static void i40e_set_rx_mode(struct net_device *netdev)
22342234
vsi->flags |= I40E_VSI_FLAG_FILTER_CHANGED;
22352235
set_bit(__I40E_MACVLAN_SYNC_PENDING, vsi->back->state);
22362236
}
2237+
i40e_service_event_schedule(vsi->back);
22372238
}
22382239

22392240
/**

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ static int i40e_config_vsi_tx_queue(struct i40e_vf *vf, u16 vsi_id,
656656

657657
/* ring_len has to be multiple of 8 */
658658
if (!IS_ALIGNED(info->ring_len, 8) ||
659-
info->ring_len > I40E_MAX_NUM_DESCRIPTORS_XL710) {
659+
info->ring_len > i40e_get_max_num_descriptors(pf)) {
660660
ret = -EINVAL;
661661
goto error_context;
662662
}
@@ -726,7 +726,7 @@ static int i40e_config_vsi_rx_queue(struct i40e_vf *vf, u16 vsi_id,
726726

727727
/* ring_len has to be multiple of 32 */
728728
if (!IS_ALIGNED(info->ring_len, 32) ||
729-
info->ring_len > I40E_MAX_NUM_DESCRIPTORS_XL710) {
729+
info->ring_len > i40e_get_max_num_descriptors(pf)) {
730730
ret = -EINVAL;
731731
goto error_param;
732732
}

drivers/net/ethernet/intel/iavf/iavf_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1726,11 +1726,11 @@ static int iavf_config_rss_reg(struct iavf_adapter *adapter)
17261726
u16 i;
17271727

17281728
dw = (u32 *)adapter->rss_key;
1729-
for (i = 0; i <= adapter->rss_key_size / 4; i++)
1729+
for (i = 0; i < adapter->rss_key_size / 4; i++)
17301730
wr32(hw, IAVF_VFQF_HKEY(i), dw[i]);
17311731

17321732
dw = (u32 *)adapter->rss_lut;
1733-
for (i = 0; i <= adapter->rss_lut_size / 4; i++)
1733+
for (i = 0; i < adapter->rss_lut_size / 4; i++)
17341734
wr32(hw, IAVF_VFQF_HLUT(i), dw[i]);
17351735

17361736
iavf_flush(hw);

drivers/net/ethernet/intel/idpf/idpf_lib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1271,7 +1271,7 @@ void idpf_mbx_task(struct work_struct *work)
12711271
idpf_mb_irq_enable(adapter);
12721272
else
12731273
queue_delayed_work(adapter->mbx_wq, &adapter->mbx_task,
1274-
msecs_to_jiffies(300));
1274+
usecs_to_jiffies(300));
12751275

12761276
idpf_recv_mb_msg(adapter);
12771277
}

drivers/net/ethernet/intel/idpf/idpf_virtchnl.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,6 +1016,9 @@ static int idpf_send_get_lan_memory_regions(struct idpf_adapter *adapter)
10161016
struct idpf_vc_xn_params xn_params = {
10171017
.vc_op = VIRTCHNL2_OP_GET_LAN_MEMORY_REGIONS,
10181018
.recv_buf.iov_len = IDPF_CTLQ_MAX_BUF_LEN,
1019+
.send_buf.iov_len =
1020+
sizeof(struct virtchnl2_get_lan_memory_regions) +
1021+
sizeof(struct virtchnl2_mem_region),
10191022
.timeout_ms = IDPF_VC_XN_DEFAULT_TIMEOUT_MSEC,
10201023
};
10211024
int num_regions, size;
@@ -1028,6 +1031,8 @@ static int idpf_send_get_lan_memory_regions(struct idpf_adapter *adapter)
10281031
return -ENOMEM;
10291032

10301033
xn_params.recv_buf.iov_base = rcvd_regions;
1034+
rcvd_regions->num_memory_regions = cpu_to_le16(1);
1035+
xn_params.send_buf.iov_base = rcvd_regions;
10311036
reply_sz = idpf_vc_xn_exec(adapter, &xn_params);
10321037
if (reply_sz < 0)
10331038
return reply_sz;

0 commit comments

Comments
 (0)