[parser] top-level action declarations (and out/inout write-back on action calls)
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
Hướng nghiên cứu
Start in p4/src/parser.rs at the top-level parser arm and parse_action, then inspect codegen/rust/src/statement.rs where lvalue arguments are cloned. Trace existing action parsing and code generation tests to find how top-level declarations and parameter write-back are covered. Done means top-level actions parse and out/inout mutations are reflected at call sites.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
This issue stems from oxidecomputer/sidecar-lite#152, where the IPv4 TTL decrement plus RFC 1624 incremental checksum update had to be copy-pasted into three P4 controls (router, NAT ingress, and mcast decap). In the review, @rcgoodfellow asked for a top-level action (declared once, called from each control). However, x4c does not support this today, so I was stuck with using a control ipv4_ttl_decrement(inout ipv4_h ip) with a TODO pointing here.
Two things block this fix in sidecar-lite (at aa0d3c8):
-
The parser has no top-level
actionarm. The keyword falls through_ => {}, without an error, andparse_actionis only reachable from inside a control body. -
Even once top-level actions can be parsed, an action call wouldn't write
out/inoutarguments back as is. When codegen'ed, the Rust output.clone()s every lvalue argument before the call, meaning that mutations inside the action exist only on the copy. Actions mutatinghdr/metadata work currently because the control's own parameters are passed through by reference first. This clone only becomes an issue for an action's declared parameters.
- Ngôn ngữ chính
- Rust
- Star
- 140
- Fork
- 14
- Merge trung bình
- 3 ngày 18 giờ
- Pull request đã merge (30 ngày)
- 1
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của oxidecomputer/p4
-
Resubmit-based user loadable programsCó thể làm lại được @Robby-work đã nhận 71 ngày trước và không có pull request nào đang mở. Đang mở
oxidecomputer/p4#275 · 1 người được giao ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
oxidecomputer/p4#193 · 1 bình luận ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
oxidecomputer/p4#192 · 1 bình luận ·
-
bug front-end
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
oxidecomputer/p4#159 ·
-
Dependency DashboardĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 20/100
oxidecomputer/p4#71 ·
Tất cả issue của oxidecomputer/p4
Issue tương tự
-
area: cli good first issue type: feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
[Bug] Windows Ghidra provider rejects a PATH-only JDK: bare `java.exe` probe fails with Win32 87Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
renaming a provider to a taken name fails with a raw sql errorCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởarea:storage kind:bug priority:p3 ready
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug bugfix
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
storytold/photocraft#16975 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
expo/exact#1716 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày