Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a0bf4c6

Browse files
ON-16915: Reduce chance of overflow with shared queue
This aligns sizing of the kernel EVQ with the number of outstanding buffers from userspace. A follow up change will properly fix this by linking buffer post to EVQ space.
1 parent 4087b64 commit a0bf4c6

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

‎src/lib/ciul/efct_ubufs.c‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -557,8 +557,13 @@ int efct_ubufs_init(ef_vi* vi, ef_pd* pd, ef_driver_handle pd_dh)
557557
}
558558

559559
/* TODO ON-16686 get this limit from the design parameter DP_RX_BUFFER_FIFO_SIZE,
560-
* perhaps allow configuration to a smaller value to reduce working set */
561-
ubufs->nic_fifo_limit = 128;
560+
* perhaps allow configuration to a smaller value to reduce working set.
561+
* The current value here is selected such that completions for a full
562+
* set of buffers will not exceed the kernel EVQ size. Overflow is still
563+
* possible if the kernel poll does not keep up as the user space code
564+
* judges fill level based on RX buffer fill, so the hw fifo can be empty
565+
* without the kernel EVQ having been drained. */
566+
ubufs->nic_fifo_limit = 64;
562567
ubufs->pd = pd;
563568
ubufs->pd_dh = pd_dh;
564569
ubufs->is_shrub_token_set = false;

‎src/lib/efhw/ef10ct/aux_ef10ct.c‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,12 @@ static int ef10ct_nic_create_shared_evq(struct efhw_nic *nic, int shared_ix,
335335
{
336336
struct efhw_nic_ef10ct *ef10ct = nic->arch_extra;
337337
struct efhw_nic_ef10ct_evq *ef10ct_evq;
338-
uint page_order = 0; /* TODO: What should the size be? */
338+
/* For the queue that just receives flushes we don't need much space, so
339+
* just use minimum size. At the moment we don't have a way to sync RX
340+
* buffer posting with EVQ poll, so we need to size the EVQ to cope with the
341+
* maximum number of outstanding RX events for queues that handle RX evs.
342+
* We set the queue as big as possible here. */
343+
uint page_order = shared_ix == EF10CT_SHARED_NO_RX_EVS ? 0 : 6;
339344
int evq_id, rc, evq_num;
340345
struct ef10ct_shared_kernel_evq *shared_evq = &ef10ct->shared[shared_ix];
341346
irq_handler_t handler;

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /