mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-16 06:51:42 +00:00
mptcp: add struct mptcp_sched_ops
This patch defines struct mptcp_sched_ops, which has three struct members, name, owner and list, and four function pointers: init(), release() and get_subflow(). The scheduler function get_subflow() have a struct mptcp_sched_data parameter, which contains a reinject flag for retrans or not, a subflows number and a mptcp_subflow_context array. Add the scheduler registering, unregistering and finding functions to add, delete and find a packet scheduler on the global list mptcp_sched_list. Acked-by: Paolo Abeni <pabeni@redhat.com> Reviewed-by: Mat Martineau <martineau@kernel.org> Signed-off-by: Geliang Tang <geliang.tang@suse.com> Signed-off-by: Mat Martineau <martineau@kernel.org> Link: https://lore.kernel.org/r/20230821-upstream-net-next-20230818-v1-3-0c860fb256a8@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
ebc1e08f01
commit
740ebe35bd
@@ -96,6 +96,27 @@ struct mptcp_out_options {
|
||||
#endif
|
||||
};
|
||||
|
||||
#define MPTCP_SCHED_NAME_MAX 16
|
||||
#define MPTCP_SUBFLOWS_MAX 8
|
||||
|
||||
struct mptcp_sched_data {
|
||||
bool reinject;
|
||||
u8 subflows;
|
||||
struct mptcp_subflow_context *contexts[MPTCP_SUBFLOWS_MAX];
|
||||
};
|
||||
|
||||
struct mptcp_sched_ops {
|
||||
int (*get_subflow)(struct mptcp_sock *msk,
|
||||
struct mptcp_sched_data *data);
|
||||
|
||||
char name[MPTCP_SCHED_NAME_MAX];
|
||||
struct module *owner;
|
||||
struct list_head list;
|
||||
|
||||
void (*init)(struct mptcp_sock *msk);
|
||||
void (*release)(struct mptcp_sock *msk);
|
||||
} ____cacheline_aligned_in_smp;
|
||||
|
||||
#ifdef CONFIG_MPTCP
|
||||
void mptcp_init(void);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user