Skip to content

Commit 14ad510

Browse files
committed
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>
2 parents e62a22f + e94eaef commit 14ad510

8 files changed

Lines changed: 44 additions & 82 deletions

File tree

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2952,8 +2952,6 @@ static int e1000_tx_map(struct e1000_adapter *adapter,
29522952
dma_error:
29532953
dev_err(&pdev->dev, "TX DMA map failed\n");
29542954
buffer_info->dma = 0;
2955-
if (count)
2956-
count--;
29572955

29582956
while (count--) {
29592957
if (i == 0)

drivers/net/ethernet/intel/e1000e/netdev.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5652,8 +5652,6 @@ static int e1000_tx_map(struct e1000_ring *tx_ring, struct sk_buff *skb,
56525652
dma_error:
56535653
dev_err(&pdev->dev, "Tx DMA map failed\n");
56545654
buffer_info->dma = 0;
5655-
if (count)
5656-
count--;
56575655

56585656
while (count--) {
56595657
if (i == 0)

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3833,10 +3833,10 @@ static int i40e_vc_del_cloud_filter(struct i40e_vf *vf, u8 *msg)
38333833
cfilter.n_proto = ETH_P_IP;
38343834
if (mask.dst_ip[0] & tcf.dst_ip[0])
38353835
memcpy(&cfilter.ip.v4.dst_ip, tcf.dst_ip,
3836-
ARRAY_SIZE(tcf.dst_ip));
3837-
else if (mask.src_ip[0] & tcf.dst_ip[0])
3836+
sizeof(cfilter.ip.v4.dst_ip));
3837+
else if (mask.src_ip[0] & tcf.src_ip[0])
38383838
memcpy(&cfilter.ip.v4.src_ip, tcf.src_ip,
3839-
ARRAY_SIZE(tcf.dst_ip));
3839+
sizeof(cfilter.ip.v4.src_ip));
38403840
break;
38413841
case VIRTCHNL_TCP_V6_FLOW:
38423842
cfilter.n_proto = ETH_P_IPV6;
@@ -3891,7 +3891,7 @@ static int i40e_vc_del_cloud_filter(struct i40e_vf *vf, u8 *msg)
38913891
/* for ipv6, mask is set for all sixteen bytes (4 words) */
38923892
if (cfilter.n_proto == ETH_P_IPV6 && mask.dst_ip[3])
38933893
if (memcmp(&cfilter.ip.v6.dst_ip6, &cf->ip.v6.dst_ip6,
3894-
sizeof(cfilter.ip.v6.src_ip6)))
3894+
sizeof(cfilter.ip.v6.dst_ip6)))
38953895
continue;
38963896
if (mask.vlan_id)
38973897
if (cfilter.vlan_id != cf->vlan_id)
@@ -3979,10 +3979,10 @@ static int i40e_vc_add_cloud_filter(struct i40e_vf *vf, u8 *msg)
39793979
cfilter->n_proto = ETH_P_IP;
39803980
if (mask.dst_ip[0] & tcf.dst_ip[0])
39813981
memcpy(&cfilter->ip.v4.dst_ip, tcf.dst_ip,
3982-
ARRAY_SIZE(tcf.dst_ip));
3983-
else if (mask.src_ip[0] & tcf.dst_ip[0])
3982+
sizeof(cfilter->ip.v4.dst_ip));
3983+
else if (mask.src_ip[0] & tcf.src_ip[0])
39843984
memcpy(&cfilter->ip.v4.src_ip, tcf.src_ip,
3985-
ARRAY_SIZE(tcf.dst_ip));
3985+
sizeof(cfilter->ip.v4.src_ip));
39863986
break;
39873987
case VIRTCHNL_TCP_V6_FLOW:
39883988
cfilter->n_proto = ETH_P_IPV6;

