summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2025-09-01 14:12:09 -0700
committerPaolo Abeni <pabeni@redhat.com>2025-09-04 10:19:17 +0200
commit709da681f4dea53993578f4f060f02ccfbeb59c6 (patch)
tree965b0c0b24b06930465797f8174c51bb978f778e
parent8a47d940cf81cf14de48dc80846d29295babffbf (diff)
eth: fbnic: split fbnic_fill()
Factor out handling a single nv from fbnic_fill() to make it reusable for queue ops. Signed-off-by: Jakub Kicinski <kuba@kernel.org> Link: https://patch.msgid.link/20250901211214.1027927-10-kuba@kernel.org Signed-off-by: Paolo Abeni <pabeni@redhat.com>
-rw-r--r--drivers/net/ethernet/meta/fbnic/fbnic_txrx.c33
1 files changed, 18 insertions, 15 deletions
diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c b/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c
index 38dd1afb7005..7694b25ef77d 100644
--- a/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c
+++ b/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c
@@ -2348,27 +2348,30 @@ void fbnic_flush(struct fbnic_net *fbn)
fbnic_nv_flush(fbn->napi[i]);
}
-void fbnic_fill(struct fbnic_net *fbn)
+static void fbnic_nv_fill(struct fbnic_napi_vector *nv)
{
- int i;
-
- for (i = 0; i < fbn->num_napi; i++) {
- struct fbnic_napi_vector *nv = fbn->napi[i];
- int j, t;
+ int j, t;
- /* Configure NAPI mapping and populate pages
- * in the BDQ rings to use for Rx
- */
- for (j = 0, t = nv->txt_count; j < nv->rxt_count; j++, t++) {
- struct fbnic_q_triad *qt = &nv->qt[t];
+ /* Configure NAPI mapping and populate pages
+ * in the BDQ rings to use for Rx
+ */
+ for (j = 0, t = nv->txt_count; j < nv->rxt_count; j++, t++) {
+ struct fbnic_q_triad *qt = &nv->qt[t];
- /* Populate the header and payload BDQs */
- fbnic_fill_bdq(&qt->sub0);
- fbnic_fill_bdq(&qt->sub1);
- }
+ /* Populate the header and payload BDQs */
+ fbnic_fill_bdq(&qt->sub0);
+ fbnic_fill_bdq(&qt->sub1);
}
}
+void fbnic_fill(struct fbnic_net *fbn)
+{
+ int i;
+
+ for (i = 0; i < fbn->num_napi; i++)
+ fbnic_nv_fill(fbn->napi[i]);
+}
+
static void fbnic_enable_twq0(struct fbnic_ring *twq)
{
u32 log_size = fls(twq->size_mask);