mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 14:42:37 +02:00
ice: Do not enable NAPI on q_vectors that have no rings
[ Upstream commiteec903769b] If ice driver has q_vectors w/ active NAPI that has no rings, then this will result in a divide by zero error. To correct it I am updating the driver code so that we only support NAPI on q_vectors that have 1 or more rings allocated to them. See commit13a8cd191a("i40e: Do not enable NAPI on q_vectors that have no rings") for detail. Signed-off-by: Young Xiao <YangX92@hotmail.com> Acked-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
8a35f678e6
commit
d01b26e77a
|
|
@ -4333,8 +4333,12 @@ static void ice_napi_enable_all(struct ice_vsi *vsi)
|
|||
if (!vsi->netdev)
|
||||
return;
|
||||
|
||||
for (q_idx = 0; q_idx < vsi->num_q_vectors; q_idx++)
|
||||
napi_enable(&vsi->q_vectors[q_idx]->napi);
|
||||
for (q_idx = 0; q_idx < vsi->num_q_vectors; q_idx++) {
|
||||
struct ice_q_vector *q_vector = vsi->q_vectors[q_idx];
|
||||
|
||||
if (q_vector->rx.ring || q_vector->tx.ring)
|
||||
napi_enable(&q_vector->napi);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -4817,8 +4821,12 @@ static void ice_napi_disable_all(struct ice_vsi *vsi)
|
|||
if (!vsi->netdev)
|
||||
return;
|
||||
|
||||
for (q_idx = 0; q_idx < vsi->num_q_vectors; q_idx++)
|
||||
napi_disable(&vsi->q_vectors[q_idx]->napi);
|
||||
for (q_idx = 0; q_idx < vsi->num_q_vectors; q_idx++) {
|
||||
struct ice_q_vector *q_vector = vsi->q_vectors[q_idx];
|
||||
|
||||
if (q_vector->rx.ring || q_vector->tx.ring)
|
||||
napi_disable(&q_vector->napi);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user