Commit ea56dcb4 authored by Geliang Tang's avatar Geliang Tang Committed by Jakub Kicinski

mptcp: use MPTCP_SUBFLOW_NODATA

Set subflow->data_avail with the enum value MPTCP_SUBFLOW_NODATA, instead
of using 0 directly.
Reviewed-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: default avatarGeliang Tang <geliang.tang@suse.com>
Signed-off-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 0eb4e7ee
...@@ -1104,7 +1104,7 @@ static bool subflow_check_data_avail(struct sock *ssk) ...@@ -1104,7 +1104,7 @@ static bool subflow_check_data_avail(struct sock *ssk)
struct sk_buff *skb; struct sk_buff *skb;
if (!skb_peek(&ssk->sk_receive_queue)) if (!skb_peek(&ssk->sk_receive_queue))
WRITE_ONCE(subflow->data_avail, 0); WRITE_ONCE(subflow->data_avail, MPTCP_SUBFLOW_NODATA);
if (subflow->data_avail) if (subflow->data_avail)
return true; return true;
...@@ -1169,7 +1169,7 @@ static bool subflow_check_data_avail(struct sock *ssk) ...@@ -1169,7 +1169,7 @@ static bool subflow_check_data_avail(struct sock *ssk)
subflow->reset_transient = 0; subflow->reset_transient = 0;
subflow->reset_reason = MPTCP_RST_EMIDDLEBOX; subflow->reset_reason = MPTCP_RST_EMIDDLEBOX;
tcp_send_active_reset(ssk, GFP_ATOMIC); tcp_send_active_reset(ssk, GFP_ATOMIC);
WRITE_ONCE(subflow->data_avail, 0); WRITE_ONCE(subflow->data_avail, MPTCP_SUBFLOW_NODATA);
return true; return true;
} }
...@@ -1182,7 +1182,7 @@ static bool subflow_check_data_avail(struct sock *ssk) ...@@ -1182,7 +1182,7 @@ static bool subflow_check_data_avail(struct sock *ssk)
subflow->reset_transient = 0; subflow->reset_transient = 0;
subflow->reset_reason = MPTCP_RST_EMPTCP; subflow->reset_reason = MPTCP_RST_EMPTCP;
tcp_send_active_reset(ssk, GFP_ATOMIC); tcp_send_active_reset(ssk, GFP_ATOMIC);
WRITE_ONCE(subflow->data_avail, 0); WRITE_ONCE(subflow->data_avail, MPTCP_SUBFLOW_NODATA);
return false; return false;
} }
...@@ -1204,7 +1204,7 @@ bool mptcp_subflow_data_available(struct sock *sk) ...@@ -1204,7 +1204,7 @@ bool mptcp_subflow_data_available(struct sock *sk)
if (subflow->map_valid && if (subflow->map_valid &&
mptcp_subflow_get_map_offset(subflow) >= subflow->map_data_len) { mptcp_subflow_get_map_offset(subflow) >= subflow->map_data_len) {
subflow->map_valid = 0; subflow->map_valid = 0;
WRITE_ONCE(subflow->data_avail, 0); WRITE_ONCE(subflow->data_avail, MPTCP_SUBFLOW_NODATA);
pr_debug("Done with mapping: seq=%u data_len=%u", pr_debug("Done with mapping: seq=%u data_len=%u",
subflow->map_subflow_seq, subflow->map_subflow_seq,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment