net/mptcp/subflow.c | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-)
This is a small cleanup, just to avoid duplicating the whole function
for v4 and v6 while the only difference between the two is one call to a
different send_synack() function.
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
---
net/mptcp/subflow.c | 35 ++++++++++++++++++-----------------
1 file changed, 18 insertions(+), 17 deletions(-)
diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c
index 05099b3760b5..2ff3840fc058 100644
--- a/net/mptcp/subflow.c
+++ b/net/mptcp/subflow.c
@@ -307,12 +307,9 @@ static struct dst_entry *subflow_v4_route_req(const struct sock *sk,
return NULL;
}
-static int subflow_v4_send_synack(const struct sock *sk, struct dst_entry *dst,
- struct flowi *fl,
- struct request_sock *req,
- struct tcp_fastopen_cookie *foc,
- enum tcp_synack_type synack_type,
- struct sk_buff *syn_skb)
+static void subflow_send_synack(const struct sock *sk, struct request_sock *req,
+ struct tcp_fastopen_cookie *foc,
+ enum tcp_synack_type synack_type)
{
struct mptcp_subflow_context *subflow = mptcp_subflow_ctx(sk);
struct inet_request_sock *ireq = inet_rsk(req);
@@ -323,8 +320,19 @@ static int subflow_v4_send_synack(const struct sock *sk, struct dst_entry *dst,
if (synack_type == TCP_SYNACK_FASTOPEN)
mptcp_fastopen_subflow_synack_set_params(subflow, req);
+}
+
+static int subflow_v4_send_synack(const struct sock *sk, struct dst_entry *dst,
+ struct flowi *fl,
+ struct request_sock *req,
+ struct tcp_fastopen_cookie *foc,
+ enum tcp_synack_type synack_type,
+ struct sk_buff *syn_skb)
+{
+ subflow_send_synack(sk, req, foc, synack_type);
- return tcp_request_sock_ipv4_ops.send_synack(sk, dst, fl, req, foc, synack_type, syn_skb);
+ return tcp_request_sock_ipv4_ops.send_synack(sk, dst, fl, req, foc,
+ synack_type, syn_skb);
}
#if IS_ENABLED(CONFIG_MPTCP_IPV6)
@@ -335,17 +343,10 @@ static int subflow_v6_send_synack(const struct sock *sk, struct dst_entry *dst,
enum tcp_synack_type synack_type,
struct sk_buff *syn_skb)
{
- struct mptcp_subflow_context *subflow = mptcp_subflow_ctx(sk);
- struct inet_request_sock *ireq = inet_rsk(req);
-
- /* clear tstamp_ok, as needed depending on cookie */
- if (foc && foc->len > -1)
- ireq->tstamp_ok = 0;
-
- if (synack_type == TCP_SYNACK_FASTOPEN)
- mptcp_fastopen_subflow_synack_set_params(subflow, req);
+ subflow_send_synack(sk, req, foc, synack_type);
- return tcp_request_sock_ipv6_ops.send_synack(sk, dst, fl, req, foc, synack_type, syn_skb);
+ return tcp_request_sock_ipv6_ops.send_synack(sk, dst, fl, req, foc,
+ synack_type, syn_skb);
}
static struct dst_entry *subflow_v6_route_req(const struct sock *sk,
base-commit: 5d9ac522aceb69b5b524d330b6ecdbaff61decdc
--
2.37.2
Hi Matthieu, Thank you for your modifications, that's great! Our CI did some validations and here is its report: - KVM Validation: normal: - Success! ✅: - Task: https://cirrus-ci.com/task/6342328210685952 - Summary: https://api.cirrus-ci.com/v1/artifact/task/6342328210685952/summary/summary.txt - KVM Validation: debug: - Unstable: 1 failed test(s): selftest_mptcp_join 🔴: - Task: https://cirrus-ci.com/task/4934953327132672 - Summary: https://api.cirrus-ci.com/v1/artifact/task/4934953327132672/summary/summary.txt Initiator: Patchew Applier Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/bfd8d2dba6d0 If there are some issues, you can reproduce them using the same environment as the one used by the CI thanks to a docker image, e.g.: $ cd [kernel source code] $ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \ --pull always mptcp/mptcp-upstream-virtme-docker:latest \ auto-debug For more details: https://github.com/multipath-tcp/mptcp-upstream-virtme-docker Please note that despite all the efforts that have been already done to have a stable tests suite when executed on a public CI like here, it is possible some reported issues are not due to your modifications. Still, do not hesitate to help us improve that ;-) Cheers, MPTCP GH Action bot Bot operated by Matthieu Baerts (Tessares)
Hello, On 25/11/2022 22:20, Matthieu Baerts wrote: > This is a small cleanup, just to avoid duplicating the whole function > for v4 and v6 while the only difference between the two is one call to a > different send_synack() function. > > Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net> > --- > net/mptcp/subflow.c | 35 ++++++++++++++++++----------------- > 1 file changed, 18 insertions(+), 17 deletions(-) > > diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c > index 05099b3760b5..2ff3840fc058 100644 > --- a/net/mptcp/subflow.c > +++ b/net/mptcp/subflow.c > @@ -307,12 +307,9 @@ static struct dst_entry *subflow_v4_route_req(const struct sock *sk, > return NULL; > } > > -static int subflow_v4_send_synack(const struct sock *sk, struct dst_entry *dst, > - struct flowi *fl, > - struct request_sock *req, > - struct tcp_fastopen_cookie *foc, > - enum tcp_synack_type synack_type, > - struct sk_buff *syn_skb) > +static void subflow_send_synack(const struct sock *sk, struct request_sock *req, I just applied this patch with a small change: s/subflow_send_synack/subflow_prep_synack/ - 61e817662ce3: "squashed" in "mptcp: add subflow_v(4,6)_send_synack()" - Results: 2deca8211919..ace83548981f (export) Tests are now in progress: https://cirrus-ci.com/github/multipath-tcp/mptcp_net-next/export/20221125T222831 Cheers, Matt -- Tessares | Belgium | Hybrid Access Solutions www.tessares.net
© 2016 - 2024 Red Hat, Inc.