From: Jakub Kicinski Date: Mon, 1 Sep 2025 21:12:06 +0000 (-0700) Subject: eth: fbnic: split fbnic_disable() X-Git-Tag: v6.18-rc1~132^2~259^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cbfc047429ee8a3c726ca44fcc63bd85faa250a2;p=thirdparty%2Fkernel%2Fstable.git 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 Link: https://patch.msgid.link/20250901211214.1027927-7-kuba@kernel.org Signed-off-by: Paolo Abeni --- diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c b/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c index dc0735b20739e..7d6bf35acfd47 100644 --- a/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c +++ b/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c @@ -2180,31 +2180,35 @@ void fbnic_napi_disable(struct fbnic_net *fbn) } } -void fbnic_disable(struct fbnic_net *fbn) +static void __fbnic_nv_disable(struct fbnic_napi_vector *nv) { - struct fbnic_dev *fbd = fbn->fbd; - int i, j, t; + int i, t; - 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]; - /* 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); + } - 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]; - /* 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); - } + 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; + + for (i = 0; i < fbn->num_napi; i++) + __fbnic_nv_disable(fbn->napi[i]); fbnic_wrfl(fbd); }