Add/Parse Geneve Option for Multicast Tag
Maintainer thường phản hồi trong vòng 2 ngày
@zeeshanlakhani đang làm issue này rồi.
Từ ngày 25/5/2025.
- #847 của @FelixMcFelix — đã đóng, không merge
Đánh giá
Issue này chưa được đánh giá.
Mô tả
With the additional Geneve option added as part of Multicast replication in https://github.com/oxidecomputer/dendrite/pull/14, we need to update the Geneve engine in OPTE to parse and set this option.
Here's the P4 code showing the additions:
const bit<7> GENEVE_OPT_OXIDE_MCAST = 0x01;
/* Geneve option for an `mcast_tag`.
* This is a 2-bit field that indicates the type of
* multicast traffic:
* 0 - Replicate packets to ports set for external multicast traffic
* 1 - Replicate packets to ports set for underlay multicast traffic
* 2 - Replicate packets to ports set for underlay and external multicast
traffic (bifurcated)
*
* The rest of the option is reserved.
*/
header geneve_opt_mcast_h {
bit<2> mcast_tag;
bit<30> reserved;
}
struct geneve_opt_headers_t {
geneve_opt_h ox_external_tag;
geneve_opt_h ox_external_tag;
// Multicast-specific options
geneve_opt_mcast_h ox_mcast_tag;
}
Here's a test helper used in packet testing to generate the option as part of a Geneve (encapsulated) packet:
/// Build a Geneve packet with a possible multicast tag.
pub fn gen_geneve_packet_with_mcast_tag(
src: Endpoint,
dst: Endpoint,
inner_type: u16,
vni: u32,
tag_ingress: bool,
mcast_tag: Option<u8>, // New parameter for multicast tag
payload: &[u8],
) -> Packet {
let udp_stack = match src.get_ip("src").unwrap() {
IpAddr::V4(_) => {
vec![inner_type, ipv4::IPPROTO_UDP.into(), eth::ETHER_IPV4]
}
IpAddr::V6(_) => {
vec![inner_type, ipv6::IPPROTO_UDP.into(), eth::ETHER_IPV6]
}
};
let mut pkt = Packet::gen(src, dst, udp_stack, Some(payload)).unwrap();
let geneve = pkt.hdrs.geneve_hdr.as_mut().unwrap();
geneve.vni = vni;
match (tag_ingress, mcast_tag) {
(true, Some(tag)) if tag < 3 => {
geneve.opt_len = 2;
// Multicast tag option
#[rustfmt::skip]
geneve.options.extend_from_slice(&[
// First 2 bytes: Geneve option class (0x0129)
// The OXIDE vendor-specific class identifier
0x01, 0x29,
// Third byte: Critical bit (0) + Option type (1)
// Type 1 represents multicast tagged packets
0x01,
// Fourth byte: Option(s) length
0x01,
// Fifth byte: Tag value (encoded in the data)
(tag & 0x03) << 6,
// Sixth byte: reserved
0x00,
// Seventh byte
0x00,
// Eighth byte
0x00,
]);
let extra_bytes = geneve.options.len() as u16;
match src.get_ip("src").unwrap() {
IpAddr::V4(_) => {
pkt.hdrs.ipv4_hdr.as_mut().unwrap().ipv4_total_len +=
extra_bytes
}
IpAddr::V6(_) => {
pkt.hdrs.ipv6_hdr.as_mut().unwrap().ipv6_payload_len +=
extra_bytes
}
}
pkt.hdrs.udp_hdr.as_mut().unwrap().udp_len += extra_bytes;
}
(true, Some(_)) => {
// Multicast tag is not valid
panic!("Multicast tag must be less than 3");
}
(true, None) => {
// External packet option
geneve.opt_len = 1;
#[rustfmt::skip]
geneve.options.extend_from_slice(&[
// First 2 bytes: Geneve option class (0x0129)
// The OXIDE vendor-specific class identifier
0x01, 0x29,
// Third byte: Critical bit (0) + Option type (1)
0x00,
// reserved + body len
0x00,
]);
let extra_bytes = geneve.options.len() as u16;
match src.get_ip("src").unwrap() {
IpAddr::V4(_) => {
pkt.hdrs.ipv4_hdr.as_mut().unwrap().ipv4_total_len +=
extra_bytes
}
IpAddr::V6(_) => {
pkt.hdrs.ipv6_hdr.as_mut().unwrap().ipv6_payload_len +=
extra_bytes
}
}
pkt.hdrs.udp_hdr.as_mut().unwrap().udp_len += extra_bytes;
}
_ => {}
}
pkt
}
- Ngôn ngữ chính
- Rust
- Star
- 82
- Fork
- 16
- Merge trung bình
- 3 ngày 6 giờ
- Pull request đã merge (30 ngày)
- 11
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
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/opte
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
oxidecomputer/opte#1125 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
`PortBuilder::add_layer` doesn't need a mutexCó thể đã có người làm @FelixMcFelix đã nhận 54 ngày trước. Đang mởcleanup
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
oxidecomputer/opte#1061 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
oxidecomputer/opte#1052 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
oxidecomputer/opte#341 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
`Layer` creation should not unwrap `KStatNamed`Có thể đã có người làm @FelixMcFelix đã nhận 54 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 40/100
oxidecomputer/opte#1126 ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của oxidecomputer/opte
Issue tương tự
-
Độ 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
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
qingjian-team/qingjian#1181 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug P2: medium
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
leepokai/Codync#618 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug] StreamLifecycleConfig clamps post-TTFT stream timeouts to remaining admission budgetCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
lbjlaq/Antigravity-Manager#4063 ·
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 76/100
solutionscay/skiff#297 ·
Maintainer thường phản hồi trong vòng 1 ngày