Commit Graph

20 Commits

Author SHA1 Message Date
云微
b1d81046d7 ci: cover all libbpf Makefile tutorials (#213)
* ci: cover all libbpf Makefile tutorials

* ci: build modules against HWE headers

---------

Co-authored-by: LinuxDev9002 <i@littlefisher.me>
2026-07-14 05:25:47 -07:00
云微
37375ff87e docs: add generated tutorial compatibility matrix (#212)
* docs: declare tutorial compatibility requirements

* docs: generate tutorial compatibility matrix

* fix: correct BPF Arena minimum kernel

* refactor: simplify compatibility validation

---------

Co-authored-by: LinuxDev9002 <i@littlefisher.me>
2026-07-14 05:00:48 -07:00
云微
3a722c03d5 feat: add tcx and bpf token tutorials (#203)
* feat: add tcx and bpf token tutorials

* docs: auto-generate documentation

* docs: rewrite tcx and bpf_token tutorials with richer content and consistent style

Rewrote all 4 README files (EN/ZH for both tutorials) to match the
existing tutorial style with detailed background, full code listings,
step-by-step explanations, comparison tables, and proper references.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* style: replace em dashes with colons, commas, and parentheses

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* docs: auto-generate documentation

* ci: add tcx and bpf_token builds to CI; simplify execl in token_userns_demo

- Add make targets for src/50-tcx and src/features/bpf_token to the
  test-libbpf CI workflow.
- Replace four separate execl() calls with a single execv() using a
  dynamically built argv array, reducing complexity and eliminating
  CodeFactor command-injection false positives.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* ci: fix mkdocs path in trigger-sync workflow

Use .venv/bin/mkdocs instead of bare mkdocs, since make install
puts it inside a virtualenv.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: LinuxDev9002 <linuxdev8883@example.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 21:23:23 -07:00
github-actions[bot]
9d08062cb7 fix: Update struct references from config to dynptr_cfg in README files 2026-02-01 00:34:43 +00:00
github-actions[bot]
c42ba4f9ab Add BPF dynptr TC demo implementation
- Implement BPF program for TC ingress using dynptrs to safely parse packet headers and manage variable-length ringbuf records.
- Create user-space loader for the BPF program, allowing configuration of blocked ports and snapshot lengths for TCP payloads.
- Define necessary data structures and constants in header file for both BPF and user-space contexts.
- Add a comprehensive test script to validate functionality, including basic packet capture and port blocking tests.
2026-02-01 00:34:43 +00:00
Littlefisher
42884e3cef docs: Revise README files for clarity on extending kernel behavior with BPF struct_ops 2026-01-11 23:39:46 -08:00
Littlefisher
34f690385e docs: Update README files to include information on extending GPU driver behavior with eBPF and the gpu_ext project 2026-01-11 23:27:20 -08:00
Littlefisher
48afb3265d docs: Enhance README files with examples of GPU scheduling and memory offloading using BPF struct_ops 2026-01-11 02:41:31 -08:00
Littlefisher
cbc6658f80 Add Chinese translation for eBPF tutorial on BPF struct_ops
This commit introduces a comprehensive Chinese translation of the eBPF tutorial focused on using BPF struct_ops to extend kernel subsystems. The tutorial covers the challenges of kernel development, the benefits of using BPF struct_ops, and provides detailed examples of implementing a kernel module, BPF program, and user-space loader. The content aims to enhance accessibility for Chinese-speaking developers interested in eBPF and kernel programming.
2026-01-11 02:28:21 -08:00
github-actions[bot]
8372e9bf1c feat: Enhance test_3 to safely read from kernel buffer and return length 2025-11-16 06:19:28 +00:00
github-actions[bot]
86c2f723f0 feat: Update struct_ops to change test_3 return type to int and add BPF helper support 2025-11-15 23:54:20 +00:00
github-actions[bot]
540ce67c47 fix: Remove bpf_printk calls from struct_ops BPF programs to comply with restrictions 2025-11-15 22:24:51 +00:00
github-actions[bot]
5ce10be3e1 feat: Implement BPF struct_ops example with custom kernel module and user-space loader 2025-11-10 18:30:48 +00:00
Littlefisher
2c9870bf83 feat: Add initial implementation of struct_ops BPF program and kernel module with kfunc support 2025-11-08 15:51:36 -08:00
yunwei37
277ecbaf9d Add HID-BPF tutorial and implementation for virtual mouse input modification
- Introduced a comprehensive tutorial in README.md explaining how to fix broken HID devices using eBPF without kernel patches.
- Implemented a userspace program (hid-input-modifier.c) that creates a virtual HID mouse using the uhid interface and sends synthetic mouse events.
- Developed a BPF program (hid-input-modifier.bpf.c) that intercepts HID events and modifies mouse movement data, effectively doubling the X and Y movement.
- Created necessary header files (hid_bpf.h, hid_bpf_defs.h, hid_bpf_helpers.h) to define structures and helper functions for the BPF program.
- Added functionality to find and manage the virtual HID device, ensuring seamless integration with the BPF program.
2025-10-05 22:40:58 -07:00
yunwei37
a2e7b20d63 Add eBPF tutorial templates and update SUMMARY files
- Created SUMMARY.md.template and SUMMARY.zh.md.template for eBPF tutorial.
- Updated generate_toc.py to generate table of contents for English and Chinese versions.
- Added configuration files for new eBPF examples, categorizing them by level and type.
- Updated SUMMARY.md and SUMMARY.zh.md to reflect new lessons and reorganized sections.
- Introduced new features related to GPU and tracing in the tutorial.
2025-10-05 20:56:50 -07:00
yunwei37
f3c4a3ee64 Refactor test output in arena_list.c to remove redundant print statements
- Removed unnecessary print statements for arena sum and number of elements in the test_arena_list_add_del function.
- Simplified output to focus on essential test results, improving clarity and conciseness of the test logs.
2025-10-06 06:24:08 +08:00
yunwei37
0e19d48331 docs: add comprehensive BPF Arena tutorial detailing features, use cases, and examples 2025-10-04 23:15:03 -07:00
yunwei37
b88ab2ae0e Add BPF Workqueues support and example
- Introduced BPF workqueues to enable asynchronous work from BPF programs, allowing deferred processing, non-blocking operations, and sleepable contexts for long-running tasks.
- Added README.md to document the BPF workqueues, including use cases, technical architecture, and code examples.
- Created bpf_experimental.h header file to define necessary BPF workqueue functions and structures.
- Implemented a simple BPF workqueue example (wq_simple) demonstrating the initialization, scheduling, and execution of work in a separate context.
- Developed a userspace test (wq_simple.c) to verify the functionality of the BPF workqueue by triggering a syscall and checking the execution results.
2025-10-04 22:49:09 -07:00
yunwei37
ba1a6a472e bpf: Implement arena list management with allocation and deletion
This commit introduces a new BPF program that manages an arena list, allowing for the addition and deletion of elements. The following changes were made:

- Added `arena_list.bpf.c` to implement BPF functions for adding and deleting elements in an arena list.
- Created `arena_list.c` for user-space testing of the BPF program, including functions to sum elements and validate the arena list operations.
- Introduced `bpf_arena_alloc.h` and `bpf_arena_common.h` for memory allocation and common definitions related to arena management.
- Defined `bpf_arena_list.h` to establish the structure of the arena list nodes and heads.
- Added `bpf_experimental.h` to include experimental BPF features and helper functions for object management.

These changes enhance the BPF capabilities for managing memory in a structured way, facilitating efficient allocation and deallocation of resources.
2025-10-04 21:39:24 -07:00