Skip to content

Comments

ringbuf: Windows support#1849

Merged
lmb merged 1 commit intocilium:mainfrom
lmb:windows-ringbuf
Aug 18, 2025
Merged

ringbuf: Windows support#1849
lmb merged 1 commit intocilium:mainfrom
lmb:windows-ringbuf

Conversation

@lmb
Copy link
Contributor

@lmb lmb commented Aug 15, 2025

No description provided.

@lmb lmb force-pushed the windows-ringbuf branch 2 times, most recently from 70059f5 to 1c86ca9 Compare August 15, 2025 13:03
Signed-off-by: Lorenz Bauer <[email protected]>
@lmb lmb force-pushed the windows-ringbuf branch from 1c86ca9 to b37636d Compare August 15, 2025 14:42
@lmb lmb marked this pull request as ready for review August 18, 2025 08:18
@lmb lmb requested review from a team and florianl as code owners August 18, 2025 08:18
@lmb
Copy link
Contributor Author

lmb commented Aug 18, 2025

@florianl please let me know if you want to review this!

Copy link
Contributor

@florianl florianl left a comment

Choose a reason for hiding this comment

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

Just minor comments. As I don't have access to Windows, I can't test that part.

"github.com/cilium/ebpf/internal"
"github.com/cilium/ebpf/internal/efw"
)

Copy link
Contributor

Choose a reason for hiding this comment

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

To guarantee compatibility between windows and others, maybe we should have an interface for poller and make sure the respective implementations are compatible.

@@ -0,0 +1,75 @@
package ringbuf
Copy link
Contributor

Choose a reason for hiding this comment

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

For consistency, maybe add a build constraint

Suggested change
package ringbuf
//go:build windows
package ringbuf

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is redundant with the file name, no?


prog, events := mustOutputSamplesProg(t,
sampleMessage{size: 5, flags: sys.BPF_RB_NO_WAKEUP}, // Read after timeout
sampleMessage{size: 6, flags: sys.BPF_RB_NO_WAKEUP}, // Discard
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm wondering, where the discard case was dropped.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Discard is currently unsupported on windows, so the helper issues a skip. It’s important to test the wake-up behaviour on windows, and the discard here doesn’t change the observed behaviour at all. So dropping it is the easiest solution.

@@ -0,0 +1,105 @@
package ringbuf
Copy link
Contributor

Choose a reason for hiding this comment

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

For consistency, maybe add a build constraint

Suggested change
package ringbuf
//go:build windows
package ringbuf


"github.com/cilium/ebpf/internal/unix"
)

Copy link
Contributor

Choose a reason for hiding this comment

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

Similar to poller, maybe there should also be an interface for ringbufEventRing so we can make sure all implementations fit here.

@lmb
Copy link
Contributor Author

lmb commented Aug 18, 2025

Thanks! Made an issue for the interface changes, since I don’t have access to a laptop at the moment.

@lmb lmb merged commit ae22611 into cilium:main Aug 18, 2025
31 of 33 checks passed
@lmb lmb deleted the windows-ringbuf branch August 18, 2025 09:26
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