drivers/net/ethernet/intel/iavf/iavf.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,6 @@ struct iavf_adapter {
260260
struct work_struct adminq_task;
261261
struct work_struct finish_config;
262262
wait_queue_head_t down_waitqueue;
263-
wait_queue_head_t reset_waitqueue;
264263
wait_queue_head_t vc_waitqueue;
265264
struct iavf_q_vector *q_vectors;
266265
struct list_head vlan_filter_list;
@@ -626,5 +625,5 @@ void iavf_add_adv_rss_cfg(struct iavf_adapter *adapter);
626625
void iavf_del_adv_rss_cfg(struct iavf_adapter *adapter);
627626
struct iavf_mac_filter *iavf_add_filter(struct iavf_adapter *adapter,
628627
const u8 *macaddr);
629-
int iavf_wait_for_reset(struct iavf_adapter *adapter);
628+
void iavf_reset_step(struct iavf_adapter *adapter);
630629
#endif /* _IAVF_H_ */

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

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,6 @@ static int iavf_set_ringparam(struct net_device *netdev,
492492
{
493493
struct iavf_adapter *adapter = netdev_priv(netdev);
494494
u32 new_rx_count, new_tx_count;
495-
int ret = 0;
496495

497496
if ((ring->rx_mini_pending) || (ring->rx_jumbo_pending))
498497
return -EINVAL;
@@ -537,13 +536,11 @@ static int iavf_set_ringparam(struct net_device *netdev,
537536
}
538537

539538
if (netif_running(netdev)) {
540-
iavf_schedule_reset(adapter, IAVF_FLAG_RESET_NEEDED);
541-
ret = iavf_wait_for_reset(adapter);
542-
if (ret)
543-
netdev_warn(netdev, "Changing ring parameters timeout or interrupted waiting for reset");
539+
adapter->flags |= IAVF_FLAG_RESET_NEEDED;
540+
iavf_reset_step(adapter);
544541
}
545542

546-
return ret;
543+
return 0;
547544
}
548545

549546
/**
@@ -1723,7 +1720,6 @@ static int iavf_set_channels(struct net_device *netdev,
17231720
{
17241721
struct iavf_adapter *adapter = netdev_priv(netdev);
17251722
u32 num_req = ch->combined_count;
1726-
int ret = 0;
17271723

17281724
if ((adapter->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_ADQ) &&
17291725
adapter->num_tc) {
@@ -1745,13 +1741,10 @@ static int iavf_set_channels(struct net_device *netdev,
17451741

17461742
adapter->num_req_queues = num_req;
17471743
adapter->flags |= IAVF_FLAG_REINIT_ITR_NEEDED;
1748-
iavf_schedule_reset(adapter, IAVF_FLAG_RESET_NEEDED);
1744+
adapter->flags |= IAVF_FLAG_RESET_NEEDED;
1745+
iavf_reset_step(adapter);
17491746

1750-
ret = iavf_wait_for_reset(adapter);
1751-
if (ret)
1752-
netdev_warn(netdev, "Changing channel count timeout or interrupted waiting for reset");
1753-
1754-
return ret;
1747+
return 0;
17551748
}
17561749

17571750
/**

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

Lines changed: 28 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -185,31 +185,6 @@ static bool iavf_is_reset_in_progress(struct iavf_adapter *adapter)
185185
return false;
186186
}
187187

188-
/**
189-
* iavf_wait_for_reset - Wait for reset to finish.
190-
* @adapter: board private structure
191-
*
192-
* Returns 0 if reset finished successfully, negative on timeout or interrupt.
193-
*/
194-
int iavf_wait_for_reset(struct iavf_adapter *adapter)
195-
{
196-
int ret = wait_event_interruptible_timeout(adapter->reset_waitqueue,
197-
!iavf_is_reset_in_progress(adapter),
198-
msecs_to_jiffies(5000));
199-
200-
/* If ret < 0 then it means wait was interrupted.
201-
* If ret == 0 then it means we got a timeout while waiting
202-
* for reset to finish.
203-
* If ret > 0 it means reset has finished.
204-
*/
205-
if (ret > 0)
206-
return 0;
207-
else if (ret < 0)
208-
return -EINTR;
209-
else
210-
return -EBUSY;
211-
}
212-
213188
/**
214189
* iavf_allocate_dma_mem_d - OS specific memory alloc for shared code
215190
* @hw: pointer to the HW structure
@@ -3036,6 +3011,8 @@ static void iavf_disable_vf(struct iavf_adapter *adapter)
30363011

30373012
adapter->flags |= IAVF_FLAG_PF_COMMS_FAILED;
30383013

3014+
iavf_ptp_release(adapter);
3015+
30393016
/* We don't use netif_running() because it may be true prior to
30403017
* ndo_open() returning, so we can't assume it means all our open
30413018
* 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)
31113088
}
31123089

31133090
/**
3114-
* iavf_reset_task - Call-back task to handle hardware reset
3115-
* @work: pointer to work_struct
3091+
* iavf_reset_step - Perform the VF reset sequence
3092+
* @adapter: board private structure
31163093
*
3117-
* During reset we need to shut down and reinitialize the admin queue
3118-
* before we can use it to communicate with the PF again. We also clear
3119-
* and reinit the rings because that context is lost as well.
3120-
**/
3121-
static void iavf_reset_task(struct work_struct *work)
3094+
* Requests a reset from PF, polls for completion, and reconfigures
3095+
* the driver. Caller must hold the netdev instance lock.
3096+
*
3097+
* This can sleep for several seconds while polling HW registers.
3098+
*/
3099+
void iavf_reset_step(struct iavf_adapter *adapter)
31223100
{
3123-
struct iavf_adapter *adapter = container_of(work,
3124-
struct iavf_adapter,
3125-
reset_task);
31263101
struct virtchnl_vf_resource *vfres = adapter->vf_res;
31273102
struct net_device *netdev = adapter->netdev;
31283103
struct iavf_hw *hw = &adapter->hw;
@@ -3133,7 +3108,7 @@ static void iavf_reset_task(struct work_struct *work)
31333108
int i = 0, err;
31343109
bool running;
31353110

3136-
netdev_lock(netdev);
3111+
netdev_assert_locked(netdev);
31373112

31383113
iavf_misc_irq_disable(adapter);
31393114
if (adapter->flags & IAVF_FLAG_RESET_NEEDED) {
@@ -3178,7 +3153,6 @@ static void iavf_reset_task(struct work_struct *work)
31783153
dev_err(&adapter->pdev->dev, "Reset never finished (%x)\n",
31793154
reg_val);
31803155
iavf_disable_vf(adapter);
3181-
netdev_unlock(netdev);
31823156
return; /* Do not attempt to reinit. It's dead, Jim. */
31833157
}
31843158

@@ -3190,7 +3164,6 @@ static void iavf_reset_task(struct work_struct *work)
31903164
iavf_startup(adapter);
31913165
queue_delayed_work(adapter->wq, &adapter->watchdog_task,
31923166
msecs_to_jiffies(30));
3193-
netdev_unlock(netdev);
31943167
return;
31953168
}
31963169

@@ -3211,6 +3184,8 @@ static void iavf_reset_task(struct work_struct *work)
32113184
iavf_change_state(adapter, __IAVF_RESETTING);
32123185
adapter->flags &= ~IAVF_FLAG_RESET_PENDING;
32133186

3187+
iavf_ptp_release(adapter);
3188+
32143189
/* free the Tx/Rx rings and descriptors, might be better to just
32153190
* re-use them sometime in the future
32163191
*/
@@ -3331,9 +3306,6 @@ static void iavf_reset_task(struct work_struct *work)
33313306

33323307
adapter->flags &= ~IAVF_FLAG_REINIT_ITR_NEEDED;
33333308

3334-
wake_up(&adapter->reset_waitqueue);
3335-
netdev_unlock(netdev);
3336-
33373309
return;
33383310
reset_err:
33393311
if (running) {
@@ -3342,10 +3314,21 @@ static void iavf_reset_task(struct work_struct *work)
33423314
}
33433315
iavf_disable_vf(adapter);
33443316

3345-
netdev_unlock(netdev);
33463317
dev_err(&adapter->pdev->dev, "failed to allocate resources during reinit\n");
33473318
}
33483319

3320+
static void iavf_reset_task(struct work_struct *work)
3321+
{
3322+
struct iavf_adapter *adapter = container_of(work,
3323+
struct iavf_adapter,
3324+
reset_task);
3325+
struct net_device *netdev = adapter->netdev;
3326+
3327+
netdev_lock(netdev);
3328+
iavf_reset_step(adapter);
3329+
netdev_unlock(netdev);
3330+
}
3331+
33493332
/**
33503333
* iavf_adminq_task - worker thread to clean the admin queue
33513334
* @work: pointer to work_struct containing our data
@@ -4611,22 +4594,17 @@ static int iavf_close(struct net_device *netdev)
46114594
static int iavf_change_mtu(struct net_device *netdev, int new_mtu)
46124595
{
46134596
struct iavf_adapter *adapter = netdev_priv(netdev);
4614-
int ret = 0;
46154597

46164598
netdev_dbg(netdev, "changing MTU from %d to %d\n",
46174599
netdev->mtu, new_mtu);
46184600
WRITE_ONCE(netdev->mtu, new_mtu);
46194601

46204602
if (netif_running(netdev)) {
4621-
iavf_schedule_reset(adapter, IAVF_FLAG_RESET_NEEDED);
4622-
ret = iavf_wait_for_reset(adapter);
4623-
if (ret < 0)
4624-
netdev_warn(netdev, "MTU change interrupted waiting for reset");
4625-
else if (ret)
4626-
netdev_warn(netdev, "MTU change timed out waiting for reset");
4603+
adapter->flags |= IAVF_FLAG_RESET_NEEDED;
4604+
iavf_reset_step(adapter);
46274605
}
46284606

4629-
return ret;
4607+
return 0;
46304608
}
46314609

46324610
/**
@@ -5431,9 +5409,6 @@ static int iavf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
54315409
/* Setup the wait queue for indicating transition to down status */
54325410
init_waitqueue_head(&adapter->down_waitqueue);
54335411

5434-
/* Setup the wait queue for indicating transition to running state */
5435-
init_waitqueue_head(&adapter->reset_waitqueue);
5436-
54375412
/* Setup the wait queue for indicating virtchannel events */
54385413
init_waitqueue_head(&adapter->vc_waitqueue);
54395414

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2736,7 +2736,6 @@ void iavf_virtchnl_completion(struct iavf_adapter *adapter,
27362736
case VIRTCHNL_OP_ENABLE_QUEUES:
27372737
/* enable transmits */
27382738
iavf_irq_enable(adapter, true);
2739-
wake_up(&adapter->reset_waitqueue);
27402739
adapter->flags &= ~IAVF_FLAG_QUEUES_DISABLED;
27412740
break;
27422741
case VIRTCHNL_OP_DISABLE_QUEUES:

drivers/net/ethernet/intel/ice/devlink/devlink.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1360,7 +1360,7 @@ ice_devlink_enable_roce_get(struct devlink *devlink, u32 id,
13601360

13611361
cdev = pf->cdev_info;
13621362
if (!cdev)
1363-
return -ENODEV;
1363+
return -EOPNOTSUPP;
13641364

13651365
ctx->val.vbool = !!(cdev->rdma_protocol & IIDC_RDMA_PROTOCOL_ROCEV2);
13661366

@@ -1427,7 +1427,7 @@ ice_devlink_enable_iw_get(struct devlink *devlink, u32 id,
14271427

14281428
cdev = pf->cdev_info;
14291429
if (!cdev)
1430-
return -ENODEV;
1430+
return -EOPNOTSUPP;
14311431

14321432
ctx->val.vbool = !!(cdev->rdma_protocol & IIDC_RDMA_PROTOCOL_IWARP);
14331433

0 commit comments

Comments
 (0)