mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 10:09:10 +02:00
Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue
Tony Nguyen says: ==================== Intel Wired LAN Driver Updates 2026-03-10 (ice, iavf, i40e, e1000e, e1000) Nikolay Aleksandrov changes return code of RDMA related ice devlink get parameters when irdma is not enabled to -EOPNOTSUPP as current return of -ENODEV causes issues with devlink output. Petr Oros resolves a couple of issues in iavf; freeing PTP resources before reset and disable. Fixing contention issues with the netdev lock between reset and some ethtool operations. Alok Tiwari corrects an incorrect comparison of cloud filter values and adjust some passed arguments to sizeof() for consistency on i40e. Matt Vollrath removes an incorrect decrement for DMA error on e1000 and e1000e drivers. * '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue: e1000/e1000e: Fix leak in DMA error cleanup i40e: fix src IP mask checks and memcpy argument names in cloud filter iavf: fix incorrect reset handling in callbacks iavf: fix PTP use-after-free during reset drivers: net: ice: fix devlink parameters get without irdma ==================== Link: https://patch.msgid.link/20260310205654.4109072-1-anthony.l.nguyen@intel.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
commit
14ad51036c
|
|
@ -2952,8 +2952,6 @@ static int e1000_tx_map(struct e1000_adapter *adapter,
|
|||
dma_error:
|
||||
dev_err(&pdev->dev, "TX DMA map failed\n");
|
||||
buffer_info->dma = 0;
|
||||
if (count)
|
||||
count--;
|
||||
|
||||
while (count--) {
|
||||
if (i == 0)
|
||||
|
|
|
|||
|
|
@ -5652,8 +5652,6 @@ static int e1000_tx_map(struct e1000_ring *tx_ring, struct sk_buff *skb,
|
|||
dma_error:
|
||||
dev_err(&pdev->dev, "Tx DMA map failed\n");
|
||||
buffer_info->dma = 0;
|
||||
if (count)
|
||||
count--;
|
||||
|
||||
while (count--) {
|
||||
if (i == 0)
|
||||
|
|
|
|||
|
|
@ -3833,10 +3833,10 @@ static int i40e_vc_del_cloud_filter(struct i40e_vf *vf, u8 *msg)
|
|||
cfilter.n_proto = ETH_P_IP;
|
||||
if (mask.dst_ip[0] & tcf.dst_ip[0])
|
||||
memcpy(&cfilter.ip.v4.dst_ip, tcf.dst_ip,
|
||||
ARRAY_SIZE(tcf.dst_ip));
|
||||
else if (mask.src_ip[0] & tcf.dst_ip[0])
|
||||
sizeof(cfilter.ip.v4.dst_ip));
|
||||
else if (mask.src_ip[0] & tcf.src_ip[0])
|
||||
memcpy(&cfilter.ip.v4.src_ip, tcf.src_ip,
|
||||
ARRAY_SIZE(tcf.dst_ip));
|
||||
sizeof(cfilter.ip.v4.src_ip));
|
||||
break;
|
||||
case VIRTCHNL_TCP_V6_FLOW:
|
||||
cfilter.n_proto = ETH_P_IPV6;
|
||||
|
|
@ -3891,7 +3891,7 @@ static int i40e_vc_del_cloud_filter(struct i40e_vf *vf, u8 *msg)
|
|||
/* for ipv6, mask is set for all sixteen bytes (4 words) */
|
||||
if (cfilter.n_proto == ETH_P_IPV6 && mask.dst_ip[3])
|
||||
if (memcmp(&cfilter.ip.v6.dst_ip6, &cf->ip.v6.dst_ip6,
|
||||
sizeof(cfilter.ip.v6.src_ip6)))
|
||||
sizeof(cfilter.ip.v6.dst_ip6)))
|
||||
continue;
|
||||
if (mask.vlan_id)
|
||||
if (cfilter.vlan_id != cf->vlan_id)
|
||||
|
|
@ -3979,10 +3979,10 @@ static int i40e_vc_add_cloud_filter(struct i40e_vf *vf, u8 *msg)
|
|||
cfilter->n_proto = ETH_P_IP;
|
||||
if (mask.dst_ip[0] & tcf.dst_ip[0])
|
||||
memcpy(&cfilter->ip.v4.dst_ip, tcf.dst_ip,
|
||||
ARRAY_SIZE(tcf.dst_ip));
|
||||
else if (mask.src_ip[0] & tcf.dst_ip[0])
|
||||
sizeof(cfilter->ip.v4.dst_ip));
|
||||
else if (mask.src_ip[0] & tcf.src_ip[0])
|
||||
memcpy(&cfilter->ip.v4.src_ip, tcf.src_ip,
|
||||
ARRAY_SIZE(tcf.dst_ip));
|
||||
sizeof(cfilter->ip.v4.src_ip));
|
||||
break;
|
||||
case VIRTCHNL_TCP_V6_FLOW:
|
||||
cfilter->n_proto = ETH_P_IPV6;
|
||||
|
|
|
|||
|
|
@ -260,7 +260,6 @@ struct iavf_adapter {
|
|||
struct work_struct adminq_task;
|
||||
struct work_struct finish_config;
|
||||
wait_queue_head_t down_waitqueue;
|
||||
wait_queue_head_t reset_waitqueue;
|
||||
wait_queue_head_t vc_waitqueue;
|
||||
struct iavf_q_vector *q_vectors;
|
||||
struct list_head vlan_filter_list;
|
||||
|
|
@ -626,5 +625,5 @@ void iavf_add_adv_rss_cfg(struct iavf_adapter *adapter);
|
|||
void iavf_del_adv_rss_cfg(struct iavf_adapter *adapter);
|
||||
struct iavf_mac_filter *iavf_add_filter(struct iavf_adapter *adapter,
|
||||
const u8 *macaddr);
|
||||
int iavf_wait_for_reset(struct iavf_adapter *adapter);
|
||||
void iavf_reset_step(struct iavf_adapter *adapter);
|
||||
#endif /* _IAVF_H_ */
|
||||
|
|
|
|||
|
|
@ -492,7 +492,6 @@ static int iavf_set_ringparam(struct net_device *netdev,
|
|||
{
|
||||
struct iavf_adapter *adapter = netdev_priv(netdev);
|
||||
u32 new_rx_count, new_tx_count;
|
||||
int ret = 0;
|
||||
|
||||
if ((ring->rx_mini_pending) || (ring->rx_jumbo_pending))
|
||||
return -EINVAL;
|
||||
|
|
@ -537,13 +536,11 @@ static int iavf_set_ringparam(struct net_device *netdev,
|
|||
}
|
||||
|
||||
if (netif_running(netdev)) {
|
||||
iavf_schedule_reset(adapter, IAVF_FLAG_RESET_NEEDED);
|
||||
ret = iavf_wait_for_reset(adapter);
|
||||
if (ret)
|
||||
netdev_warn(netdev, "Changing ring parameters timeout or interrupted waiting for reset");
|
||||
adapter->flags |= IAVF_FLAG_RESET_NEEDED;
|
||||
iavf_reset_step(adapter);
|
||||
}
|
||||
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1723,7 +1720,6 @@ static int iavf_set_channels(struct net_device *netdev,
|
|||
{
|
||||
struct iavf_adapter *adapter = netdev_priv(netdev);
|
||||
u32 num_req = ch->combined_count;
|
||||
int ret = 0;
|
||||
|
||||
if ((adapter->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_ADQ) &&
|
||||
adapter->num_tc) {
|
||||
|
|
@ -1745,13 +1741,10 @@ static int iavf_set_channels(struct net_device *netdev,
|
|||
|
||||
adapter->num_req_queues = num_req;
|
||||
adapter->flags |= IAVF_FLAG_REINIT_ITR_NEEDED;
|
||||
iavf_schedule_reset(adapter, IAVF_FLAG_RESET_NEEDED);
|
||||
adapter->flags |= IAVF_FLAG_RESET_NEEDED;
|
||||
iavf_reset_step(adapter);
|
||||
|
||||
ret = iavf_wait_for_reset(adapter);
|
||||
if (ret)
|
||||
netdev_warn(netdev, "Changing channel count timeout or interrupted waiting for reset");
|
||||
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -185,31 +185,6 @@ static bool iavf_is_reset_in_progress(struct iavf_adapter *adapter)
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* iavf_wait_for_reset - Wait for reset to finish.
|
||||
* @adapter: board private structure
|
||||
*
|
||||
* Returns 0 if reset finished successfully, negative on timeout or interrupt.
|
||||
*/
|
||||
int iavf_wait_for_reset(struct iavf_adapter *adapter)
|
||||
{
|
||||
int ret = wait_event_interruptible_timeout(adapter->reset_waitqueue,
|
||||
!iavf_is_reset_in_progress(adapter),
|
||||
msecs_to_jiffies(5000));
|
||||
|
||||
/* If ret < 0 then it means wait was interrupted.
|
||||
* If ret == 0 then it means we got a timeout while waiting
|
||||
* for reset to finish.
|
||||
* If ret > 0 it means reset has finished.
|
||||
*/
|
||||
if (ret > 0)
|
||||
return 0;
|
||||
else if (ret < 0)
|
||||
return -EINTR;
|
||||
else
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
/**
|
||||
* iavf_allocate_dma_mem_d - OS specific memory alloc for shared code
|
||||
* @hw: pointer to the HW structure
|
||||
|
|
@ -3036,6 +3011,8 @@ static void iavf_disable_vf(struct iavf_adapter *adapter)
|
|||
|
||||
adapter->flags |= IAVF_FLAG_PF_COMMS_FAILED;
|
||||
|
||||
iavf_ptp_release(adapter);
|
||||
|
||||
/* We don't use netif_running() because it may be true prior to
|
||||
* ndo_open() returning, so we can't assume it means all our open
|
||||
* tasks have finished, since we're not holding the rtnl_lock here.
|
||||
|
|
@ -3111,18 +3088,16 @@ static void iavf_reconfig_qs_bw(struct iavf_adapter *adapter)
|
|||
}
|
||||
|
||||
/**
|
||||
* iavf_reset_task - Call-back task to handle hardware reset
|
||||
* @work: pointer to work_struct
|
||||
* iavf_reset_step - Perform the VF reset sequence
|
||||
* @adapter: board private structure
|
||||
*
|
||||
* During reset we need to shut down and reinitialize the admin queue
|
||||
* before we can use it to communicate with the PF again. We also clear
|
||||
* and reinit the rings because that context is lost as well.
|
||||
**/
|
||||
static void iavf_reset_task(struct work_struct *work)
|
||||
* Requests a reset from PF, polls for completion, and reconfigures
|
||||
* the driver. Caller must hold the netdev instance lock.
|
||||
*
|
||||
* This can sleep for several seconds while polling HW registers.
|
||||
*/
|
||||
void iavf_reset_step(struct iavf_adapter *adapter)
|
||||
{
|
||||
struct iavf_adapter *adapter = container_of(work,
|
||||
struct iavf_adapter,
|
||||
reset_task);
|
||||
struct virtchnl_vf_resource *vfres = adapter->vf_res;
|
||||
struct net_device *netdev = adapter->netdev;
|
||||
struct iavf_hw *hw = &adapter->hw;
|
||||
|
|
@ -3133,7 +3108,7 @@ static void iavf_reset_task(struct work_struct *work)
|
|||
int i = 0, err;
|
||||
bool running;
|
||||
|
||||
netdev_lock(netdev);
|
||||
netdev_assert_locked(netdev);
|
||||
|
||||
iavf_misc_irq_disable(adapter);
|
||||
if (adapter->flags & IAVF_FLAG_RESET_NEEDED) {
|
||||
|
|
@ -3178,7 +3153,6 @@ static void iavf_reset_task(struct work_struct *work)
|
|||
dev_err(&adapter->pdev->dev, "Reset never finished (%x)\n",
|
||||
reg_val);
|
||||
iavf_disable_vf(adapter);
|
||||
netdev_unlock(netdev);
|
||||
return; /* Do not attempt to reinit. It's dead, Jim. */
|
||||
}
|
||||
|
||||
|
|
@ -3190,7 +3164,6 @@ static void iavf_reset_task(struct work_struct *work)
|
|||
iavf_startup(adapter);
|
||||
queue_delayed_work(adapter->wq, &adapter->watchdog_task,
|
||||
msecs_to_jiffies(30));
|
||||
netdev_unlock(netdev);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -3211,6 +3184,8 @@ static void iavf_reset_task(struct work_struct *work)
|
|||
iavf_change_state(adapter, __IAVF_RESETTING);
|
||||
adapter->flags &= ~IAVF_FLAG_RESET_PENDING;
|
||||
|
||||
iavf_ptp_release(adapter);
|
||||
|
||||
/* free the Tx/Rx rings and descriptors, might be better to just
|
||||
* re-use them sometime in the future
|
||||
*/
|
||||
|
|
@ -3331,9 +3306,6 @@ static void iavf_reset_task(struct work_struct *work)
|
|||
|
||||
adapter->flags &= ~IAVF_FLAG_REINIT_ITR_NEEDED;
|
||||
|
||||
wake_up(&adapter->reset_waitqueue);
|
||||
netdev_unlock(netdev);
|
||||
|
||||
return;
|
||||
reset_err:
|
||||
if (running) {
|
||||
|
|
@ -3342,10 +3314,21 @@ static void iavf_reset_task(struct work_struct *work)
|
|||
}
|
||||
iavf_disable_vf(adapter);
|
||||
|
||||
netdev_unlock(netdev);
|
||||
dev_err(&adapter->pdev->dev, "failed to allocate resources during reinit\n");
|
||||
}
|
||||
|
||||
static void iavf_reset_task(struct work_struct *work)
|
||||
{
|
||||
struct iavf_adapter *adapter = container_of(work,
|
||||
struct iavf_adapter,
|
||||
reset_task);
|
||||
struct net_device *netdev = adapter->netdev;
|
||||
|
||||
netdev_lock(netdev);
|
||||
iavf_reset_step(adapter);
|
||||
netdev_unlock(netdev);
|
||||
}
|
||||
|
||||
/**
|
||||
* iavf_adminq_task - worker thread to clean the admin queue
|
||||
* @work: pointer to work_struct containing our data
|
||||
|
|
@ -4611,22 +4594,17 @@ static int iavf_close(struct net_device *netdev)
|
|||
static int iavf_change_mtu(struct net_device *netdev, int new_mtu)
|
||||
{
|
||||
struct iavf_adapter *adapter = netdev_priv(netdev);
|
||||
int ret = 0;
|
||||
|
||||
netdev_dbg(netdev, "changing MTU from %d to %d\n",
|
||||
netdev->mtu, new_mtu);
|
||||
WRITE_ONCE(netdev->mtu, new_mtu);
|
||||
|
||||
if (netif_running(netdev)) {
|
||||
iavf_schedule_reset(adapter, IAVF_FLAG_RESET_NEEDED);
|
||||
ret = iavf_wait_for_reset(adapter);
|
||||
if (ret < 0)
|
||||
netdev_warn(netdev, "MTU change interrupted waiting for reset");
|
||||
else if (ret)
|
||||
netdev_warn(netdev, "MTU change timed out waiting for reset");
|
||||
adapter->flags |= IAVF_FLAG_RESET_NEEDED;
|
||||
iavf_reset_step(adapter);
|
||||
}
|
||||
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -5431,9 +5409,6 @@ static int iavf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|||
/* Setup the wait queue for indicating transition to down status */
|
||||
init_waitqueue_head(&adapter->down_waitqueue);
|
||||
|
||||
/* Setup the wait queue for indicating transition to running state */
|
||||
init_waitqueue_head(&adapter->reset_waitqueue);
|
||||
|
||||
/* Setup the wait queue for indicating virtchannel events */
|
||||
init_waitqueue_head(&adapter->vc_waitqueue);
|
||||
|
||||
|
|
|
|||
|
|
@ -2736,7 +2736,6 @@ void iavf_virtchnl_completion(struct iavf_adapter *adapter,
|
|||
case VIRTCHNL_OP_ENABLE_QUEUES:
|
||||
/* enable transmits */
|
||||
iavf_irq_enable(adapter, true);
|
||||
wake_up(&adapter->reset_waitqueue);
|
||||
adapter->flags &= ~IAVF_FLAG_QUEUES_DISABLED;
|
||||
break;
|
||||
case VIRTCHNL_OP_DISABLE_QUEUES:
|
||||
|
|
|
|||
|
|
@ -1360,7 +1360,7 @@ ice_devlink_enable_roce_get(struct devlink *devlink, u32 id,
|
|||
|
||||
cdev = pf->cdev_info;
|
||||
if (!cdev)
|
||||
return -ENODEV;
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
ctx->val.vbool = !!(cdev->rdma_protocol & IIDC_RDMA_PROTOCOL_ROCEV2);
|
||||
|
||||
|
|
@ -1427,7 +1427,7 @@ ice_devlink_enable_iw_get(struct devlink *devlink, u32 id,
|
|||
|
||||
cdev = pf->cdev_info;
|
||||
if (!cdev)
|
||||
return -ENODEV;
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
ctx->val.vbool = !!(cdev->rdma_protocol & IIDC_RDMA_PROTOCOL_IWARP);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user