Skip to content

Commit 680b892

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 2022-05-17 This series contains updates to ice driver only. Arkadiusz prevents writing of timestamps when rings are being configured to resolve null pointer dereference. Paul changes a delayed call to baseline statistics to occur immediately which was causing misreporting of statistics due to the delay. Michal fixes incorrect restoration of interrupt moderation settings. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 089403a + bf13502 commit 680b892

File tree

4 files changed

+35
-18
lines changed

4 files changed

+35
-18
lines changed

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3043,8 +3043,8 @@ ice_vsi_rebuild_get_coalesce(struct ice_vsi *vsi,
30433043
ice_for_each_q_vector(vsi, i) {
30443044
struct ice_q_vector *q_vector = vsi->q_vectors[i];
30453045

3046-
coalesce[i].itr_tx = q_vector->tx.itr_setting;
3047-
coalesce[i].itr_rx = q_vector->rx.itr_setting;
3046+
coalesce[i].itr_tx = q_vector->tx.itr_settings;
3047+
coalesce[i].itr_rx = q_vector->rx.itr_settings;
30483048
coalesce[i].intrl = q_vector->intrl;
30493049

30503050
if (i < vsi->num_txq)
@@ -3100,21 +3100,21 @@ ice_vsi_rebuild_set_coalesce(struct ice_vsi *vsi,
31003100
*/
31013101
if (i < vsi->alloc_rxq && coalesce[i].rx_valid) {
31023102
rc = &vsi->q_vectors[i]->rx;
3103-
rc->itr_setting = coalesce[i].itr_rx;
3103+
rc->itr_settings = coalesce[i].itr_rx;
31043104
ice_write_itr(rc, rc->itr_setting);
31053105
} else if (i < vsi->alloc_rxq) {
31063106
rc = &vsi->q_vectors[i]->rx;
3107-
rc->itr_setting = coalesce[0].itr_rx;
3107+
rc->itr_settings = coalesce[0].itr_rx;
31083108
ice_write_itr(rc, rc->itr_setting);
31093109
}
31103110

31113111
if (i < vsi->alloc_txq && coalesce[i].tx_valid) {
31123112
rc = &vsi->q_vectors[i]->tx;
3113-
rc->itr_setting = coalesce[i].itr_tx;
3113+
rc->itr_settings = coalesce[i].itr_tx;
31143114
ice_write_itr(rc, rc->itr_setting);
31153115
} else if (i < vsi->alloc_txq) {
31163116
rc = &vsi->q_vectors[i]->tx;
3117-
rc->itr_setting = coalesce[0].itr_tx;
3117+
rc->itr_settings = coalesce[0].itr_tx;
31183118
ice_write_itr(rc, rc->itr_setting);
31193119
}
31203120

@@ -3128,12 +3128,12 @@ ice_vsi_rebuild_set_coalesce(struct ice_vsi *vsi,
31283128
for (; i < vsi->num_q_vectors; i++) {
31293129
/* transmit */
31303130
rc = &vsi->q_vectors[i]->tx;
3131-
rc->itr_setting = coalesce[0].itr_tx;
3131+
rc->itr_settings = coalesce[0].itr_tx;
31323132
ice_write_itr(rc, rc->itr_setting);
31333133

31343134
/* receive */
31353135
rc = &vsi->q_vectors[i]->rx;
3136-
rc->itr_setting = coalesce[0].itr_rx;
3136+
rc->itr_settings = coalesce[0].itr_rx;
31373137
ice_write_itr(rc, rc->itr_setting);
31383138

31393139
vsi->q_vectors[i]->intrl = coalesce[0].intrl;

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6172,9 +6172,10 @@ static int ice_up_complete(struct ice_vsi *vsi)
61726172
ice_ptp_link_change(pf, pf->hw.pf_id, true);
61736173
}
61746174

6175-
/* clear this now, and the first stats read will be used as baseline */
6176-
vsi->stat_offsets_loaded = false;
6177-
6175+
/* Perform an initial read of the statistics registers now to
6176+
* set the baseline so counters are ready when interface is up
6177+
*/
6178+
ice_update_eth_stats(vsi);
61786179
ice_service_task_schedule(pf);
61796180

61806181
return 0;

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

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -500,12 +500,19 @@ ice_ptp_read_src_clk_reg(struct ice_pf *pf, struct ptp_system_timestamp *sts)
500500
* This function must be called periodically to ensure that the cached value
501501
* is never more than 2 seconds old. It must also be called whenever the PHC
502502
* time has been changed.
503+
*
504+
* Return:
505+
* * 0 - OK, successfully updated
506+
* * -EAGAIN - PF was busy, need to reschedule the update
503507
*/
504-
static void ice_ptp_update_cached_phctime(struct ice_pf *pf)
508+
static int ice_ptp_update_cached_phctime(struct ice_pf *pf)
505509
{
506510
u64 systime;
507511
int i;
508512

513+
if (test_and_set_bit(ICE_CFG_BUSY, pf->state))
514+
return -EAGAIN;
515+
509516
/* Read the current PHC time */
510517
systime = ice_ptp_read_src_clk_reg(pf, NULL);
511518

@@ -528,6 +535,9 @@ static void ice_ptp_update_cached_phctime(struct ice_pf *pf)
528535
WRITE_ONCE(vsi->rx_rings[j]->cached_phctime, systime);
529536
}
530537
}
538+
clear_bit(ICE_CFG_BUSY, pf->state);
539+
540+
return 0;
531541
}
532542

533543
/**
@@ -2330,17 +2340,18 @@ static void ice_ptp_periodic_work(struct kthread_work *work)
23302340
{
23312341
struct ice_ptp *ptp = container_of(work, struct ice_ptp, work.work);
23322342
struct ice_pf *pf = container_of(ptp, struct ice_pf, ptp);
2343+
int err;
23332344

23342345
if (!test_bit(ICE_FLAG_PTP, pf->flags))
23352346
return;
23362347

2337-
ice_ptp_update_cached_phctime(pf);
2348+
err = ice_ptp_update_cached_phctime(pf);
23382349

23392350
ice_ptp_tx_tstamp_cleanup(&pf->hw, &pf->ptp.port.tx);
23402351

2341-
/* Run twice a second */
2352+
/* Run twice a second or reschedule if phc update failed */
23422353
kthread_queue_delayed_work(ptp->kworker, &ptp->work,
2343-
msecs_to_jiffies(500));
2354+
msecs_to_jiffies(err ? 10 : 500));
23442355
}
23452356

23462357
/**

drivers/net/ethernet/intel/ice/ice_txrx.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -384,9 +384,14 @@ struct ice_ring_container {
384384
/* this matches the maximum number of ITR bits, but in usec
385385
* values, so it is shifted left one bit (bit zero is ignored)
386386
*/
387-
u16 itr_setting:13;
388-
u16 itr_reserved:2;
389-
u16 itr_mode:1;
387+
union {
388+
struct {
389+
u16 itr_setting:13;
390+
u16 itr_reserved:2;
391+
u16 itr_mode:1;
392+
};
393+
u16 itr_settings;
394+
};
390395
enum ice_container_type type;
391396
};
392397

0 commit comments

Comments
 (0)