eth: fbnic: split fbnic_disable()

Factor out handling a single nv from fbnic_disable() to make
it reusable for queue ops. Use a __ prefix for the factored
out code. The real fbnic_nv_disable() which will include
fbnic_wrfl() will be added with the qops, to avoid unused
function warnings.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Link: https://patch.msgid.link/20250901211214.1027927-7-kuba@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
Jakub Kicinski 2025-09-01 14:12:06 -07:00 committed by Paolo Abeni
parent 4ddb17c1a2
commit cbfc047429
1 changed files with 25 additions and 21 deletions

View File

@ -2180,31 +2180,35 @@ void fbnic_napi_disable(struct fbnic_net *fbn)
}
}
static void __fbnic_nv_disable(struct fbnic_napi_vector *nv)
{
int i, t;
/* Disable Tx queue triads */
for (t = 0; t < nv->txt_count; t++) {
struct fbnic_q_triad *qt = &nv->qt[t];
fbnic_disable_twq0(&qt->sub0);
fbnic_disable_twq1(&qt->sub1);
fbnic_disable_tcq(&qt->cmpl);
}
/* Disable Rx queue triads */
for (i = 0; i < nv->rxt_count; i++, t++) {
struct fbnic_q_triad *qt = &nv->qt[t];
fbnic_disable_bdq(&qt->sub0, &qt->sub1);
fbnic_disable_rcq(&qt->cmpl);
}
}
void fbnic_disable(struct fbnic_net *fbn)
{
struct fbnic_dev *fbd = fbn->fbd;
int i, j, t;
int i;
for (i = 0; i < fbn->num_napi; i++) {
struct fbnic_napi_vector *nv = fbn->napi[i];
/* Disable Tx queue triads */
for (t = 0; t < nv->txt_count; t++) {
struct fbnic_q_triad *qt = &nv->qt[t];
fbnic_disable_twq0(&qt->sub0);
fbnic_disable_twq1(&qt->sub1);
fbnic_disable_tcq(&qt->cmpl);
}
/* Disable Rx queue triads */
for (j = 0; j < nv->rxt_count; j++, t++) {
struct fbnic_q_triad *qt = &nv->qt[t];
fbnic_disable_bdq(&qt->sub0, &qt->sub1);
fbnic_disable_rcq(&qt->cmpl);
}
}
for (i = 0; i < fbn->num_napi; i++)
__fbnic_nv_disable(fbn->napi[i]);
fbnic_wrfl(fbd);
}