Skip to content

fix(storage): prepare integration-owned packet bytes before emission - #48

Merged
fslongjin merged 1 commit into
DragonOS-Community:dragonos/v0.12.0from
fslongjin:codex/mm-271-cpu-storage
Oct 24, 2026
Merged

fslongjin merged 1 commit into
DragonOS-Community:dragonos/v0.12.0from
fslongjin:codex/mm-271-cpu-storage

Conversation

@fslongjin

Copy link
Copy Markdown
Member

Large ingress, fragment and reassembly buffers currently use Vec backing even when an integration can provide noncontiguous physical storage. This change adds a shared, fallible byte owner for these linear buffers and preserves the integration allocator across transfers and reuse. Small heap buffers keep their existing representation.

Allocation failures return before emission and retain pending IPv4/6LoWPAN data for retry. Integration-owned storage retires at existing lifetime boundaries; default heap reuse and no-alloc buffers remain supported. The no-alloc IPv4 fragment path also uses the correct mark when no filter exists.

Validation: 842 library tests pass, including ownership transfer, allocation rollback, assembly expiry and IPv4/6LoWPAN failure/retry tests. Four additional checks pass: no-alloc IPv4 fragmentation, DragonOS feature configuration, and alloc/no-alloc 6LoWPAN. Independent adversarial review completed.

This is the protocol dependency for a DragonOS change covering CPU packet allocation and ownership. That companion will pin the exact public commit.

Use one fallible linear byte owner for ingress scratch, fragmentation and reassembly. Preserve the allocation policy across ownership transfer and release integration-owned backing at existing retirement points without changing default heap reuse.

Reject preparation failures before emission and retain pending data for IPv4 and 6LoWPAN retry. Keep no-alloc operation and fix the IPv4 fragment mark reference in the no-filter configuration. Add ownership, rollback, expiry and protocol retry coverage.

Validation: 842 library tests pass, including IPv4 and 6LoWPAN allocation-failure retries; no-alloc IPv4, exact DragonOS features, and alloc/no-alloc 6LoWPAN checks pass. Independent adversarial review completed.
Signed-off-by: longjin <longjin@dragonos.org>
@fslongjin

Copy link
Copy Markdown
Member Author

@codex review

@fslongjin
fslongjin merged commit 51cf0f2 into DragonOS-Community:dragonos/v0.12.0 Oct 24, 2026
13 checks passed
fslongjin added a commit to DragonOS-Community/DragonOS that referenced this pull request Oct 24, 2026
* fix(kernel): remove exec and network high-order CPU allocations

Store exec strings in bounded, fallible page chunks before the exec
transaction, enforcing Linux argument limits and sharing frozen owners
across stack construction, shebang handling, fork and proc cmdline reads.
Avoid full-size CString vectors and argument deep copies.

Allocate network CPU payloads through the existing CpuBuffer ownership
and retirement paths. Cover physical paired TX, bridge delivery,
namespace fragment reassembly, TCP input and RAW/ICMP work. Reuse the
existing prepared queues and output reservations, reserve before emit,
and preserve one receipt across changed-length preparation failures.
Keep hardware DMA allocation separate and account actual paged metadata
capacity without adding a global allocation ledger.

Pin the public smoltcp PacketBytes implementation, which supplies fallible
storage for ingress, fragmentation and reassembly, preserves pending data
when preparation fails, and fixes the no-alloc IPv4 fragment mark build.

Reject cross-superblock copy_file_range calls with EXDEV before EOF
clipping so tools can fall back to reads for dynamic pseudo-files. Compare
superblock identity through mount wrappers rather than filesystem paths.

Validation:
- make fmt and default/mm_selftest x86_64 kernel builds passed.
- RISC-V and LoongArch default/mm_selftest compile checks passed.
- Default virtio-net and e1000e guests: 126 cases each, zero skips;
  TCP 512 KiB and UDP 50000-byte payload checks passed on both devices.
- mm_selftest focused guest: 304 cases, zero skips.
- OpenCode tools/session recovery and fragmentation: 40 stages,
  140 cases passed, with 42086 DMA32 free heads after churn.
- CFR and exec Linux oracles and guest regressions passed; actual cat
  falls back after EXDEV and reads the complete dynamic report.
- smoltcp: 842 tests and four alloc/no-alloc feature checks passed;
  source harnesses: exec 12, defrag/PagedVec 41, TCP input 16 passed.
- Independent design and implementation reviews completed, including
  allocation rollback, ownership, accounting and staged-content checks.

Dependency: DragonOS-Community/smoltcp#48.
Signed-off-by: longjin <longjin@dragonos.org>

* build(kernel): pin merged smoltcp packet storage implementation

Update the manifest and lockfile to the squash commit of smoltcp PR #48.
The merged dependency tree is identical to the previously validated
implementation. No other dependency versions or kernel behavior change.

Validation: compared dependency trees with no differences; make kernel
passed with the merged revision; git diff --cached --check passed.

Signed-off-by: longjin <longjin@dragonos.org>

---------

Signed-off-by: longjin <longjin@dragonos.org>
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.

1 participant