]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
eth: fbnic: split fbnic_disable()
authorJakub Kicinski <kuba@kernel.org>
Mon, 1 Sep 2025 21:12:06 +0000 (14:12 -0700)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 4 Sep 2025 08:19:17 +0000 (10:19 +0200)
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>
drivers/net/ethernet/meta/fbnic/fbnic_txrx.c

index dc0735b20739e92741defdcdf93d29408522fdff..7d6bf35acfd47e206fd8d9738a54131969c0f2a8 100644 (file)
@@ -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);
 }