forked from multipath-tcp/mptcp_net-next
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
To be squashed in BPF topics. Link: https://lore.kernel.org/all/20240509175026.3423614-1-martin.lau@linux.dev/T/ Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
- Loading branch information
Showing
8 changed files
with
74 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */ | ||
#ifndef __MPTCP_BPF_H__ | ||
#define __MPTCP_BPF_H__ | ||
|
||
#define MPTCP_SUBFLOWS_MAX 8 | ||
|
||
extern void mptcp_subflow_set_scheduled(struct mptcp_subflow_context *subflow, | ||
bool scheduled) __ksym; | ||
|
||
extern struct mptcp_subflow_context * | ||
bpf_mptcp_subflow_ctx_by_pos(const struct mptcp_sched_data *data, unsigned int pos) __ksym; | ||
|
||
static __always_inline struct sock * | ||
mptcp_subflow_tcp_sock(const struct mptcp_subflow_context *subflow) | ||
{ | ||
return subflow->tcp_sock; | ||
} | ||
|
||
static __always_inline struct mptcp_subflow_context * | ||
mptcp_subflow_ctx(const struct sock *sk) | ||
{ | ||
const struct inet_connection_sock *icsk = inet_csk(sk); | ||
|
||
/* Use RCU on icsk_ulp_data only for sock diag code */ | ||
return (struct mptcp_subflow_context *)icsk->icsk_ulp_data; | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters