Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce bpf tail call to increase the size of grpc parsing loop #978

Merged
merged 7 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion bpf/http2_grpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include "bpf_endian.h"
#include "http_types.h"

#define MIN_HTTP2_SIZE 24 // Preface PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n https://datatracker.ietf.org/doc/html/rfc7540#section-3.5
#define HTTP2_GRPC_PREFACE "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n"

#define FRAME_HEADER_LEN 9
Expand Down
6 changes: 4 additions & 2 deletions bpf/http_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ int BPF_KPROBE(kprobe_tcp_sendmsg, struct sock *sk, struct msghdr *msg, size_t s
u64 sock_p = (u64)sk;
bpf_map_update_elem(&active_send_args, &id, &s_args, BPF_ANY);
bpf_map_update_elem(&active_send_sock_args, &sock_p, &s_args, BPF_ANY);
handle_buf_with_connection(&s_args.p_conn, buf, size, NO_SSL, TCP_SEND, orig_dport);
handle_buf_with_connection(ctx, &s_args.p_conn, buf, size, NO_SSL, TCP_SEND, orig_dport);
} else {
bpf_dbg_printk("can't find iovec ptr in msghdr, not tracking sendmsg");
}
Expand Down Expand Up @@ -468,7 +468,9 @@ int BPF_KRETPROBE(kretprobe_tcp_recvmsg, int copied_len) {
if (buf) {
copied_len = read_msghdr_buf((void *)args->iovec_ptr, buf, copied_len);
if (copied_len) {
handle_buf_with_connection(&info, buf, copied_len, NO_SSL, TCP_RECV, orig_dport);
handle_buf_with_connection(ctx, &info, buf, copied_len, NO_SSL, TCP_RECV, orig_dport);
} else {
bpf_dbg_printk("Not copied anything");
}
}
} else {
Expand Down
Loading
Loading