mirror of
https://github.com/torvalds/linux.git
synced 2026-05-31 10:33:41 +02:00
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>
This commit is contained in:
commit
352df98b7b
|
|
@ -4094,7 +4094,15 @@ static bool e1000_tbi_should_accept(struct e1000_adapter *adapter,
|
|||
u32 length, const u8 *data)
|
||||
{
|
||||
struct e1000_hw *hw = &adapter->hw;
|
||||
u8 last_byte = *(data + length - 1);
|
||||
u8 last_byte;
|
||||
|
||||
/* Guard against OOB on data[length - 1] */
|
||||
if (unlikely(!length))
|
||||
return false;
|
||||
/* Upper bound: length must not exceed rx_buffer_len */
|
||||
if (unlikely(length > adapter->rx_buffer_len))
|
||||
return false;
|
||||
last_byte = *(data + length - 1);
|
||||
|
||||
if (TBI_ACCEPT(hw, status, errors, length, last_byte)) {
|
||||
unsigned long irq_flags;
|
||||
|
|
|
|||
|
|
@ -1422,4 +1422,15 @@ static inline struct i40e_veb *i40e_pf_get_main_veb(struct i40e_pf *pf)
|
|||
return (pf->lan_veb != I40E_NO_VEB) ? pf->veb[pf->lan_veb] : NULL;
|
||||
}
|
||||
|
||||
static inline u32 i40e_get_max_num_descriptors(const struct i40e_pf *pf)
|
||||
{
|
||||
const struct i40e_hw *hw = &pf->hw;
|
||||
|
||||
switch (hw->mac.type) {
|
||||
case I40E_MAC_XL710:
|
||||
return I40E_MAX_NUM_DESCRIPTORS_XL710;
|
||||
default:
|
||||
return I40E_MAX_NUM_DESCRIPTORS;
|
||||
}
|
||||
}
|
||||
#endif /* _I40E_H_ */
|
||||
|
|
|
|||
|
|
@ -2013,18 +2013,6 @@ static void i40e_get_drvinfo(struct net_device *netdev,
|
|||
drvinfo->n_priv_flags += I40E_GL_PRIV_FLAGS_STR_LEN;
|
||||
}
|
||||
|
||||
static u32 i40e_get_max_num_descriptors(struct i40e_pf *pf)
|
||||
{
|
||||
struct i40e_hw *hw = &pf->hw;
|
||||
|
||||
switch (hw->mac.type) {
|
||||
case I40E_MAC_XL710:
|
||||
return I40E_MAX_NUM_DESCRIPTORS_XL710;
|
||||
default:
|
||||
return I40E_MAX_NUM_DESCRIPTORS;
|
||||
}
|
||||
}
|
||||
|
||||
static void i40e_get_ringparam(struct net_device *netdev,
|
||||
struct ethtool_ringparam *ring,
|
||||
struct kernel_ethtool_ringparam *kernel_ring,
|
||||
|
|
|
|||
|
|
@ -2234,6 +2234,7 @@ static void i40e_set_rx_mode(struct net_device *netdev)
|
|||
vsi->flags |= I40E_VSI_FLAG_FILTER_CHANGED;
|
||||
set_bit(__I40E_MACVLAN_SYNC_PENDING, vsi->back->state);
|
||||
}
|
||||
i40e_service_event_schedule(vsi->back);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -656,7 +656,7 @@ static int i40e_config_vsi_tx_queue(struct i40e_vf *vf, u16 vsi_id,
|
|||
|
||||
/* ring_len has to be multiple of 8 */
|
||||
if (!IS_ALIGNED(info->ring_len, 8) ||
|
||||
info->ring_len > I40E_MAX_NUM_DESCRIPTORS_XL710) {
|
||||
info->ring_len > i40e_get_max_num_descriptors(pf)) {
|
||||
ret = -EINVAL;
|
||||
goto error_context;
|
||||
}
|
||||
|
|
@ -726,7 +726,7 @@ static int i40e_config_vsi_rx_queue(struct i40e_vf *vf, u16 vsi_id,
|
|||
|
||||
/* ring_len has to be multiple of 32 */
|
||||
if (!IS_ALIGNED(info->ring_len, 32) ||
|
||||
info->ring_len > I40E_MAX_NUM_DESCRIPTORS_XL710) {
|
||||
info->ring_len > i40e_get_max_num_descriptors(pf)) {
|
||||
ret = -EINVAL;
|
||||
goto error_param;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1726,11 +1726,11 @@ static int iavf_config_rss_reg(struct iavf_adapter *adapter)
|
|||
u16 i;
|
||||
|
||||
dw = (u32 *)adapter->rss_key;
|
||||
for (i = 0; i <= adapter->rss_key_size / 4; i++)
|
||||
for (i = 0; i < adapter->rss_key_size / 4; i++)
|
||||
wr32(hw, IAVF_VFQF_HKEY(i), dw[i]);
|
||||
|
||||
dw = (u32 *)adapter->rss_lut;
|
||||
for (i = 0; i <= adapter->rss_lut_size / 4; i++)
|
||||
for (i = 0; i < adapter->rss_lut_size / 4; i++)
|
||||
wr32(hw, IAVF_VFQF_HLUT(i), dw[i]);
|
||||
|
||||
iavf_flush(hw);
|
||||
|
|
|
|||
|
|
@ -1271,7 +1271,7 @@ void idpf_mbx_task(struct work_struct *work)
|
|||
idpf_mb_irq_enable(adapter);
|
||||
else
|
||||
queue_delayed_work(adapter->mbx_wq, &adapter->mbx_task,
|
||||
msecs_to_jiffies(300));
|
||||
usecs_to_jiffies(300));
|
||||
|
||||
idpf_recv_mb_msg(adapter);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1016,6 +1016,9 @@ static int idpf_send_get_lan_memory_regions(struct idpf_adapter *adapter)
|
|||
struct idpf_vc_xn_params xn_params = {
|
||||
.vc_op = VIRTCHNL2_OP_GET_LAN_MEMORY_REGIONS,
|
||||
.recv_buf.iov_len = IDPF_CTLQ_MAX_BUF_LEN,
|
||||
.send_buf.iov_len =
|
||||
sizeof(struct virtchnl2_get_lan_memory_regions) +
|
||||
sizeof(struct virtchnl2_mem_region),
|
||||
.timeout_ms = IDPF_VC_XN_DEFAULT_TIMEOUT_MSEC,
|
||||
};
|
||||
int num_regions, size;
|
||||
|
|
@ -1028,6 +1031,8 @@ static int idpf_send_get_lan_memory_regions(struct idpf_adapter *adapter)
|
|||
return -ENOMEM;
|
||||
|
||||
xn_params.recv_buf.iov_base = rcvd_regions;
|
||||
rcvd_regions->num_memory_regions = cpu_to_le16(1);
|
||||
xn_params.send_buf.iov_base = rcvd_regions;
|
||||
reply_sz = idpf_vc_xn_exec(adapter, &xn_params);
|
||||
if (reply_sz < 0)
|
||||
return reply_sz;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user