From: Mat Martineau <mathew.j.martineau@linux.intel.com>
To: Geliang Tang <geliang.tang@suse.com>
Cc: mptcp@lists.linux.dev
Subject: Re: [PATCH mptcp-next 02/17] mptcp: move mptcp_subflow_context in net/mptcp.h
Date: Wed, 18 May 2022 17:28:54 -0700 (PDT) [thread overview]
Message-ID: <8573a785-26d2-c69b-e18b-fc3a5220e4f3@linux.intel.com> (raw)
In-Reply-To: <b06c5cd73cb6f6bd8c57cd1b23c95ca365b30708.1652853898.git.geliang.tang@suse.com>
On Wed, 18 May 2022, Geliang Tang wrote:
> Move struct mptcp_subflow_context definition from net/mptcp/protocol.h
> to include/net/mptcp.h. And move the related struct mptcp_data_avail and
> function mptcp_subflow_ctx() too.
>
> Signed-off-by: Geliang Tang <geliang.tang@suse.com>
I'm not sure I agree with moving all of this just because Martin asked
about an inline function. I'll follow up on the netdev email thread.
- Mat
> ---
> include/net/mptcp.h | 91 ++++++++++++++++++++++++++++++++++++++++++++
> net/mptcp/protocol.h | 88 ------------------------------------------
> 2 files changed, 91 insertions(+), 88 deletions(-)
>
> diff --git a/include/net/mptcp.h b/include/net/mptcp.h
> index 4713757e36c1..9422b6d2a268 100644
> --- a/include/net/mptcp.h
> +++ b/include/net/mptcp.h
> @@ -40,6 +40,86 @@ struct mptcp_ext {
> };
>
> #define MPTCPOPT_HMAC_LEN 20
> +
> +enum mptcp_data_avail {
> + MPTCP_SUBFLOW_NODATA,
> + MPTCP_SUBFLOW_DATA_AVAIL,
> +};
> +
> +/* MPTCP subflow context */
> +struct mptcp_subflow_context {
> + struct list_head node;/* conn_list of subflows */
> +
> + struct_group(reset,
> +
> + unsigned long avg_pacing_rate; /* protected by msk socket lock */
> + u64 local_key;
> + u64 remote_key;
> + u64 idsn;
> + u64 map_seq;
> + u32 snd_isn;
> + u32 token;
> + u32 rel_write_seq;
> + u32 map_subflow_seq;
> + u32 ssn_offset;
> + u32 map_data_len;
> + __wsum map_data_csum;
> + u32 map_csum_len;
> + u32 request_mptcp : 1, /* send MP_CAPABLE */
> + request_join : 1, /* send MP_JOIN */
> + request_bkup : 1,
> + mp_capable : 1, /* remote is MPTCP capable */
> + mp_join : 1, /* remote is JOINing */
> + fully_established : 1, /* path validated */
> + pm_notified : 1, /* PM hook called for established status */
> + conn_finished : 1,
> + map_valid : 1,
> + map_csum_reqd : 1,
> + map_data_fin : 1,
> + mpc_map : 1,
> + backup : 1,
> + send_mp_prio : 1,
> + send_mp_fail : 1,
> + send_fastclose : 1,
> + send_infinite_map : 1,
> + rx_eof : 1,
> + can_ack : 1, /* only after processing the remote a key */
> + disposable : 1, /* ctx can be free at ulp release time */
> + stale : 1, /* unable to snd/rcv data, do not use for xmit */
> + local_id_valid : 1, /* local_id is correctly initialized */
> + valid_csum_seen : 1; /* at least one csum validated */
> + enum mptcp_data_avail data_avail;
> + bool mp_fail_response_expect;
> + u32 remote_nonce;
> + u64 thmac;
> + u32 local_nonce;
> + u32 remote_token;
> + u8 hmac[MPTCPOPT_HMAC_LEN];
> + u8 local_id;
> + u8 remote_id;
> + u8 reset_seen:1;
> + u8 reset_transient:1;
> + u8 reset_reason:4;
> + u8 stale_count;
> +
> + long delegated_status;
> +
> + );
> +
> + struct list_head delegated_node; /* link into delegated_action, protected by local BH */
> +
> + u32 setsockopt_seq;
> + u32 stale_rcv_tstamp;
> +
> + struct sock *tcp_sock; /* tcp sk backpointer */
> + struct sock *conn; /* parent mptcp_sock */
> + const struct inet_connection_sock_af_ops *icsk_af_ops;
> + void (*tcp_state_change)(struct sock *sk);
> + void (*tcp_error_report)(struct sock *sk);
> +
> + struct rcu_head rcu;
> +};
> +
> #define MPTCP_RM_IDS_MAX 8
>
> struct mptcp_rm_list {
> @@ -198,6 +278,15 @@ static inline __be32 mptcp_reset_option(const struct sk_buff *skb)
>
> return htonl(0u);
> }
> +
> +static inline struct mptcp_subflow_context *
> +mptcp_subflow_ctx(const struct sock *sk)
> +{
> + struct inet_connection_sock *icsk = inet_csk(sk);
> +
> + /* Use RCU on icsk_ulp_data only for sock diag code */
> + return (__force struct mptcp_subflow_context *)icsk->icsk_ulp_data;
> +}
> #else
>
> static inline void mptcp_init(void)
> @@ -275,6 +364,8 @@ static inline int mptcp_subflow_init_cookie_req(struct request_sock *req,
> }
>
> static inline __be32 mptcp_reset_option(const struct sk_buff *skb) { return htonl(0u); }
> +static inline struct mptcp_subflow_context *
> +mptcp_subflow_ctx(const struct sock *sk) { return NULL; }
> #endif /* CONFIG_MPTCP */
>
> #if IS_ENABLED(CONFIG_MPTCP_IPV6)
> diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
> index 8f03775a2f22..cc24756cedfe 100644
> --- a/net/mptcp/protocol.h
> +++ b/net/mptcp/protocol.h
> @@ -409,11 +409,6 @@ mptcp_subflow_rsk(const struct request_sock *rsk)
> return (struct mptcp_subflow_request_sock *)rsk;
> }
>
> -enum mptcp_data_avail {
> - MPTCP_SUBFLOW_NODATA,
> - MPTCP_SUBFLOW_DATA_AVAIL,
> -};
> -
> struct mptcp_delegated_action {
> struct napi_struct napi;
> struct list_head head;
> @@ -424,89 +419,6 @@ DECLARE_PER_CPU(struct mptcp_delegated_action, mptcp_delegated_actions);
> #define MPTCP_DELEGATE_SEND 0
> #define MPTCP_DELEGATE_ACK 1
>
> -/* MPTCP subflow context */
> -struct mptcp_subflow_context {
> - struct list_head node;/* conn_list of subflows */
> -
> - struct_group(reset,
> -
> - unsigned long avg_pacing_rate; /* protected by msk socket lock */
> - u64 local_key;
> - u64 remote_key;
> - u64 idsn;
> - u64 map_seq;
> - u32 snd_isn;
> - u32 token;
> - u32 rel_write_seq;
> - u32 map_subflow_seq;
> - u32 ssn_offset;
> - u32 map_data_len;
> - __wsum map_data_csum;
> - u32 map_csum_len;
> - u32 request_mptcp : 1, /* send MP_CAPABLE */
> - request_join : 1, /* send MP_JOIN */
> - request_bkup : 1,
> - mp_capable : 1, /* remote is MPTCP capable */
> - mp_join : 1, /* remote is JOINing */
> - fully_established : 1, /* path validated */
> - pm_notified : 1, /* PM hook called for established status */
> - conn_finished : 1,
> - map_valid : 1,
> - map_csum_reqd : 1,
> - map_data_fin : 1,
> - mpc_map : 1,
> - backup : 1,
> - send_mp_prio : 1,
> - send_mp_fail : 1,
> - send_fastclose : 1,
> - send_infinite_map : 1,
> - rx_eof : 1,
> - can_ack : 1, /* only after processing the remote a key */
> - disposable : 1, /* ctx can be free at ulp release time */
> - stale : 1, /* unable to snd/rcv data, do not use for xmit */
> - local_id_valid : 1, /* local_id is correctly initialized */
> - valid_csum_seen : 1; /* at least one csum validated */
> - enum mptcp_data_avail data_avail;
> - bool mp_fail_response_expect;
> - u32 remote_nonce;
> - u64 thmac;
> - u32 local_nonce;
> - u32 remote_token;
> - u8 hmac[MPTCPOPT_HMAC_LEN];
> - u8 local_id;
> - u8 remote_id;
> - u8 reset_seen:1;
> - u8 reset_transient:1;
> - u8 reset_reason:4;
> - u8 stale_count;
> -
> - long delegated_status;
> -
> - );
> -
> - struct list_head delegated_node; /* link into delegated_action, protected by local BH */
> -
> - u32 setsockopt_seq;
> - u32 stale_rcv_tstamp;
> -
> - struct sock *tcp_sock; /* tcp sk backpointer */
> - struct sock *conn; /* parent mptcp_sock */
> - const struct inet_connection_sock_af_ops *icsk_af_ops;
> - void (*tcp_state_change)(struct sock *sk);
> - void (*tcp_error_report)(struct sock *sk);
> -
> - struct rcu_head rcu;
> -};
> -
> -static inline struct mptcp_subflow_context *
> -mptcp_subflow_ctx(const struct sock *sk)
> -{
> - struct inet_connection_sock *icsk = inet_csk(sk);
> -
> - /* Use RCU on icsk_ulp_data only for sock diag code */
> - return (__force struct mptcp_subflow_context *)icsk->icsk_ulp_data;
> -}
> -
> static inline struct sock *
> mptcp_subflow_tcp_sock(const struct mptcp_subflow_context *subflow)
> {
> --
> 2.34.1
>
>
>
--
Mat Martineau
Intel
next prev parent reply other threads:[~2022-05-19 0:29 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-18 6:10 [PATCH mptcp-next 00/17] for bpf-next Geliang Tang
2022-05-18 6:10 ` [PATCH mptcp-next 01/17] mptcp: move MPTCPOPT_HMAC_LEN to net/mptcp.h Geliang Tang
2022-05-19 15:06 ` Mat Martineau
2022-05-19 16:07 ` Matthieu Baerts
2022-05-18 6:10 ` [PATCH mptcp-next 02/17] mptcp: move mptcp_subflow_context in net/mptcp.h Geliang Tang
2022-05-18 6:33 ` Geliang Tang
2022-05-19 0:28 ` Mat Martineau [this message]
2022-05-19 8:52 ` Geliang Tang
2022-05-19 15:05 ` Mat Martineau
2022-05-18 6:10 ` [PATCH mptcp-next 03/17] bpf: add bpf_mptcp_sock_from_subflow helper Geliang Tang
2022-05-18 6:10 ` [PATCH mptcp-next 04/17] bpf: add bpf_skc_to_mptcp_sock_proto Geliang Tang
2022-05-18 6:10 ` [PATCH mptcp-next 05/17] selftests/bpf: Enable CONFIG_IKCONFIG_PROC in config Geliang Tang
2022-05-18 6:10 ` [PATCH mptcp-next 06/17] selftests/bpf: add MPTCP test base Geliang Tang
2022-05-18 6:10 ` [PATCH mptcp-next 07/17] selftests/bpf: test bpf_skc_to_mptcp_sock Geliang Tang
2022-05-18 6:10 ` [PATCH mptcp-next 08/17] selftests/bpf: verify token of struct mptcp_sock Geliang Tang
2022-05-18 6:33 ` Geliang Tang
2022-05-18 6:10 ` [PATCH mptcp-next 09/17] selftests/bpf: verify ca_name " Geliang Tang
2022-05-18 6:10 ` [PATCH mptcp-next 10/17] selftests/bpf: verify first " Geliang Tang
2022-05-18 6:10 ` [PATCH mptcp-next 11/17] mptcp: add struct mptcp_sched_ops Geliang Tang
2022-05-18 6:10 ` [PATCH mptcp-next 12/17] mptcp: add a new sysctl scheduler Geliang Tang
2022-05-18 6:10 ` [PATCH mptcp-next 13/17] mptcp: add sched in mptcp_sock Geliang Tang
2022-05-18 6:10 ` [PATCH mptcp-next 14/17] mptcp: add get_subflow wrappers Geliang Tang
2022-05-18 6:10 ` [PATCH mptcp-next 15/17] mptcp: add bpf_mptcp_sched_ops Geliang Tang
2022-05-18 6:10 ` [PATCH mptcp-next 16/17] selftests/bpf: add bpf_first scheduler Geliang Tang
2022-05-18 6:10 ` [PATCH mptcp-next 17/17] selftests/bpf: add bpf_first test Geliang Tang
2022-05-18 10:59 ` [PATCH mptcp-next 00/17] for bpf-next Matthieu Baerts
2022-05-18 12:45 ` Geliang Tang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8573a785-26d2-c69b-e18b-fc3a5220e4f3@linux.intel.com \
--to=mathew.j.martineau@linux.intel.com \
--cc=geliang.tang@suse.com \
--cc=mptcp@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox