Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
  • Loading branch information
Geliang Tang committed Oct 23, 2024
1 parent f74e851 commit 62a17b9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions tools/testing/selftests/bpf/progs/mptcp_bpf_bytes.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ int BPF_PROG(trace_mptcp_sched_get_send, struct mptcp_sock *msk)
tp = bpf_core_cast(ssk, struct tcp_sock);

if (subflow->subflow_id == 1) {
bpf_printk("bytes 1: sent %lu received %lu subflows %u", tp->bytes_sent, tp->bytes_received, msk->pm.subflows);
//bpf_printk("bytes 1: sent %lu received %lu subflows %u", tp->bytes_sent, tp->bytes_received, msk->pm.subflows);
bytes_sent_1 += tp->bytes_sent;
} else if (subflow->subflow_id == 2) {
bpf_printk("bytes 2: sent %lu received %lu subflows %u", tp->bytes_sent, tp->bytes_received, msk->pm.subflows);
//bpf_printk("bytes 2: sent %lu received %lu subflows %u", tp->bytes_sent, tp->bytes_received, msk->pm.subflows);
bytes_sent_2 += tp->bytes_sent;
}
}
Expand Down
1 change: 1 addition & 0 deletions tools/testing/selftests/bpf/progs/mptcp_bpf_rr.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ int BPF_PROG(bpf_rr_get_subflow, struct mptcp_sock *msk,
out:
next = bpf_core_cast(next, struct mptcp_subflow_context);
mptcp_subflow_set_scheduled(next, true);
//bpf_printk("rr subflow=%u/%u", next->subflow_id, msk->pm.subflows + 1);
ptr->last_snd = mptcp_subflow_tcp_sock(next);
return 0;
}
Expand Down
8 changes: 4 additions & 4 deletions tools/testing/selftests/bpf/progs/mptcp_bpf_sockopt.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ static int mptcp_setsockopt_mark(struct bpf_sock *sk, struct bpf_sockopt *ctx)
return 1;

bpf_for_each(mptcp_subflow, subflow, msk) {
struct sock *ssk = bpf_mptcp_subflow_tcp_sock(subflow);
struct sock *ssk = mptcp_subflow_tcp_sock(subflow);
int err;

bpf_spin_lock_bh(&ssk->sk_lock.slock);
Expand Down Expand Up @@ -59,7 +59,7 @@ static int mptcp_setsockopt_cc(struct bpf_sock *sk, struct bpf_sockopt *ctx)
return 1;

bpf_for_each(mptcp_subflow, subflow, msk) {
struct sock *ssk = bpf_mptcp_subflow_tcp_sock(subflow);
struct sock *ssk = mptcp_subflow_tcp_sock(subflow);
int err;

bpf_spin_lock_bh(&ssk->sk_lock.slock);
Expand Down Expand Up @@ -101,7 +101,7 @@ static int mptcp_getsockopt_mark(struct bpf_sock *sk, struct bpf_sockopt *ctx)
return 1;

bpf_for_each(mptcp_subflow, subflow, msk) {
struct sock *ssk = bpf_mptcp_subflow_tcp_sock(subflow);
struct sock *ssk = mptcp_subflow_tcp_sock(subflow);

if (ssk->sk_mark != 1) {
ctx->retval = -1;
Expand All @@ -126,7 +126,7 @@ static int mptcp_getsockopt_cc(struct bpf_sock *sk, struct bpf_sockopt *ctx)
return 1;

bpf_for_each(mptcp_subflow, subflow, msk) {
struct sock *ssk = bpf_mptcp_subflow_tcp_sock(subflow);
struct sock *ssk = mptcp_subflow_tcp_sock(subflow);
struct inet_connection_sock *icsk;

icsk = bpf_core_cast(ssk, struct inet_connection_sock);
Expand Down

0 comments on commit 62a17b9

Please sign in to comment.