idpf: preserve coalescing settings across resets

The IRQ coalescing config currently reside only inside struct
idpf_q_vector. However, all idpf_q_vector structs are de-allocated and
re-allocated during resets. This leads to user-set coalesce configuration
to be lost.

Add new fields to struct idpf_vport_user_config_data to save the user
settings and re-apply them after reset.

Reviewed-by: Madhu Chittim <madhu.chittim@intel.com>
Signed-off-by: Ahmed Zaki <ahmed.zaki@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Tested-by: Samuel Salin <Samuel.salin@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
This commit is contained in:
Ahmed Zaki
2025-06-20 11:15:48 -06:00
committed by Tony Nguyen
parent e831f9e276
commit e1e3fec3e3
5 changed files with 74 additions and 13 deletions

View File

@@ -1134,8 +1134,10 @@ static struct idpf_vport *idpf_vport_alloc(struct idpf_adapter *adapter,
if (!vport)
return vport;
num_max_q = max(max_q->max_txq, max_q->max_rxq);
if (!adapter->vport_config[idx]) {
struct idpf_vport_config *vport_config;
struct idpf_q_coalesce *q_coal;
vport_config = kzalloc(sizeof(*vport_config), GFP_KERNEL);
if (!vport_config) {
@@ -1144,6 +1146,21 @@ static struct idpf_vport *idpf_vport_alloc(struct idpf_adapter *adapter,
return NULL;
}
q_coal = kcalloc(num_max_q, sizeof(*q_coal), GFP_KERNEL);
if (!q_coal) {
kfree(vport_config);
kfree(vport);
return NULL;
}
for (int i = 0; i < num_max_q; i++) {
q_coal[i].tx_intr_mode = IDPF_ITR_DYNAMIC;
q_coal[i].tx_coalesce_usecs = IDPF_ITR_TX_DEF;
q_coal[i].rx_intr_mode = IDPF_ITR_DYNAMIC;
q_coal[i].rx_coalesce_usecs = IDPF_ITR_RX_DEF;
}
vport_config->user_config.q_coalesce = q_coal;
adapter->vport_config[idx] = vport_config;
}
@@ -1153,7 +1170,6 @@ static struct idpf_vport *idpf_vport_alloc(struct idpf_adapter *adapter,
vport->default_vport = adapter->num_alloc_vports <
idpf_get_default_vports(adapter);
num_max_q = max(max_q->max_txq, max_q->max_rxq);
vport->q_vector_idxs = kcalloc(num_max_q, sizeof(u16), GFP_KERNEL);
if (!vport->q_vector_idxs)
goto free_vport;