Skip to content

datapath-windows: extract flow key for RARP frames - #55

Merged
fw2568 merged 1 commit into
dbosoft-mainfrom
windows/rarp-flow-key
Jun 13, 2026
Merged

fw2568 merged 1 commit into
dbosoft-mainfrom
windows/rarp-flow-key

Conversation

@fw2568

@fw2568 fw2568 commented Jun 13, 2026 •

Copy link
Copy Markdown

The Windows kernel flow-key extractor (OvsExtractFlow) populated the ARP key only for EtherType 0x0806 (ARP). A RARP frame (0x8035), which shares the byte-identical arp_eth_header wire format, fell through the ethertype chain with its ARP key left all-zero.

This is a Linux-parity / contract-faithfulness fix, not a new feature. OVS userspace already treats RARP as ARP-format everywhere — the rarp match keyword (lib/ofp-parse.c), lib/flow.c, lib/match.c, nx-match, odp-util — and this driver's own Netlink key encode/decode already handle ETH_TYPE_ARP and ETH_TYPE_RARP identically. The runtime extractor was the one place out of step: a flow written with rarp,... predicates installs but can never match on Windows, whereas it matches on Linux.

Two edits in the existing ARP arm, mirroring Linux (lib/flow.c):

  • Accept ETH_TYPE_RARP alongside ETH_TYPE_ARP.
  • Widen the address-copy opcode gate to the RARP request/reply opcodes (3/4) so the sender/target addresses are populated for RARP frames that carry them, not just the opcode.

Live-validated on a Hyper-V test datapath: with the patched driver, a raw RARP request (op=3, with a non-zero sender address) injected from a guest is matched by a flow dl_type=0x8035,arp_op=3,arp_spa=192.168.99.50 (n_packets climbs) — which requires the extractor to populate both the opcode and the sender address. Ordinary ARP extraction is unchanged.

Scope: extractor-only. set(arp) rewrite on RARP frames and the pre-existing RARPOP_REPLY_NBO NBO-constant typo are intentionally left to separate changes.

The kernel flow-key extractor populated the ARP key only for EtherType
0x0806 (ARP); a RARP frame (0x8035), which shares the ARP wire format, fell
through with its ARP key left zero, so OVN/OpenFlow rules matching RARP
arp_op/arp_spa/etc. could never hit. Accept ETH_TYPE_RARP in the same arm,
and widen the address-copy opcode gate to the RARP request/reply opcodes so
the sender/target addresses are populated too, matching Linux.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Windows datapath flow-key extractor (OvsExtractFlow) so RARP (EtherType 0x8035) frames populate the existing ARP key fields, enabling OpenFlow/OVN matches on RARP arp_op and addresses to work the same way they do on Linux.

Changes:

  • Treat ETH_TYPE_RARP the same as ETH_TYPE_ARP in the extractor, populating flow->arpKey.
  • Extend the ARP-address population gate to include RARP opcodes (RARPOP_REQUEST/RARPOP_REPLY) so arp_spa/tpa and arp_sha/tha are extracted for RARP frames.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@fw2568
fw2568 merged commit df4fe3c into dbosoft-main Jun 13, 2026
2 checks 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