This is an automated email from the ASF dual-hosted git repository.

liuhan pushed a commit to branch tmp_disable_reading
in repository https://gitbox.apache.org/repos/asf/skywalking-rover.git


The following commit(s) were added to refs/heads/tmp_disable_reading by this 
push:
     new dae832f  enable the socket queue
dae832f is described below

commit dae832f71cc5ac2dc0d5d4bcb4c629d6e6a6463a
Author: mrproliu <[email protected]>
AuthorDate: Sat Dec 21 13:57:59 2024 +0800

    enable the socket queue
---
 bpf/include/queue.h       | 22 +++++++++++-----------
 pkg/tools/btf/queue.go    |  1 -
 pkg/tools/ip/conntrack.go |  3 ---
 3 files changed, 11 insertions(+), 15 deletions(-)

diff --git a/bpf/include/queue.h b/bpf/include/queue.h
index 1dce8e3..c6b532c 100644
--- a/bpf/include/queue.h
+++ b/bpf/include/queue.h
@@ -36,26 +36,26 @@ struct {
 static __always_inline void *rover_reserve_buf(void *map, __u64 size) {
        static const int zero = 0;
 
-//     if (bpf_core_enum_value_exists(enum bpf_func_id,
-//                                    BPF_FUNC_ringbuf_reserve))
-//             return bpf_ringbuf_reserve(map, size, 0);
+       if (bpf_core_enum_value_exists(enum bpf_func_id,
+                                      BPF_FUNC_ringbuf_reserve))
+               return bpf_ringbuf_reserve(map, size, 0);
 
        return bpf_map_lookup_elem(&rover_data_heap, &zero);
 }
 
 static __always_inline void rover_discard_buf(void *buf)
 {
-//     if (bpf_core_enum_value_exists(enum bpf_func_id,
-//                                    BPF_FUNC_ringbuf_discard))
-//             bpf_ringbuf_discard(buf, 0);
+       if (bpf_core_enum_value_exists(enum bpf_func_id,
+                                      BPF_FUNC_ringbuf_discard))
+               bpf_ringbuf_discard(buf, 0);
 }
 
 static __always_inline long rover_submit_buf(void *ctx, void *map, void *buf, 
__u64 size) {
-//     if (bpf_core_enum_value_exists(enum bpf_func_id,
-//                                    BPF_FUNC_ringbuf_submit)) {
-//             bpf_ringbuf_submit(buf, 0);
-//             return 0;
-//     }
+       if (bpf_core_enum_value_exists(enum bpf_func_id,
+                                      BPF_FUNC_ringbuf_submit)) {
+               bpf_ringbuf_submit(buf, 0);
+               return 0;
+       }
 
        return bpf_perf_event_output(ctx, map, BPF_F_CURRENT_CPU, buf, size);
 }
\ No newline at end of file
diff --git a/pkg/tools/btf/queue.go b/pkg/tools/btf/queue.go
index 5a16e51..96e40c8 100644
--- a/pkg/tools/btf/queue.go
+++ b/pkg/tools/btf/queue.go
@@ -49,7 +49,6 @@ func isRingbufAvailable() bool {
                buf.Close()
 
                ringbufAvailable = err == nil
-               ringbufAvailable = false
 
                if ringbufAvailable {
                        log.Infof("detect the ring buffer is available in 
current system for enhancement of data queue")
diff --git a/pkg/tools/ip/conntrack.go b/pkg/tools/ip/conntrack.go
index b1357cd..5b11c6b 100644
--- a/pkg/tools/ip/conntrack.go
+++ b/pkg/tools/ip/conntrack.go
@@ -36,9 +36,6 @@ var numberStrategies = []struct {
 }{{
        name:  "tcp",
        proto: syscall.IPPROTO_TCP,
-}, {
-       name:  "udp",
-       proto: syscall.IPPROTO_UDP,
 }}
 
 type ConnTrack struct {

Reply via email to