Commit 680b8926 authored by David S. Miller's avatar David S. Miller

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: default avatarDavid S. Miller <davem@davemloft.net>
parents 089403a3 bf13502e
...@@ -3043,8 +3043,8 @@ ice_vsi_rebuild_get_coalesce(struct ice_vsi *vsi, ...@@ -3043,8 +3043,8 @@ ice_vsi_rebuild_get_coalesce(struct ice_vsi *vsi,
ice_for_each_q_vector(vsi, i) { ice_for_each_q_vector(vsi, i) {
struct ice_q_vector *q_vector = vsi->q_vectors[i]; struct ice_q_vector *q_vector = vsi->q_vectors[i];
coalesce[i].itr_tx = q_vector->tx.itr_setting; coalesce[i].itr_tx = q_vector->tx.itr_settings;
coalesce[i].itr_rx = q_vector->rx.itr_setting; coalesce[i].itr_rx = q_vector->rx.itr_settings;
coalesce[i].intrl = q_vector->intrl; coalesce[i].intrl = q_vector->intrl;
if (i < vsi->num_txq) if (i < vsi->num_txq)
...@@ -3100,21 +3100,21 @@ ice_vsi_rebuild_set_coalesce(struct ice_vsi *vsi, ...@@ -3100,21 +3100,21 @@ ice_vsi_rebuild_set_coalesce(struct ice_vsi *vsi,
*/ */
if (i < vsi->alloc_rxq && coalesce[i].rx_valid) { if (i < vsi->alloc_rxq && coalesce[i].rx_valid) {
rc = &vsi->q_vectors[i]->rx; rc = &vsi->q_vectors[i]->rx;
rc->itr_setting = coalesce[i].itr_rx; rc->itr_settings = coalesce[i].itr_rx;
ice_write_itr(rc, rc->itr_setting); ice_write_itr(rc, rc->itr_setting);
} else if (i < vsi->alloc_rxq) { } else if (i < vsi->alloc_rxq) {
rc = &vsi->q_vectors[i]->rx; rc = &vsi->q_vectors[i]->rx;
rc->itr_setting = coalesce[0].itr_rx; rc->itr_settings = coalesce[0].itr_rx;
ice_write_itr(rc, rc->itr_setting); ice_write_itr(rc, rc->itr_setting);
} }
if (i < vsi->alloc_txq && coalesce[i].tx_valid) { if (i < vsi->alloc_txq && coalesce[i].tx_valid) {
rc = &vsi->q_vectors[i]->tx; rc = &vsi->q_vectors[i]->tx;
rc->itr_setting = coalesce[i].itr_tx; rc->itr_settings = coalesce[i].itr_tx;
ice_write_itr(rc, rc->itr_setting); ice_write_itr(rc, rc->itr_setting);
} else if (i < vsi->alloc_txq) { } else if (i < vsi->alloc_txq) {
rc = &vsi->q_vectors[i]->tx; rc = &vsi->q_vectors[i]->tx;
rc->itr_setting = coalesce[0].itr_tx; rc->itr_settings = coalesce[0].itr_tx;
ice_write_itr(rc, rc->itr_setting); ice_write_itr(rc, rc->itr_setting);
} }
...@@ -3128,12 +3128,12 @@ ice_vsi_rebuild_set_coalesce(struct ice_vsi *vsi, ...@@ -3128,12 +3128,12 @@ ice_vsi_rebuild_set_coalesce(struct ice_vsi *vsi,
for (; i < vsi->num_q_vectors; i++) { for (; i < vsi->num_q_vectors; i++) {
/* transmit */ /* transmit */
rc = &vsi->q_vectors[i]->tx; rc = &vsi->q_vectors[i]->tx;
rc->itr_setting = coalesce[0].itr_tx; rc->itr_settings = coalesce[0].itr_tx;
ice_write_itr(rc, rc->itr_setting); ice_write_itr(rc, rc->itr_setting);
/* receive */ /* receive */
rc = &vsi->q_vectors[i]->rx; rc = &vsi->q_vectors[i]->rx;
rc->itr_setting = coalesce[0].itr_rx; rc->itr_settings = coalesce[0].itr_rx;
ice_write_itr(rc, rc->itr_setting); ice_write_itr(rc, rc->itr_setting);
vsi->q_vectors[i]->intrl = coalesce[0].intrl; vsi->q_vectors[i]->intrl = coalesce[0].intrl;
......
...@@ -6172,9 +6172,10 @@ static int ice_up_complete(struct ice_vsi *vsi) ...@@ -6172,9 +6172,10 @@ static int ice_up_complete(struct ice_vsi *vsi)
ice_ptp_link_change(pf, pf->hw.pf_id, true); ice_ptp_link_change(pf, pf->hw.pf_id, true);
} }
/* clear this now, and the first stats read will be used as baseline */ /* Perform an initial read of the statistics registers now to
vsi->stat_offsets_loaded = false; * set the baseline so counters are ready when interface is up
*/
ice_update_eth_stats(vsi);
ice_service_task_schedule(pf); ice_service_task_schedule(pf);
return 0; return 0;
......
...@@ -500,12 +500,19 @@ ice_ptp_read_src_clk_reg(struct ice_pf *pf, struct ptp_system_timestamp *sts) ...@@ -500,12 +500,19 @@ ice_ptp_read_src_clk_reg(struct ice_pf *pf, struct ptp_system_timestamp *sts)
* This function must be called periodically to ensure that the cached value * This function must be called periodically to ensure that the cached value
* is never more than 2 seconds old. It must also be called whenever the PHC * is never more than 2 seconds old. It must also be called whenever the PHC
* time has been changed. * time has been changed.
*
* Return:
* * 0 - OK, successfully updated
* * -EAGAIN - PF was busy, need to reschedule the update
*/ */
static void ice_ptp_update_cached_phctime(struct ice_pf *pf) static int ice_ptp_update_cached_phctime(struct ice_pf *pf)
{ {
u64 systime; u64 systime;
int i; int i;
if (test_and_set_bit(ICE_CFG_BUSY, pf->state))
return -EAGAIN;
/* Read the current PHC time */ /* Read the current PHC time */
systime = ice_ptp_read_src_clk_reg(pf, NULL); systime = ice_ptp_read_src_clk_reg(pf, NULL);
...@@ -528,6 +535,9 @@ static void ice_ptp_update_cached_phctime(struct ice_pf *pf) ...@@ -528,6 +535,9 @@ static void ice_ptp_update_cached_phctime(struct ice_pf *pf)
WRITE_ONCE(vsi->rx_rings[j]->cached_phctime, systime); WRITE_ONCE(vsi->rx_rings[j]->cached_phctime, systime);
} }
} }
clear_bit(ICE_CFG_BUSY, pf->state);
return 0;
} }
/** /**
...@@ -2330,17 +2340,18 @@ static void ice_ptp_periodic_work(struct kthread_work *work) ...@@ -2330,17 +2340,18 @@ static void ice_ptp_periodic_work(struct kthread_work *work)
{ {
struct ice_ptp *ptp = container_of(work, struct ice_ptp, work.work); struct ice_ptp *ptp = container_of(work, struct ice_ptp, work.work);
struct ice_pf *pf = container_of(ptp, struct ice_pf, ptp); struct ice_pf *pf = container_of(ptp, struct ice_pf, ptp);
int err;
if (!test_bit(ICE_FLAG_PTP, pf->flags)) if (!test_bit(ICE_FLAG_PTP, pf->flags))
return; return;
ice_ptp_update_cached_phctime(pf); err = ice_ptp_update_cached_phctime(pf);
ice_ptp_tx_tstamp_cleanup(&pf->hw, &pf->ptp.port.tx); ice_ptp_tx_tstamp_cleanup(&pf->hw, &pf->ptp.port.tx);
/* Run twice a second */ /* Run twice a second or reschedule if phc update failed */
kthread_queue_delayed_work(ptp->kworker, &ptp->work, kthread_queue_delayed_work(ptp->kworker, &ptp->work,
msecs_to_jiffies(500)); msecs_to_jiffies(err ? 10 : 500));
} }
/** /**
......
...@@ -384,9 +384,14 @@ struct ice_ring_container { ...@@ -384,9 +384,14 @@ struct ice_ring_container {
/* this matches the maximum number of ITR bits, but in usec /* this matches the maximum number of ITR bits, but in usec
* values, so it is shifted left one bit (bit zero is ignored) * values, so it is shifted left one bit (bit zero is ignored)
*/ */
u16 itr_setting:13; union {
u16 itr_reserved:2; struct {
u16 itr_mode:1; u16 itr_setting:13;
u16 itr_reserved:2;
u16 itr_mode:1;
};
u16 itr_settings;
};
enum ice_container_type type; enum ice_container_type type;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment