Skip to content

Honor DTO_SUBMIT_BOF only on work queues configured with block-on-fault - #45

Merged
byrnedj merged 1 commit into
intel:mainfrom
byrnedj:wq-bof
Oct 29, 2026
Merged

byrnedj merged 1 commit into
intel:mainfrom
byrnedj:wq-bof

Conversation

@byrnedj

@byrnedj byrnedj commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

A descriptor carrying IDXD_OP_FLAG_BOF is rejected with INVALID_FLAGS (0x11) by a work queue configured with block_on_fault=0, so a caller that asked for DTO_SUBMIT_BOF got a guaranteed failure on such a queue and had to know the queue configuration itself. In practice this means an application has to pick its flags per deployment, and gets silent software fallback when it guesses wrong.

This records each work queue's block_on_fault attribute at discovery (via accel-config, or the sysfs attribute on the DTO_WQ_LIST path) and sets BOF on explicit submits and batch members only when the queue allows it. On a queue without block-on-fault the flag is dropped and a page fault stops the operation partway (status 0x03), exactly as without the flag, so callers handle one failure mode instead of two. DTO_SUBMIT_BOF thus means "block on faults when the work queue allows it". The init trace reports the attribute per work queue.

Batch members settle BOF at dto_batch_submit, in the same place CC is already stripped for devices without cache-control support, so a batch built before the queue is known gets the right flags.

test_async_bof now learns the queue's setting from a BOF copy into untouched pages (completes with block-on-fault, stops at the first untouched page without) and checks that a BOF submit is never rejected. The batch case uses a cold destination so the member is actually stopped and redone by dto_batch_poll on a block_on_fault=0 queue. The documented 0x11 row in dto.h is removed; README and TESTING.md are updated.

A descriptor carrying IDXD_OP_FLAG_BOF is rejected with INVALID_FLAGS
(0x11) by a work queue configured with block_on_fault=0, so a caller that
asked for DTO_SUBMIT_BOF got a guaranteed failure on such a queue and had
to know the queue configuration itself. Record each work queue's
block_on_fault attribute at discovery (accel-config, or the sysfs
attribute for DTO_WQ_LIST) and set BOF on explicit submits and batch
members only when the queue allows it. On a queue without block-on-fault
the flag is dropped and a page fault stops the operation partway (0x03),
exactly as without the flag, so callers handle one failure mode instead
of two. The init trace reports the attribute per work queue.

test_async_bof now learns the queue's setting from a BOF copy into
untouched pages (completes with block-on-fault, stops at the first
untouched page without) and checks that a BOF submit is never rejected;
the batch case uses a cold destination so the member is actually
stopped and redone by dto_batch_poll on a block_on_fault=0 queue.

@jsydir jsydir left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All looks good

@byrnedj
byrnedj merged commit 1b9477d into intel:main Oct 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants