Skip to content

Commit c11c731

Browse files
committed
Merge branch 'fix-page-fragment-handling-when-page_size-4k'
Dimitri Daskalakis says: ==================== Fix page fragment handling when PAGE_SIZE > 4K FBNIC operates on fixed size descriptors (4K). When the OS supports pages larger than 4K, we fragment the page across multiple descriptors. While performance testing, I found several issues with our page fragment handling, resulting in low throughput and potential RX stalls. ==================== Link: https://patch.msgid.link/20260324195123.3486219-1-dimitri.daskalakis1@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2 parents 2edfa31 + f3567dd commit c11c731

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

drivers/net/ethernet/meta/fbnic/fbnic_debugfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ static int fbnic_dbg_bdq_desc_seq_show(struct seq_file *s, void *v)
197197
return 0;
198198
}
199199

200-
for (i = 0; i <= ring->size_mask; i++) {
200+
for (i = 0; i < (ring->size_mask + 1) * FBNIC_BD_FRAG_COUNT; i++) {
201201
u64 bd = le64_to_cpu(ring->desc[i]);
202202

203203
seq_printf(s, "%04x %#04llx %#014llx\n", i,

drivers/net/ethernet/meta/fbnic/fbnic_txrx.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,7 @@ static void fbnic_fill_bdq(struct fbnic_ring *bdq)
927927
/* Force DMA writes to flush before writing to tail */
928928
dma_wmb();
929929

930-
writel(i, bdq->doorbell);
930+
writel(i * FBNIC_BD_FRAG_COUNT, bdq->doorbell);
931931
}
932932
}
933933

@@ -2564,7 +2564,7 @@ static void fbnic_enable_bdq(struct fbnic_ring *hpq, struct fbnic_ring *ppq)
25642564
hpq->tail = 0;
25652565
hpq->head = 0;
25662566

2567-
log_size = fls(hpq->size_mask);
2567+
log_size = fls(hpq->size_mask) + ilog2(FBNIC_BD_FRAG_COUNT);
25682568

25692569
/* Store descriptor ring address and size */
25702570
fbnic_ring_wr32(hpq, FBNIC_QUEUE_BDQ_HPQ_BAL, lower_32_bits(hpq->dma));
@@ -2576,7 +2576,7 @@ static void fbnic_enable_bdq(struct fbnic_ring *hpq, struct fbnic_ring *ppq)
25762576
if (!ppq->size_mask)
25772577
goto write_ctl;
25782578

2579-
log_size = fls(ppq->size_mask);
2579+
log_size = fls(ppq->size_mask) + ilog2(FBNIC_BD_FRAG_COUNT);
25802580

25812581
/* Add enabling of PPQ to BDQ control */
25822582
bdq_ctl |= FBNIC_QUEUE_BDQ_CTL_PPQ_ENABLE;

0 commit comments

Comments
 (0)