iovisor / iovisor/bcc

Send network packets to the user space program with Ring buffers `ringbuf_output`

Open
#4,103 0 comments 3 reactions 0 assignees View on GitHub
Dominant language
C
Stars
22.7k
Forks
4.1k
Avg merge
10d 4h
Merged PRs (30d)
3

Description

Hello

Please, does anyone know how, in TC and XDP programs, can we send the network packet to the user space program using Ring Buffers (`ringbuf_output`)?.
Using perf buffers, it's possible by using the `perf_submit_skb` method while `perf_submit` allows to send only a data struct we define.

I'm trying to include an `unsigned char *` pointer in my struct (which I will send to the user space program using `ringbuf_output` but I don't manage to copy the network packet inside the struct. Doing so, the struct memory space will contain the value of the pointer (memory address of netwokr packet) but not the network packet itself. Regarding to the linux documentation, ring buffers should allow sending entire network packet to the user space.

In the BCC reference guide and by browsing the libbpf library, I saw that when opening a ring buffer with `open_ring_buffer`, there is a `ctx` argument to pass but there is no information on how to use it. Does this argument allow to solve my problem?

Could you provide help please?

Below some details about my environment:
```
bcc v0.24.0
kernel 5.11.0
Ubuntu 20.10
```

Regards
Raouf

Contributor guide

No contributing guide indexed for this repository

Research direction

The issue names the BCC reference guide, libbpf, open_ring_buffer, perf_submit_skb, perf_submit, and ringbuf_output, but no repository file or test. Start by reading the ring-buffer documentation and relevant API entry points, then determine whether packet delivery is supported and what guidance is missing. Done would require a settled, documented usage path rather than an unanswered help request.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, linux
Domain
networking
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.