Skip to content

Commit a581652

Browse files
large_buf: use enum large_buf_action for action field
1 parent aa23797 commit a581652

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

bpf/generictracer/large_buf_tailcall.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
#include <bpfcore/vmlinux.h>
77

8+
#include <common/common.h>
89
#include <common/connection_info.h>
910
#include <common/scratch_mem.h>
1011

@@ -17,7 +18,7 @@ typedef struct large_buf_emit_state {
1718
u8 batch_iter;
1819
u8 packet_type;
1920
u8 direction;
20-
u8 action;
21+
enum large_buf_action action;
2122
} large_buf_emit_state_t;
2223

2324
SCRATCH_MEM_TYPED(large_buf_emit_state, large_buf_emit_state_t)

bpf/generictracer/protocol_http.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ static __always_inline int http_send_large_buffer(void *ctx,
376376
state->batch_iter = 0;
377377
state->packet_type = packet_type;
378378
state->direction = direction;
379-
state->action = (u8)action;
379+
state->action = action;
380380

381381
bpf_tail_call_static(ctx, &jump_table, k_tail_large_buf_emit_continue);
382382
return 0;
@@ -835,8 +835,7 @@ int obi_large_buf_emit_continue(struct pt_regs *ctx) {
835835
large_buf->packet_type = state->packet_type;
836836
large_buf->direction = state->direction;
837837
large_buf->conn_info = info->conn_info;
838-
large_buf->action =
839-
state->batch_iter == 0 ? (enum large_buf_action)state->action : k_large_buf_action_append;
838+
large_buf->action = state->batch_iter == 0 ? state->action : k_large_buf_action_append;
840839
large_buf->kind = k_large_buf_layer_app;
841840
large_buf->tp = info->tp;
842841

0 commit comments

Comments
 (0)