History

bpf: Update the struct_ops of a bpf_link.

By improving the BPF_LINK_UPDATE command of bpf(), it should allow you to conveniently switch between different struct_ops on a single bpf_link. This would enable smoother transitions from one struct_ops to another. The struct_ops maps passing along with BPF_LINK_UPDATE should have the BPF_F_LINK flag.

Kui-Feng Lee committed 3 years ago

Commit aef56f21 parent 8d1608d6 files · +122 −11Browse files

Showing the changes to include/uapi (1 of 6 files). Show all

Unified · Split

include/uapi/linux/bpf.h+16−5
@@ -1555,12 +1555,23 @@ union bpf_attr { · 1554 unmodified lines
1555 1555
1556 struct { /* struct used by BPF_LINK_UPDATE command */1556 struct { /* struct used by BPF_LINK_UPDATE command */
1557 __u32 link_fd; /* link fd */1557 __u32 link_fd; /* link fd */
1558 /* new program fd to update link with */1558 union {
1559 __u32 new_prog_fd;1559 /* new program fd to update link with */
1560 __u32 new_prog_fd;
1561 /* new struct_ops map fd to update link with */
1562 __u32 new_map_fd;
1563 };
1560 __u32 flags; /* extra flags */1564 __u32 flags; /* extra flags */
1561 /* expected link's program fd; is specified only if1565 union {
1562 * BPF_F_REPLACE flag is set in flags */1566 /* expected link's program fd; is specified only if
1563 __u32 old_prog_fd;1567 * BPF_F_REPLACE flag is set in flags.
1568 */
1569 __u32 old_prog_fd;
1570 /* expected link's map fd; is specified only
1571 * if BPF_F_REPLACE flag is set.
1572 */
1573 __u32 old_map_fd;
1574 };
1564 } link_update;1575 } link_update;
1565 1576
1566 struct {1577 struct {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t