FAILED: patch "[PATCH] mptcp: pr_debug: add missing \n at the end" failed to apply to 6.1-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 6.1-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.1.y
git checkout FETCH_HEAD
git cherry-pick -x cb41b195e634d3f1ecfcd845314e64fd4bb3c7aa
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2024083020-quickness-xbox-e6f7@gregkh' --subject-prefix 'PATCH 6.1.y' HEAD^..
Possible dependencies:
cb41b195e634 ("mptcp: pr_debug: add missing \n at the end") 68cc924729ff ("mptcp: fix duplicate data handling")89721e3038d1 ("Merge tag 'net-accept-more-20240515' of git://git.kernel.dk/linux")
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From cb41b195e634d3f1ecfcd845314e64fd4bb3c7aa Mon Sep 17 00:00:00 2001
From: "Matthieu Baerts (NGI0)" <[email protected]>
Date: Mon, 26 Aug 2024 19:11:21 +0200
Subject: [PATCH] mptcp: pr_debug: add missing \n at the end
pr_debug() have been added in various places in MPTCP code to help developers to debug some situations. With the dynamic debug feature, it is easy to enable all or some of them, and asks users to reproduce issues with extra debug.
Many of these pr_debug() don't end with a new line, while no 'pr_cont()' are used in MPTCP code. So the goal was not to display multiple debug messages on one line: they were then not missing the '\n' on purpose. Not having the new line at the end causes these messages to be printed with a delay, when something else needs to be printed. This issue is not visible when many messages need to be printed, but it is annoying and confusing when only specific messages are expected, e.g.
# echo "func mptcp_pm_add_addr_echoed +fmp" \
> /sys/kernel/debug/dynamic_debug/control
# ./mptcp_join.sh "signal address"; \
echo "$(awk '{print $1}' /proc/uptime) - end"; \
sleep 5s; \
echo "$(awk '{print $1}' /proc/uptime) - restart"; \
./mptcp_join.sh "signal address"
013 signal address
(...)
10.75 - end
15.76 - restart
013 signal address
[ 10.367935] mptcp:mptcp_pm_add_addr_echoed: MPTCP: msk=(...)
(...) => a delay of 5 seconds: printed with a 10.36 ts, but after 'restart'
which was printed at the 15.76 ts.
The 'Fixes' tag here below points to the first pr_debug() used without '\n' in net/mptcp. This patch could be split in many small ones, with different Fixes tag, but it doesn't seem worth it, because it is easy to re-generate this patch with this simple 'sed' command:
git grep -l pr_debug -- net/mptcp |
xargs sed -i "s/\(pr_debug(\".*[^n]\)\(\"[,)]\)/\1\\\n\2/g"
So in case of conflicts, simply drop the modifications, and launch this command.
net/mptcp/fastopen.c +2 -2
@@ -68,12 +68,12 @@ void __mptcp_fastopen_gen_msk_ackseq(struct mptcp_sock *msk, struct mptcp_subflo skb =skb_peek_tail (&sk->sk_receive_queue);if (skb) {WARN_ON_ONCE (MPTCP_SKB_CB (skb)->end_seq); -pr_debug ("msk %p moving seq %llx -> %llx end_seq %llx -> %llx" , sk, +pr_debug ("msk %p moving seq %llx -> %llx end_seq %llx -> %llx\n" , sk,MPTCP_SKB_CB (skb)->map_seq,MPTCP_SKB_CB (skb)->map_seq + msk->ack_seq,MPTCP_SKB_CB (skb)->end_seq,MPTCP_SKB_CB (skb)->end_seq + msk->ack_seq);MPTCP_SKB_CB (skb)->map_seq += msk->ack_seq;MPTCP_SKB_CB (skb)->end_seq += msk->ack_seq; } -pr_debug ("msk=%p ack_seq=%llx" , msk, msk->ack_seq); +pr_debug ("msk=%p ack_seq=%llx\n" , msk, msk->ack_seq); }
net/mptcp/options.c +25 -25
198 lines not on this page · raw message
net/mptcp/pm.c +14 -14
@@ -19,7 +19,7 @@ int mptcp_pm_announce_addr(struct mptcp_sock *msk, {u8 add_addr =READ_ONCE (msk->pm.addr_signal); -pr_debug ("msk=%p, local_id=%d, echo=%d" , msk, addr->id, echo); +pr_debug ("msk=%p, local_id=%d, echo=%d\n" , msk, addr->id, echo);lockdep_assert_held (&msk->pm.lock);
@@ -45,7 +45,7 @@ int mptcp_pm_remove_addr(struct mptcp_sock *msk, const struct mptcp_rm_list *rm_ {u8 rm_addr =READ_ONCE (msk->pm.addr_signal); -pr_debug ("msk=%p, rm_list_nr=%d" , msk, rm_list->nr); +pr_debug ("msk=%p, rm_list_nr=%d\n" , msk, rm_list->nr);if (rm_addr) { MPTCP_ADD_STATS(sock_net((struct sock *)msk),
@@ -66,7 +66,7 @@ void mptcp_pm_new_connection(struct mptcp_sock *msk, const struct sock *ssk, int {struct mptcp_pm_data *pm = &msk->pm; -pr_debug ("msk=%p, token=%u side=%d" , msk,READ_ONCE (msk->token), server_side); +pr_debug ("msk=%p, token=%u side=%d\n" , msk,READ_ONCE (msk->token), server_side);WRITE_ONCE (pm->server_side, server_side);mptcp_event (MPTCP_EVENT_CREATED , msk, ssk,GFP_ATOMIC );
@@ -90,7 +90,7 @@ bool mptcp_pm_allow_new_subflow(struct mptcp_sock *msk) subflows_max =mptcp_pm_get_subflows_max (msk); -pr_debug ("msk=%p subflows=%d max=%d allow=%d" , msk, pm->subflows, +pr_debug ("msk=%p subflows=%d max=%d allow=%d\n" , msk, pm->subflows, subflows_max,READ_ONCE (pm->accept_subflow));/* try to avoid acquiring the lock below */
@@ -114,7 +114,7 @@ bool mptcp_pm_allow_new_subflow(struct mptcp_sock *msk)static bool mptcp_pm_schedule_work (struct mptcp_sock *msk,enum mptcp_pm_status new_status) { -pr_debug ("msk=%p status=%x new=%lx" , msk, msk->pm.status, +pr_debug ("msk=%p status=%x new=%lx\n" , msk, msk->pm.status,BIT (new_status));if (msk->pm.status &BIT (new_status))return false;
@@ -129,7 +129,7 @@ void mptcp_pm_fully_established(struct mptcp_sock *msk, const struct sock *ssk)struct mptcp_pm_data *pm = &msk->pm;bool announce = false; -pr_debug ("msk=%p" , msk); +pr_debug ("msk=%p\n" , msk);spin_lock_bh (&pm->lock);
@@ -153,14 +153,14 @@ void mptcp_pm_fully_established(struct mptcp_sock *msk, const struct sock *ssk)void mptcp_pm_connection_closed (struct mptcp_sock *msk) { -pr_debug ("msk=%p" , msk); +pr_debug ("msk=%p\n" , msk); }void mptcp_pm_subflow_established (struct mptcp_sock *msk) {struct mptcp_pm_data *pm = &msk->pm; -pr_debug ("msk=%p" , msk); +pr_debug ("msk=%p\n" , msk);if (!READ_ONCE (pm->work_pending))return ;
@@ -212,7 +212,7 @@ void mptcp_pm_add_addr_received(const struct sock *ssk,struct mptcp_sock *msk =mptcp_sk (subflow->conn);struct mptcp_pm_data *pm = &msk->pm; -pr_debug ("msk=%p remote_id=%d accept=%d" , msk, addr->id, +pr_debug ("msk=%p remote_id=%d accept=%d\n" , msk, addr->id,READ_ONCE (pm->accept_addr));mptcp_event_addr_announced (ssk, addr);
@@ -243,7 +243,7 @@ void mptcp_pm_add_addr_echoed(struct mptcp_sock *msk, {struct mptcp_pm_data *pm = &msk->pm; -pr_debug ("msk=%p" , msk); +pr_debug ("msk=%p\n" , msk);spin_lock_bh (&pm->lock);
@@ -267,7 +267,7 @@ void mptcp_pm_rm_addr_received(struct mptcp_sock *msk,struct mptcp_pm_data *pm = &msk->pm;u8 i; -pr_debug ("msk=%p remote_ids_nr=%d" , msk, rm_list->nr); +pr_debug ("msk=%p remote_ids_nr=%d\n" , msk, rm_list->nr);for (i =0 ; i < rm_list->nr; i++)mptcp_event_addr_removed (msk, rm_list->ids[i]);
@@ -299,19 +299,19 @@ void mptcp_pm_mp_fail_received(struct sock *sk, u64 fail_seq)struct mptcp_subflow_context *subflow =mptcp_subflow_ctx (sk);struct mptcp_sock *msk =mptcp_sk (subflow->conn); -pr_debug ("fail_seq=%llu" , fail_seq); +pr_debug ("fail_seq=%llu\n" , fail_seq);if (!READ_ONCE (msk->allow_infinite_fallback))return ;if (!subflow->fail_tout) { -pr_debug ("send MP_FAIL response and infinite map" ); +pr_debug ("send MP_FAIL response and infinite map\n" ); subflow->send_mp_fail =1 ; subflow->send_infinite_map =1 ;tcp_send_ack (sk); }else { -pr_debug ("MP_FAIL response received" ); +pr_debug ("MP_FAIL response received\n" );WRITE_ONCE (subflow->fail_tout,0 ); } }
net/mptcp/pm_netlink.c +10 -10
@@ -287,7 +287,7 @@ static void mptcp_pm_add_timer(struct timer_list *timer)struct mptcp_sock *msk = entry->sock;struct sock *sk = (struct sock *)msk; -pr_debug ("msk=%p" , msk); +pr_debug ("msk=%p\n" , msk);if (!msk)return ;
@@ -306,7 +306,7 @@ static void mptcp_pm_add_timer(struct timer_list *timer)spin_lock_bh (&msk->pm.lock);if (!mptcp_pm_should_add_signal_addr (msk)) { -pr_debug ("retransmit ADD_ADDR id=%d" , entry->addr.id); +pr_debug ("retransmit ADD_ADDR id=%d\n" , entry->addr.id);mptcp_pm_announce_addr (msk, &entry->addr, false);mptcp_pm_add_addr_send_ack (msk); entry->retrans_times++;
@@ -387,7 +387,7 @@ void mptcp_pm_free_anno_list(struct mptcp_sock *msk)struct sock *sk = (struct sock *)msk;LIST_HEAD (free_list); -pr_debug ("msk=%p" , msk); +pr_debug ("msk=%p\n" , msk);spin_lock_bh (&msk->pm.lock);list_splice_init (&msk->pm.anno_list, &free_list);
@@ -473,7 +473,7 @@ static void __mptcp_pm_send_ack(struct mptcp_sock *msk, struct mptcp_subflow_construct sock *ssk =mptcp_subflow_tcp_sock (subflow);bool slow; -pr_debug ("send ack for %s" , +pr_debug ("send ack for %s\n" , prio ?"mp_prio" : (mptcp_pm_should_add_signal (msk) ?"add_addr" :"rm_addr" )); slow =lock_sock_fast (ssk);
@@ -708,7 +708,7 @@ static void mptcp_pm_nl_add_addr_received(struct mptcp_sock *msk) add_addr_accept_max =mptcp_pm_get_add_addr_accept_max (msk); subflows_max =mptcp_pm_get_subflows_max (msk); -pr_debug ("accepted %d:%d remote family %d" , +pr_debug ("accepted %d:%d remote family %d\n" , msk->pm.add_addr_accepted, add_addr_accept_max, msk->pm.remote.family);
@@ -767,7 +767,7 @@ int mptcp_pm_nl_mp_prio_send_ack(struct mptcp_sock *msk, {struct mptcp_subflow_context *subflow; -pr_debug ("bkup=%d" , bkup); +pr_debug ("bkup=%d\n" , bkup);mptcp_for_each_subflow (msk, subflow) {struct sock *ssk =mptcp_subflow_tcp_sock (subflow);
@@ -803,7 +803,7 @@ static void mptcp_pm_nl_rm_addr_or_subflow(struct mptcp_sock *msk,struct sock *sk = (struct sock *)msk;u8 i; -pr_debug ("%s rm_list_nr %d" , +pr_debug ("%s rm_list_nr %d\n" , rm_type ==MPTCP_MIB_RMADDR ?"address" :"subflow" , rm_list->nr);msk_owned_by_me (msk);
@@ -832,7 +832,7 @@ static void mptcp_pm_nl_rm_addr_or_subflow(struct mptcp_sock *msk,if (rm_type ==MPTCP_MIB_RMSUBFLOW && !mptcp_local_id_match (msk, id, rm_id))continue ; -pr_debug (" -> %s rm_list_ids[%d]=%u local_id=%u remote_id=%u mpc_id=%u" , +pr_debug (" -> %s rm_list_ids[%d]=%u local_id=%u remote_id=%u mpc_id=%u\n" , rm_type ==MPTCP_MIB_RMADDR ?"address" :"subflow" , i, rm_id, id, remote_id, msk->mpc_endpoint_id);spin_unlock_bh (&msk->pm.lock);
@@ -889,7 +889,7 @@ void mptcp_pm_nl_work(struct mptcp_sock *msk)spin_lock_bh (&msk->pm.lock); -pr_debug ("msk=%p status=%x" , msk, pm->status); +pr_debug ("msk=%p status=%x\n" , msk, pm->status);if (pm->status &BIT (MPTCP_PM_ADD_ADDR_RECEIVED )) { pm->status &= ~BIT (MPTCP_PM_ADD_ADDR_RECEIVED );mptcp_pm_nl_add_addr_received (msk);
@@ -1476,7 +1476,7 @@ static int mptcp_nl_remove_subflow_and_signal_addr(struct net *net,long s_slot =0 , s_num =0 ;struct mptcp_sock *msk; -pr_debug ("remove_id=%d" , addr->id); +pr_debug ("remove_id=%d\n" , addr->id); list.ids[list.nr++] = addr->id;
net/mptcp/protocol.c +26 -26
206 lines not on this page · raw message
net/mptcp/protocol.h +2 -2
@@ -1177,7 +1177,7 @@ static inline bool mptcp_check_fallback(const struct sock *sk)static inline void __mptcp_do_fallback (struct mptcp_sock *msk) {if (__mptcp_check_fallback (msk)) { -pr_debug ("TCP fallback already done (msk=%p)" , msk); +pr_debug ("TCP fallback already done (msk=%p)\n" , msk);return ; }set_bit (MPTCP_FALLBACK_DONE , &msk->flags);
@@ -1213,7 +1213,7 @@ static inline void mptcp_do_fallback(struct sock *ssk) } } -#define pr_fallback (a) pr_debug("%s:fallback to TCP (msk=%p)", __func__, a) +#define pr_fallback (a) pr_debug("%s:fallback to TCP (msk=%p)\n", __func__, a)static inline bool mptcp_check_infinite_map (struct sk_buff *skb) {
net/mptcp/sched.c +2 -2
@@ -86,7 +86,7 @@ int mptcp_register_scheduler(struct mptcp_sched_ops *sched)list_add_tail_rcu (&sched->list, &mptcp_sched_list);spin_unlock (&mptcp_sched_list_lock); -pr_debug ("%s registered" , sched->name); +pr_debug ("%s registered\n" , sched->name);return 0 ; }
@@ -118,7 +118,7 @@ int mptcp_init_sched(struct mptcp_sock *msk,if (msk->sched->init) msk->sched->init (msk); -pr_debug ("sched=%s" , msk->sched->name); +pr_debug ("sched=%s\n" , msk->sched->name);return 0 ; }
net/mptcp/sockopt.c +2 -2
@@ -873,7 +873,7 @@ int mptcp_setsockopt(struct sock *sk, int level, int optname,struct mptcp_sock *msk =mptcp_sk (sk);struct sock *ssk; -pr_debug ("msk=%p" , msk); +pr_debug ("msk=%p\n" , msk);if (level ==SOL_SOCKET )return mptcp_setsockopt_sol_socket (msk, optname, optval, optlen);
@@ -1453,7 +1453,7 @@ int mptcp_getsockopt(struct sock *sk, int level, int optname,struct mptcp_sock *msk =mptcp_sk (sk);struct sock *ssk; -pr_debug ("msk=%p" , msk); +pr_debug ("msk=%p\n" , msk);/* @@ the meaning of setsockopt() when the socket is connected and * there are multiple subflows is not yet defined. It is up to the
net/mptcp/subflow.c +24 -24
192 lines not on this page · raw message
Matthieu Baerts (NGI0)
maintainerPATCH 1/1 mptcp: pr_debug: add missing \n at the end
commit cb41b195e634d3f1ecfcd845314e64fd4bb3c7aa upstream.
pr_debug() have been added in various places in MPTCP code to help developers to debug some situations. With the dynamic debug feature, it is easy to enable all or some of them, and asks users to reproduce issues with extra debug.
Many of these pr_debug() don't end with a new line, while no 'pr_cont()' are used in MPTCP code. So the goal was not to display multiple debug messages on one line: they were then not missing the '\n' on purpose. Not having the new line at the end causes these messages to be printed with a delay, when something else needs to be printed. This issue is not visible when many messages need to be printed, but it is annoying and confusing when only specific messages are expected, e.g.
# echo "func mptcp_pm_add_addr_echoed +fmp" \
> /sys/kernel/debug/dynamic_debug/control
# ./mptcp_join.sh "signal address"; \
echo "$(awk '{print $1}' /proc/uptime) - end"; \
sleep 5s; \
echo "$(awk '{print $1}' /proc/uptime) - restart"; \
./mptcp_join.sh "signal address"
013 signal address
(...)
10.75 - end
15.76 - restart
013 signal address
[ 10.367935] mptcp:mptcp_pm_add_addr_echoed: MPTCP: msk=(...)
(...) => a delay of 5 seconds: printed with a 10.36 ts, but after 'restart'
which was printed at the 15.76 ts.
The 'Fixes' tag here below points to the first pr_debug() used without '\n' in net/mptcp. This patch could be split in many small ones, with different Fixes tag, but it doesn't seem worth it, because it is easy to re-generate this patch with this simple 'sed' command:
git grep -l pr_debug -- net/mptcp |
xargs sed -i "s/\(pr_debug(\".*[^n]\)\(\"[,)]\)/\1\\\n\2/g"
So in case of conflicts, simply drop the modifications, and launch this command.
[ As mentioned above, conflicts were expected, and resolved by using the
'sed' command which is visible above. ]
--- net/mptcp/options.c | 50 ++++++++++++++++++++-------------------- net/mptcp/pm.c | 28 +++++++++++------------ net/mptcp/pm_netlink.c | 20 ++++++++-------- net/mptcp/protocol.c | 52 +++++++++++++++++++++--------------------- net/mptcp/protocol.h | 4 ++-- net/mptcp/sockopt.c | 4 ++-- net/mptcp/subflow.c | 50 ++++++++++++++++++++-------------------- 7 files changed, 104 insertions(+), 104 deletions(-)
net/mptcp/options.c +25 -25
@@ -112,7 +112,7 @@ static void mptcp_parse_option(const struct sk_buff *skb, mp_opt->suboptions |=OPTION_MPTCP_CSUMREQD ; ptr +=2 ; } -pr_debug ("MP_CAPABLE version=%x, flags=%x, optlen=%d sndr=%llu, rcvr=%llu len=%d csum=%u" , +pr_debug ("MP_CAPABLE version=%x, flags=%x, optlen=%d sndr=%llu, rcvr=%llu len=%d csum=%u\n" , version, flags, opsize, mp_opt->sndr_key, mp_opt->rcvr_key, mp_opt->data_len, mp_opt->csum);break ;
@@ -126,7 +126,7 @@ static void mptcp_parse_option(const struct sk_buff *skb, ptr +=4 ; mp_opt->nonce =get_unaligned_be32 (ptr); ptr +=4 ; -pr_debug ("MP_JOIN bkup=%u, id=%u, token=%u, nonce=%u" , +pr_debug ("MP_JOIN bkup=%u, id=%u, token=%u, nonce=%u\n" , mp_opt->backup, mp_opt->join_id, mp_opt->token, mp_opt->nonce); }else if (opsize ==TCPOLEN_MPTCP_MPJ_SYNACK ) {
@@ -137,19 +137,19 @@ static void mptcp_parse_option(const struct sk_buff *skb, ptr +=8 ; mp_opt->nonce =get_unaligned_be32 (ptr); ptr +=4 ; -pr_debug ("MP_JOIN bkup=%u, id=%u, thmac=%llu, nonce=%u" , +pr_debug ("MP_JOIN bkup=%u, id=%u, thmac=%llu, nonce=%u\n" , mp_opt->backup, mp_opt->join_id, mp_opt->thmac, mp_opt->nonce); }else if (opsize ==TCPOLEN_MPTCP_MPJ_ACK ) { mp_opt->suboptions |=OPTION_MPTCP_MPJ_ACK ; ptr +=2 ;memcpy (mp_opt->hmac, ptr,MPTCPOPT_HMAC_LEN ); -pr_debug ("MP_JOIN hmac" ); +pr_debug ("MP_JOIN hmac\n" ); }break ;case MPTCPOPT_DSS : -pr_debug ("DSS" ); +pr_debug ("DSS\n" ); ptr++;/* we must clear 'mpc_map' be able to detect MP_CAPABLE
@@ -164,7 +164,7 @@ static void mptcp_parse_option(const struct sk_buff *skb, mp_opt->ack64 = (flags &MPTCP_DSS_ACK64 ) !=0 ; mp_opt->use_ack = (flags &MPTCP_DSS_HAS_ACK ); -pr_debug ("data_fin=%d dsn64=%d use_map=%d ack64=%d use_ack=%d" , +pr_debug ("data_fin=%d dsn64=%d use_map=%d ack64=%d use_ack=%d\n" , mp_opt->data_fin, mp_opt->dsn64, mp_opt->use_map, mp_opt->ack64, mp_opt->use_ack);
@@ -202,7 +202,7 @@ static void mptcp_parse_option(const struct sk_buff *skb, ptr +=4 ; } -pr_debug ("data_ack=%llu" , mp_opt->data_ack); +pr_debug ("data_ack=%llu\n" , mp_opt->data_ack); }if (mp_opt->use_map) {
@@ -226,7 +226,7 @@ static void mptcp_parse_option(const struct sk_buff *skb, ptr +=2 ; } -pr_debug ("data_seq=%llu subflow_seq=%u data_len=%u csum=%d:%u" , +pr_debug ("data_seq=%llu subflow_seq=%u data_len=%u csum=%d:%u\n" , mp_opt->data_seq, mp_opt->subflow_seq, mp_opt->data_len, !!(mp_opt->suboptions &OPTION_MPTCP_CSUMREQD ), mp_opt->csum);
@@ -288,7 +288,7 @@ static void mptcp_parse_option(const struct sk_buff *skb, mp_opt->ahmac =get_unaligned_be64 (ptr); ptr +=8 ; } -pr_debug ("ADD_ADDR%s: id=%d, ahmac=%llu, echo=%d, port=%d" , +pr_debug ("ADD_ADDR%s: id=%d, ahmac=%llu, echo=%d, port=%d\n" , (mp_opt->addr.family ==AF_INET6 ) ?"6" :"" , mp_opt->addr.id, mp_opt->ahmac, mp_opt->echo,ntohs (mp_opt->addr.port));break ;
@@ -304,7 +304,7 @@ static void mptcp_parse_option(const struct sk_buff *skb, mp_opt->rm_list.nr = opsize -TCPOLEN_MPTCP_RM_ADDR_BASE ;for (i =0 ; i < mp_opt->rm_list.nr; i++) mp_opt->rm_list.ids[i] = *ptr++; -pr_debug ("RM_ADDR: rm_list_nr=%d" , mp_opt->rm_list.nr); +pr_debug ("RM_ADDR: rm_list_nr=%d\n" , mp_opt->rm_list.nr);break ;case MPTCPOPT_MP_PRIO :
@@ -313,7 +313,7 @@ static void mptcp_parse_option(const struct sk_buff *skb, mp_opt->suboptions |=OPTION_MPTCP_PRIO ; mp_opt->backup = *ptr++ &MPTCP_PRIO_BKUP ; -pr_debug ("MP_PRIO: prio=%d" , mp_opt->backup); +pr_debug ("MP_PRIO: prio=%d\n" , mp_opt->backup);break ;case MPTCPOPT_MP_FASTCLOSE :
@@ -324,7 +324,7 @@ static void mptcp_parse_option(const struct sk_buff *skb, mp_opt->rcvr_key =get_unaligned_be64 (ptr); ptr +=8 ; mp_opt->suboptions |=OPTION_MPTCP_FASTCLOSE ; -pr_debug ("MP_FASTCLOSE: recv_key=%llu" , mp_opt->rcvr_key); +pr_debug ("MP_FASTCLOSE: recv_key=%llu\n" , mp_opt->rcvr_key);break ;case MPTCPOPT_RST :
@@ -338,7 +338,7 @@ static void mptcp_parse_option(const struct sk_buff *skb, flags = *ptr++; mp_opt->reset_transient = flags &MPTCP_RST_TRANSIENT ; mp_opt->reset_reason = *ptr; -pr_debug ("MP_RST: transient=%u reason=%u" , +pr_debug ("MP_RST: transient=%u reason=%u\n" , mp_opt->reset_transient, mp_opt->reset_reason);break ;
@@ -349,7 +349,7 @@ static void mptcp_parse_option(const struct sk_buff *skb, ptr +=2 ; mp_opt->suboptions |=OPTION_MPTCP_FAIL ; mp_opt->fail_seq =get_unaligned_be64 (ptr); -pr_debug ("MP_FAIL: data_seq=%llu" , mp_opt->fail_seq); +pr_debug ("MP_FAIL: data_seq=%llu\n" , mp_opt->fail_seq);break ;default :
@@ -412,7 +412,7 @@ bool mptcp_syn_options(struct sock *sk, const struct sk_buff *skb, *size =TCPOLEN_MPTCP_MPC_SYN ;return true; }else if (subflow->request_join) { -pr_debug ("remote_token=%u, nonce=%u" , subflow->remote_token, +pr_debug ("remote_token=%u, nonce=%u\n" , subflow->remote_token, subflow->local_nonce); opts->suboptions =OPTION_MPTCP_MPJ_SYN ; opts->join_id = subflow->local_id;
@@ -496,7 +496,7 @@ static bool mptcp_established_options_mp(struct sock *sk, struct sk_buff *skb, *size =TCPOLEN_MPTCP_MPC_ACK ; } -pr_debug ("subflow=%p, local_key=%llu, remote_key=%llu map_len=%d" , +pr_debug ("subflow=%p, local_key=%llu, remote_key=%llu map_len=%d\n" , subflow, subflow->local_key, subflow->remote_key, data_len);
@@ -505,7 +505,7 @@ static bool mptcp_established_options_mp(struct sock *sk, struct sk_buff *skb, opts->suboptions =OPTION_MPTCP_MPJ_ACK ;memcpy (opts->hmac, subflow->hmac,MPTCPOPT_HMAC_LEN ); *size =TCPOLEN_MPTCP_MPJ_ACK ; -pr_debug ("subflow=%p" , subflow); +pr_debug ("subflow=%p\n" , subflow);/* we can use the full delegate action helper only from BH context * If we are in process context - sk is flushing the backlog at
@@ -673,7 +673,7 @@ static bool mptcp_established_options_add_addr(struct sock *sk, struct sk_buff * *size = len;if (drop_other_suboptions) { -pr_debug ("drop other suboptions" ); +pr_debug ("drop other suboptions\n" ); opts->suboptions =0 ;/* note that e.g. DSS could have written into the memory
@@ -690,7 +690,7 @@ static bool mptcp_established_options_add_addr(struct sock *sk, struct sk_buff * msk->remote_key, &opts->addr); } -pr_debug ("addr_id=%d, ahmac=%llu, echo=%d, port=%d" , +pr_debug ("addr_id=%d, ahmac=%llu, echo=%d, port=%d\n" , opts->addr.id, opts->ahmac, echo,ntohs (opts->addr.port));return true;
@@ -721,7 +721,7 @@ static bool mptcp_established_options_rm_addr(struct sock *sk, opts->rm_list = rm_list;for (i =0 ; i < opts->rm_list.nr; i++) -pr_debug ("rm_list_ids[%d]=%d" , i, opts->rm_list.ids[i]); +pr_debug ("rm_list_ids[%d]=%d\n" , i, opts->rm_list.ids[i]);return true; }
@@ -747,7 +747,7 @@ static bool mptcp_established_options_mp_prio(struct sock *sk, opts->suboptions |=OPTION_MPTCP_PRIO ; opts->backup = subflow->request_bkup; -pr_debug ("prio=%d" , opts->backup); +pr_debug ("prio=%d\n" , opts->backup);return true; }
@@ -789,7 +789,7 @@ static bool mptcp_established_options_fastclose(struct sock *sk, opts->suboptions |=OPTION_MPTCP_FASTCLOSE ; opts->rcvr_key = msk->remote_key; -pr_debug ("FASTCLOSE key=%llu" , opts->rcvr_key); +pr_debug ("FASTCLOSE key=%llu\n" , opts->rcvr_key);MPTCP_INC_STATS (sock_net (sk),MPTCP_MIB_MPFASTCLOSETX );return true; }
@@ -811,7 +811,7 @@ static bool mptcp_established_options_mp_fail(struct sock *sk, opts->suboptions |=OPTION_MPTCP_FAIL ; opts->fail_seq = subflow->map_seq; -pr_debug ("MP_FAIL fail_seq=%llu" , opts->fail_seq); +pr_debug ("MP_FAIL fail_seq=%llu\n" , opts->fail_seq);MPTCP_INC_STATS (sock_net (sk),MPTCP_MIB_MPFAILTX );return true;
@@ -899,7 +899,7 @@ bool mptcp_synack_options(const struct request_sock *req, unsigned int *size, opts->csum_reqd = subflow_req->csum_reqd; opts->allow_join_id0 = subflow_req->allow_join_id0; *size =TCPOLEN_MPTCP_MPC_SYNACK ; -pr_debug ("subflow_req=%p, local_key=%llu" , +pr_debug ("subflow_req=%p, local_key=%llu\n" , subflow_req, subflow_req->local_key);return true; }else if (subflow_req->mp_join) {
@@ -908,7 +908,7 @@ bool mptcp_synack_options(const struct request_sock *req, unsigned int *size, opts->join_id = subflow_req->local_id; opts->thmac = subflow_req->thmac; opts->nonce = subflow_req->local_nonce; -pr_debug ("req=%p, bkup=%u, id=%u, thmac=%llu, nonce=%u" , +pr_debug ("req=%p, bkup=%u, id=%u, thmac=%llu, nonce=%u\n" , subflow_req, opts->backup, opts->join_id, opts->thmac, opts->nonce); *size =TCPOLEN_MPTCP_MPJ_SYNACK ;
net/mptcp/pm.c +14 -14
@@ -20,7 +20,7 @@ int mptcp_pm_announce_addr(struct mptcp_sock *msk, {u8 add_addr =READ_ONCE (msk->pm.addr_signal); -pr_debug ("msk=%p, local_id=%d, echo=%d" , msk, addr->id, echo); +pr_debug ("msk=%p, local_id=%d, echo=%d\n" , msk, addr->id, echo);lockdep_assert_held (&msk->pm.lock);
@@ -45,7 +45,7 @@ int mptcp_pm_remove_addr(struct mptcp_sock *msk, const struct mptcp_rm_list *rm_ {u8 rm_addr =READ_ONCE (msk->pm.addr_signal); -pr_debug ("msk=%p, rm_list_nr=%d" , msk, rm_list->nr); +pr_debug ("msk=%p, rm_list_nr=%d\n" , msk, rm_list->nr);if (rm_addr) {pr_warn ("addr_signal error, rm_addr=%d" , rm_addr);
@@ -65,7 +65,7 @@ void mptcp_pm_new_connection(struct mptcp_sock *msk, const struct sock *ssk, int {struct mptcp_pm_data *pm = &msk->pm; -pr_debug ("msk=%p, token=%u side=%d" , msk, msk->token, server_side); +pr_debug ("msk=%p, token=%u side=%d\n" , msk, msk->token, server_side);WRITE_ONCE (pm->server_side, server_side);mptcp_event (MPTCP_EVENT_CREATED , msk, ssk,GFP_ATOMIC );
@@ -89,7 +89,7 @@ bool mptcp_pm_allow_new_subflow(struct mptcp_sock *msk) subflows_max =mptcp_pm_get_subflows_max (msk); -pr_debug ("msk=%p subflows=%d max=%d allow=%d" , msk, pm->subflows, +pr_debug ("msk=%p subflows=%d max=%d allow=%d\n" , msk, pm->subflows, subflows_max,READ_ONCE (pm->accept_subflow));/* try to avoid acquiring the lock below */
@@ -113,7 +113,7 @@ bool mptcp_pm_allow_new_subflow(struct mptcp_sock *msk)static bool mptcp_pm_schedule_work (struct mptcp_sock *msk,enum mptcp_pm_status new_status) { -pr_debug ("msk=%p status=%x new=%lx" , msk, msk->pm.status, +pr_debug ("msk=%p status=%x new=%lx\n" , msk, msk->pm.status,BIT (new_status));if (msk->pm.status &BIT (new_status))return false;
@@ -128,7 +128,7 @@ void mptcp_pm_fully_established(struct mptcp_sock *msk, const struct sock *ssk,struct mptcp_pm_data *pm = &msk->pm;bool announce = false; -pr_debug ("msk=%p" , msk); +pr_debug ("msk=%p\n" , msk);spin_lock_bh (&pm->lock);
@@ -152,14 +152,14 @@ void mptcp_pm_fully_established(struct mptcp_sock *msk, const struct sock *ssk,void mptcp_pm_connection_closed (struct mptcp_sock *msk) { -pr_debug ("msk=%p" , msk); +pr_debug ("msk=%p\n" , msk); }void mptcp_pm_subflow_established (struct mptcp_sock *msk) {struct mptcp_pm_data *pm = &msk->pm; -pr_debug ("msk=%p" , msk); +pr_debug ("msk=%p\n" , msk);if (!READ_ONCE (pm->work_pending))return ;
@@ -211,7 +211,7 @@ void mptcp_pm_add_addr_received(const struct sock *ssk,struct mptcp_sock *msk =mptcp_sk (subflow->conn);struct mptcp_pm_data *pm = &msk->pm; -pr_debug ("msk=%p remote_id=%d accept=%d" , msk, addr->id, +pr_debug ("msk=%p remote_id=%d accept=%d\n" , msk, addr->id,READ_ONCE (pm->accept_addr));mptcp_event_addr_announced (ssk, addr);
@@ -244,7 +244,7 @@ void mptcp_pm_add_addr_echoed(struct mptcp_sock *msk, {struct mptcp_pm_data *pm = &msk->pm; -pr_debug ("msk=%p" , msk); +pr_debug ("msk=%p\n" , msk);spin_lock_bh (&pm->lock);
@@ -268,7 +268,7 @@ void mptcp_pm_rm_addr_received(struct mptcp_sock *msk,struct mptcp_pm_data *pm = &msk->pm;u8 i; -pr_debug ("msk=%p remote_ids_nr=%d" , msk, rm_list->nr); +pr_debug ("msk=%p remote_ids_nr=%d\n" , msk, rm_list->nr);for (i =0 ; i < rm_list->nr; i++)mptcp_event_addr_removed (msk, rm_list->ids[i]);
@@ -307,19 +307,19 @@ void mptcp_pm_mp_fail_received(struct sock *sk, u64 fail_seq)struct mptcp_subflow_context *subflow =mptcp_subflow_ctx (sk);struct mptcp_sock *msk =mptcp_sk (subflow->conn); -pr_debug ("fail_seq=%llu" , fail_seq); +pr_debug ("fail_seq=%llu\n" , fail_seq);if (!READ_ONCE (msk->allow_infinite_fallback))return ;if (!subflow->fail_tout) { -pr_debug ("send MP_FAIL response and infinite map" ); +pr_debug ("send MP_FAIL response and infinite map\n" ); subflow->send_mp_fail =1 ; subflow->send_infinite_map =1 ;tcp_send_ack (sk); }else { -pr_debug ("MP_FAIL response received" ); +pr_debug ("MP_FAIL response received\n" );WRITE_ONCE (subflow->fail_tout,0 ); } }
net/mptcp/pm_netlink.c +10 -10
@@ -305,7 +305,7 @@ static void mptcp_pm_add_timer(struct timer_list *timer)struct mptcp_sock *msk = entry->sock;struct sock *sk = (struct sock *)msk; -pr_debug ("msk=%p" , msk); +pr_debug ("msk=%p\n" , msk);if (!msk)return ;
@@ -324,7 +324,7 @@ static void mptcp_pm_add_timer(struct timer_list *timer)spin_lock_bh (&msk->pm.lock);if (!mptcp_pm_should_add_signal_addr (msk)) { -pr_debug ("retransmit ADD_ADDR id=%d" , entry->addr.id); +pr_debug ("retransmit ADD_ADDR id=%d\n" , entry->addr.id);mptcp_pm_announce_addr (msk, &entry->addr, false);mptcp_pm_add_addr_send_ack (msk); entry->retrans_times++;
@@ -405,7 +405,7 @@ void mptcp_pm_free_anno_list(struct mptcp_sock *msk)struct sock *sk = (struct sock *)msk;LIST_HEAD (free_list); -pr_debug ("msk=%p" , msk); +pr_debug ("msk=%p\n" , msk);spin_lock_bh (&msk->pm.lock);list_splice_init (&msk->pm.anno_list, &free_list);
@@ -482,7 +482,7 @@ static void __mptcp_pm_send_ack(struct mptcp_sock *msk, struct mptcp_subflow_construct sock *ssk =mptcp_subflow_tcp_sock (subflow);bool slow; -pr_debug ("send ack for %s" , +pr_debug ("send ack for %s\n" , prio ?"mp_prio" : (mptcp_pm_should_add_signal (msk) ?"add_addr" :"rm_addr" )); slow =lock_sock_fast (ssk);
@@ -732,7 +732,7 @@ static void mptcp_pm_nl_add_addr_received(struct mptcp_sock *msk) add_addr_accept_max =mptcp_pm_get_add_addr_accept_max (msk); subflows_max =mptcp_pm_get_subflows_max (msk); -pr_debug ("accepted %d:%d remote family %d" , +pr_debug ("accepted %d:%d remote family %d\n" , msk->pm.add_addr_accepted, add_addr_accept_max, msk->pm.remote.family);
@@ -803,7 +803,7 @@ int mptcp_pm_nl_mp_prio_send_ack(struct mptcp_sock *msk, {struct mptcp_subflow_context *subflow; -pr_debug ("bkup=%d" , bkup); +pr_debug ("bkup=%d\n" , bkup);mptcp_for_each_subflow (msk, subflow) {struct sock *ssk =mptcp_subflow_tcp_sock (subflow);
@@ -839,7 +839,7 @@ static void mptcp_pm_nl_rm_addr_or_subflow(struct mptcp_sock *msk,struct sock *sk = (struct sock *)msk;u8 i; -pr_debug ("%s rm_list_nr %d" , +pr_debug ("%s rm_list_nr %d\n" , rm_type ==MPTCP_MIB_RMADDR ?"address" :"subflow" , rm_list->nr);msk_owned_by_me (msk);
@@ -870,7 +870,7 @@ static void mptcp_pm_nl_rm_addr_or_subflow(struct mptcp_sock *msk,if (rm_type ==MPTCP_MIB_RMSUBFLOW && !mptcp_local_id_match (msk, id, rm_id))continue ; -pr_debug (" -> %s rm_list_ids[%d]=%u local_id=%u remote_id=%u mpc_id=%u" , +pr_debug (" -> %s rm_list_ids[%d]=%u local_id=%u remote_id=%u mpc_id=%u\n" , rm_type ==MPTCP_MIB_RMADDR ?"address" :"subflow" , i, rm_id, id, remote_id, msk->mpc_endpoint_id);spin_unlock_bh (&msk->pm.lock);
@@ -927,7 +927,7 @@ void mptcp_pm_nl_work(struct mptcp_sock *msk)spin_lock_bh (&msk->pm.lock); -pr_debug ("msk=%p status=%x" , msk, pm->status); +pr_debug ("msk=%p status=%x\n" , msk, pm->status);if (pm->status &BIT (MPTCP_PM_ADD_ADDR_RECEIVED )) { pm->status &= ~BIT (MPTCP_PM_ADD_ADDR_RECEIVED );mptcp_pm_nl_add_addr_received (msk);
@@ -1539,7 +1539,7 @@ static int mptcp_nl_remove_subflow_and_signal_addr(struct net *net,long s_slot =0 , s_num =0 ;struct mptcp_sock *msk; -pr_debug ("remove_id=%d" , addr->id); +pr_debug ("remove_id=%d\n" , addr->id); list.ids[list.nr++] = addr->id;
net/mptcp/protocol.c +26 -26
206 lines not on this page · raw message
net/mptcp/protocol.h +2 -2
@@ -975,7 +975,7 @@ static inline bool mptcp_check_fallback(const struct sock *sk)static inline void __mptcp_do_fallback (struct mptcp_sock *msk) {if (test_bit (MPTCP_FALLBACK_DONE , &msk->flags)) { -pr_debug ("TCP fallback already done (msk=%p)" , msk); +pr_debug ("TCP fallback already done (msk=%p)\n" , msk);return ; }set_bit (MPTCP_FALLBACK_DONE , &msk->flags);
@@ -1002,7 +1002,7 @@ static inline void mptcp_do_fallback(struct sock *ssk) } } -#define pr_fallback (a) pr_debug("%s:fallback to TCP (msk=%p)", __func__, a) +#define pr_fallback (a) pr_debug("%s:fallback to TCP (msk=%p)\n", __func__, a)static inline bool mptcp_check_infinite_map (struct sk_buff *skb) {
net/mptcp/sockopt.c +2 -2
@@ -881,7 +881,7 @@ int mptcp_setsockopt(struct sock *sk, int level, int optname,struct mptcp_sock *msk =mptcp_sk (sk);struct sock *ssk; -pr_debug ("msk=%p" , msk); +pr_debug ("msk=%p\n" , msk);if (level ==SOL_SOCKET )return mptcp_setsockopt_sol_socket (msk, optname, optval, optlen);
@@ -1292,7 +1292,7 @@ int mptcp_getsockopt(struct sock *sk, int level, int optname,struct mptcp_sock *msk =mptcp_sk (sk);struct sock *ssk; -pr_debug ("msk=%p" , msk); +pr_debug ("msk=%p\n" , msk);/* @@ the meaning of setsockopt() when the socket is connected and * there are multiple subflows is not yet defined. It is up to the
net/mptcp/subflow.c +25 -25
200 lines not on this page · raw message
Signature · 1 line
2.45.2
Patch "mptcp: pr_debug: add missing \n at the end" has been added to the 6.1-stable tree
This is a note to let you know that I've just added the patch titled
mptcp: pr_debug: add missing \n at the end
to the 6.1-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
mptcp-pr_debug-add-missing-n-at-the-end.patch
and it can be found in the queue-6.1 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
From [email protected] Wed Sep 4 13:09:42 2024
From: "Matthieu Baerts (NGI0)" <[email protected]>
Date: Wed, 4 Sep 2024 13:09:27 +0200
Subject: mptcp: pr_debug: add missing \n at the end
To: [email protected], [email protected]
Cc: MPTCP Upstream <[email protected]>, "Matthieu Baerts (NGI0)" <[email protected]>, Geliang Tang <[email protected]>, Jakub Kicinski <[email protected]>
Message-ID: <[email protected]>
From: "Matthieu Baerts (NGI0)" <[email protected]>
commit cb41b195e634d3f1ecfcd845314e64fd4bb3c7aa upstream.
pr_debug() have been added in various places in MPTCP code to help developers to debug some situations. With the dynamic debug feature, it is easy to enable all or some of them, and asks users to reproduce issues with extra debug.
Many of these pr_debug() don't end with a new line, while no 'pr_cont()' are used in MPTCP code. So the goal was not to display multiple debug messages on one line: they were then not missing the '\n' on purpose. Not having the new line at the end causes these messages to be printed with a delay, when something else needs to be printed. This issue is not visible when many messages need to be printed, but it is annoying and confusing when only specific messages are expected, e.g.
# echo "func mptcp_pm_add_addr_echoed +fmp" \
> /sys/kernel/debug/dynamic_debug/control
# ./mptcp_join.sh "signal address"; \
echo "$(awk '{print $1}' /proc/uptime) - end"; \
sleep 5s; \
echo "$(awk '{print $1}' /proc/uptime) - restart"; \
./mptcp_join.sh "signal address"
013 signal address
(...)
10.75 - end
15.76 - restart
013 signal address
[ 10.367935] mptcp:mptcp_pm_add_addr_echoed: MPTCP: msk=(...)
(...) => a delay of 5 seconds: printed with a 10.36 ts, but after 'restart'
which was printed at the 15.76 ts.
The 'Fixes' tag here below points to the first pr_debug() used without '\n' in net/mptcp. This patch could be split in many small ones, with different Fixes tag, but it doesn't seem worth it, because it is easy to re-generate this patch with this simple 'sed' command:
git grep -l pr_debug -- net/mptcp |
xargs sed -i "s/\(pr_debug(\".*[^n]\)\(\"[,)]\)/\1\\\n\2/g"
So in case of conflicts, simply drop the modifications, and launch this command.
[ As mentioned above, conflicts were expected, and resolved by using the
'sed' command which is visible above. ]
--- net/mptcp/options.c | 50 +++++++++++++++++++++++------------------------ net/mptcp/pm.c | 28 +++++++++++++------------- net/mptcp/pm_netlink.c | 20 +++++++++--------- net/mptcp/protocol.c | 52 ++++++++++++++++++++++++------------------------- net/mptcp/protocol.h | 4 +-- net/mptcp/sockopt.c | 4 +-- net/mptcp/subflow.c | 50 +++++++++++++++++++++++------------------------ 7 files changed, 104 insertions(+), 104 deletions(-)
net/mptcp/options.c +25 -25
@@ -112,7 +112,7 @@ static void mptcp_parse_option(const str mp_opt->suboptions |=OPTION_MPTCP_CSUMREQD ; ptr +=2 ; } -pr_debug ("MP_CAPABLE version=%x, flags=%x, optlen=%d sndr=%llu, rcvr=%llu len=%d csum=%u" , +pr_debug ("MP_CAPABLE version=%x, flags=%x, optlen=%d sndr=%llu, rcvr=%llu len=%d csum=%u\n" , version, flags, opsize, mp_opt->sndr_key, mp_opt->rcvr_key, mp_opt->data_len, mp_opt->csum);break ;
@@ -126,7 +126,7 @@ static void mptcp_parse_option(const str ptr +=4 ; mp_opt->nonce =get_unaligned_be32 (ptr); ptr +=4 ; -pr_debug ("MP_JOIN bkup=%u, id=%u, token=%u, nonce=%u" , +pr_debug ("MP_JOIN bkup=%u, id=%u, token=%u, nonce=%u\n" , mp_opt->backup, mp_opt->join_id, mp_opt->token, mp_opt->nonce); }else if (opsize ==TCPOLEN_MPTCP_MPJ_SYNACK ) {
@@ -137,19 +137,19 @@ static void mptcp_parse_option(const str ptr +=8 ; mp_opt->nonce =get_unaligned_be32 (ptr); ptr +=4 ; -pr_debug ("MP_JOIN bkup=%u, id=%u, thmac=%llu, nonce=%u" , +pr_debug ("MP_JOIN bkup=%u, id=%u, thmac=%llu, nonce=%u\n" , mp_opt->backup, mp_opt->join_id, mp_opt->thmac, mp_opt->nonce); }else if (opsize ==TCPOLEN_MPTCP_MPJ_ACK ) { mp_opt->suboptions |=OPTION_MPTCP_MPJ_ACK ; ptr +=2 ;memcpy (mp_opt->hmac, ptr,MPTCPOPT_HMAC_LEN ); -pr_debug ("MP_JOIN hmac" ); +pr_debug ("MP_JOIN hmac\n" ); }break ;case MPTCPOPT_DSS : -pr_debug ("DSS" ); +pr_debug ("DSS\n" ); ptr++;/* we must clear 'mpc_map' be able to detect MP_CAPABLE
@@ -164,7 +164,7 @@ static void mptcp_parse_option(const str mp_opt->ack64 = (flags &MPTCP_DSS_ACK64 ) !=0 ; mp_opt->use_ack = (flags &MPTCP_DSS_HAS_ACK ); -pr_debug ("data_fin=%d dsn64=%d use_map=%d ack64=%d use_ack=%d" , +pr_debug ("data_fin=%d dsn64=%d use_map=%d ack64=%d use_ack=%d\n" , mp_opt->data_fin, mp_opt->dsn64, mp_opt->use_map, mp_opt->ack64, mp_opt->use_ack);
@@ -202,7 +202,7 @@ static void mptcp_parse_option(const str ptr +=4 ; } -pr_debug ("data_ack=%llu" , mp_opt->data_ack); +pr_debug ("data_ack=%llu\n" , mp_opt->data_ack); }if (mp_opt->use_map) {
@@ -226,7 +226,7 @@ static void mptcp_parse_option(const str ptr +=2 ; } -pr_debug ("data_seq=%llu subflow_seq=%u data_len=%u csum=%d:%u" , +pr_debug ("data_seq=%llu subflow_seq=%u data_len=%u csum=%d:%u\n" , mp_opt->data_seq, mp_opt->subflow_seq, mp_opt->data_len, !!(mp_opt->suboptions &OPTION_MPTCP_CSUMREQD ), mp_opt->csum);
@@ -288,7 +288,7 @@ static void mptcp_parse_option(const str mp_opt->ahmac =get_unaligned_be64 (ptr); ptr +=8 ; } -pr_debug ("ADD_ADDR%s: id=%d, ahmac=%llu, echo=%d, port=%d" , +pr_debug ("ADD_ADDR%s: id=%d, ahmac=%llu, echo=%d, port=%d\n" , (mp_opt->addr.family ==AF_INET6 ) ?"6" :"" , mp_opt->addr.id, mp_opt->ahmac, mp_opt->echo,ntohs (mp_opt->addr.port));break ;
@@ -304,7 +304,7 @@ static void mptcp_parse_option(const str mp_opt->rm_list.nr = opsize -TCPOLEN_MPTCP_RM_ADDR_BASE ;for (i =0 ; i < mp_opt->rm_list.nr; i++) mp_opt->rm_list.ids[i] = *ptr++; -pr_debug ("RM_ADDR: rm_list_nr=%d" , mp_opt->rm_list.nr); +pr_debug ("RM_ADDR: rm_list_nr=%d\n" , mp_opt->rm_list.nr);break ;case MPTCPOPT_MP_PRIO :
@@ -313,7 +313,7 @@ static void mptcp_parse_option(const str mp_opt->suboptions |=OPTION_MPTCP_PRIO ; mp_opt->backup = *ptr++ &MPTCP_PRIO_BKUP ; -pr_debug ("MP_PRIO: prio=%d" , mp_opt->backup); +pr_debug ("MP_PRIO: prio=%d\n" , mp_opt->backup);break ;case MPTCPOPT_MP_FASTCLOSE :
@@ -324,7 +324,7 @@ static void mptcp_parse_option(const str mp_opt->rcvr_key =get_unaligned_be64 (ptr); ptr +=8 ; mp_opt->suboptions |=OPTION_MPTCP_FASTCLOSE ; -pr_debug ("MP_FASTCLOSE: recv_key=%llu" , mp_opt->rcvr_key); +pr_debug ("MP_FASTCLOSE: recv_key=%llu\n" , mp_opt->rcvr_key);break ;case MPTCPOPT_RST :
@@ -338,7 +338,7 @@ static void mptcp_parse_option(const str flags = *ptr++; mp_opt->reset_transient = flags &MPTCP_RST_TRANSIENT ; mp_opt->reset_reason = *ptr; -pr_debug ("MP_RST: transient=%u reason=%u" , +pr_debug ("MP_RST: transient=%u reason=%u\n" , mp_opt->reset_transient, mp_opt->reset_reason);break ;
@@ -349,7 +349,7 @@ static void mptcp_parse_option(const str ptr +=2 ; mp_opt->suboptions |=OPTION_MPTCP_FAIL ; mp_opt->fail_seq =get_unaligned_be64 (ptr); -pr_debug ("MP_FAIL: data_seq=%llu" , mp_opt->fail_seq); +pr_debug ("MP_FAIL: data_seq=%llu\n" , mp_opt->fail_seq);break ;default :
@@ -412,7 +412,7 @@ bool mptcp_syn_options(struct sock *sk, *size =TCPOLEN_MPTCP_MPC_SYN ;return true; }else if (subflow->request_join) { -pr_debug ("remote_token=%u, nonce=%u" , subflow->remote_token, +pr_debug ("remote_token=%u, nonce=%u\n" , subflow->remote_token, subflow->local_nonce); opts->suboptions =OPTION_MPTCP_MPJ_SYN ; opts->join_id = subflow->local_id;
@@ -496,7 +496,7 @@ static bool mptcp_established_options_mp *size =TCPOLEN_MPTCP_MPC_ACK ; } -pr_debug ("subflow=%p, local_key=%llu, remote_key=%llu map_len=%d" , +pr_debug ("subflow=%p, local_key=%llu, remote_key=%llu map_len=%d\n" , subflow, subflow->local_key, subflow->remote_key, data_len);
@@ -505,7 +505,7 @@ static bool mptcp_established_options_mp opts->suboptions =OPTION_MPTCP_MPJ_ACK ;memcpy (opts->hmac, subflow->hmac,MPTCPOPT_HMAC_LEN ); *size =TCPOLEN_MPTCP_MPJ_ACK ; -pr_debug ("subflow=%p" , subflow); +pr_debug ("subflow=%p\n" , subflow);/* we can use the full delegate action helper only from BH context * If we are in process context - sk is flushing the backlog at
@@ -673,7 +673,7 @@ static bool mptcp_established_options_ad *size = len;if (drop_other_suboptions) { -pr_debug ("drop other suboptions" ); +pr_debug ("drop other suboptions\n" ); opts->suboptions =0 ;/* note that e.g. DSS could have written into the memory
@@ -690,7 +690,7 @@ static bool mptcp_established_options_ad msk->remote_key, &opts->addr); } -pr_debug ("addr_id=%d, ahmac=%llu, echo=%d, port=%d" , +pr_debug ("addr_id=%d, ahmac=%llu, echo=%d, port=%d\n" , opts->addr.id, opts->ahmac, echo,ntohs (opts->addr.port));return true;
@@ -721,7 +721,7 @@ static bool mptcp_established_options_rm opts->rm_list = rm_list;for (i =0 ; i < opts->rm_list.nr; i++) -pr_debug ("rm_list_ids[%d]=%d" , i, opts->rm_list.ids[i]); +pr_debug ("rm_list_ids[%d]=%d\n" , i, opts->rm_list.ids[i]);return true; }
@@ -747,7 +747,7 @@ static bool mptcp_established_options_mp opts->suboptions |=OPTION_MPTCP_PRIO ; opts->backup = subflow->request_bkup; -pr_debug ("prio=%d" , opts->backup); +pr_debug ("prio=%d\n" , opts->backup);return true; }
@@ -789,7 +789,7 @@ static bool mptcp_established_options_fa opts->suboptions |=OPTION_MPTCP_FASTCLOSE ; opts->rcvr_key = msk->remote_key; -pr_debug ("FASTCLOSE key=%llu" , opts->rcvr_key); +pr_debug ("FASTCLOSE key=%llu\n" , opts->rcvr_key);MPTCP_INC_STATS (sock_net (sk),MPTCP_MIB_MPFASTCLOSETX );return true; }
@@ -811,7 +811,7 @@ static bool mptcp_established_options_mp opts->suboptions |=OPTION_MPTCP_FAIL ; opts->fail_seq = subflow->map_seq; -pr_debug ("MP_FAIL fail_seq=%llu" , opts->fail_seq); +pr_debug ("MP_FAIL fail_seq=%llu\n" , opts->fail_seq);MPTCP_INC_STATS (sock_net (sk),MPTCP_MIB_MPFAILTX );return true;
@@ -899,7 +899,7 @@ bool mptcp_synack_options(const struct r opts->csum_reqd = subflow_req->csum_reqd; opts->allow_join_id0 = subflow_req->allow_join_id0; *size =TCPOLEN_MPTCP_MPC_SYNACK ; -pr_debug ("subflow_req=%p, local_key=%llu" , +pr_debug ("subflow_req=%p, local_key=%llu\n" , subflow_req, subflow_req->local_key);return true; }else if (subflow_req->mp_join) {
@@ -908,7 +908,7 @@ bool mptcp_synack_options(const struct r opts->join_id = subflow_req->local_id; opts->thmac = subflow_req->thmac; opts->nonce = subflow_req->local_nonce; -pr_debug ("req=%p, bkup=%u, id=%u, thmac=%llu, nonce=%u" , +pr_debug ("req=%p, bkup=%u, id=%u, thmac=%llu, nonce=%u\n" , subflow_req, opts->backup, opts->join_id, opts->thmac, opts->nonce); *size =TCPOLEN_MPTCP_MPJ_SYNACK ;
net/mptcp/pm.c +14 -14
@@ -20,7 +20,7 @@ int mptcp_pm_announce_addr(struct mptcp_ {u8 add_addr =READ_ONCE (msk->pm.addr_signal); -pr_debug ("msk=%p, local_id=%d, echo=%d" , msk, addr->id, echo); +pr_debug ("msk=%p, local_id=%d, echo=%d\n" , msk, addr->id, echo);lockdep_assert_held (&msk->pm.lock);
@@ -45,7 +45,7 @@ int mptcp_pm_remove_addr(struct mptcp_so {u8 rm_addr =READ_ONCE (msk->pm.addr_signal); -pr_debug ("msk=%p, rm_list_nr=%d" , msk, rm_list->nr); +pr_debug ("msk=%p, rm_list_nr=%d\n" , msk, rm_list->nr);if (rm_addr) {pr_warn ("addr_signal error, rm_addr=%d" , rm_addr);
@@ -65,7 +65,7 @@ void mptcp_pm_new_connection(struct mptc {struct mptcp_pm_data *pm = &msk->pm; -pr_debug ("msk=%p, token=%u side=%d" , msk, msk->token, server_side); +pr_debug ("msk=%p, token=%u side=%d\n" , msk, msk->token, server_side);WRITE_ONCE (pm->server_side, server_side);mptcp_event (MPTCP_EVENT_CREATED , msk, ssk,GFP_ATOMIC );
@@ -89,7 +89,7 @@ bool mptcp_pm_allow_new_subflow(struct m subflows_max =mptcp_pm_get_subflows_max (msk); -pr_debug ("msk=%p subflows=%d max=%d allow=%d" , msk, pm->subflows, +pr_debug ("msk=%p subflows=%d max=%d allow=%d\n" , msk, pm->subflows, subflows_max,READ_ONCE (pm->accept_subflow));/* try to avoid acquiring the lock below */
@@ -113,7 +113,7 @@ bool mptcp_pm_allow_new_subflow(struct mstatic bool mptcp_pm_schedule_work (struct mptcp_sock *msk,enum mptcp_pm_status new_status) { -pr_debug ("msk=%p status=%x new=%lx" , msk, msk->pm.status, +pr_debug ("msk=%p status=%x new=%lx\n" , msk, msk->pm.status,BIT (new_status));if (msk->pm.status &BIT (new_status))return false;
@@ -128,7 +128,7 @@ void mptcp_pm_fully_established(struct mstruct mptcp_pm_data *pm = &msk->pm;bool announce = false; -pr_debug ("msk=%p" , msk); +pr_debug ("msk=%p\n" , msk);spin_lock_bh (&pm->lock);
@@ -152,14 +152,14 @@ void mptcp_pm_fully_established(struct mvoid mptcp_pm_connection_closed (struct mptcp_sock *msk) { -pr_debug ("msk=%p" , msk); +pr_debug ("msk=%p\n" , msk); }void mptcp_pm_subflow_established (struct mptcp_sock *msk) {struct mptcp_pm_data *pm = &msk->pm; -pr_debug ("msk=%p" , msk); +pr_debug ("msk=%p\n" , msk);if (!READ_ONCE (pm->work_pending))return ;
@@ -211,7 +211,7 @@ void mptcp_pm_add_addr_received(const ststruct mptcp_sock *msk =mptcp_sk (subflow->conn);struct mptcp_pm_data *pm = &msk->pm; -pr_debug ("msk=%p remote_id=%d accept=%d" , msk, addr->id, +pr_debug ("msk=%p remote_id=%d accept=%d\n" , msk, addr->id,READ_ONCE (pm->accept_addr));mptcp_event_addr_announced (ssk, addr);
@@ -244,7 +244,7 @@ void mptcp_pm_add_addr_echoed(struct mpt {struct mptcp_pm_data *pm = &msk->pm; -pr_debug ("msk=%p" , msk); +pr_debug ("msk=%p\n" , msk);spin_lock_bh (&pm->lock);
@@ -268,7 +268,7 @@ void mptcp_pm_rm_addr_received(struct mpstruct mptcp_pm_data *pm = &msk->pm;u8 i; -pr_debug ("msk=%p remote_ids_nr=%d" , msk, rm_list->nr); +pr_debug ("msk=%p remote_ids_nr=%d\n" , msk, rm_list->nr);for (i =0 ; i < rm_list->nr; i++)mptcp_event_addr_removed (msk, rm_list->ids[i]);
@@ -307,19 +307,19 @@ void mptcp_pm_mp_fail_received(struct sostruct mptcp_subflow_context *subflow =mptcp_subflow_ctx (sk);struct mptcp_sock *msk =mptcp_sk (subflow->conn); -pr_debug ("fail_seq=%llu" , fail_seq); +pr_debug ("fail_seq=%llu\n" , fail_seq);if (!READ_ONCE (msk->allow_infinite_fallback))return ;if (!subflow->fail_tout) { -pr_debug ("send MP_FAIL response and infinite map" ); +pr_debug ("send MP_FAIL response and infinite map\n" ); subflow->send_mp_fail =1 ; subflow->send_infinite_map =1 ;tcp_send_ack (sk); }else { -pr_debug ("MP_FAIL response received" ); +pr_debug ("MP_FAIL response received\n" );WRITE_ONCE (subflow->fail_tout,0 ); } }
net/mptcp/pm_netlink.c +10 -10
@@ -305,7 +305,7 @@ static void mptcp_pm_add_timer(struct tistruct mptcp_sock *msk = entry->sock;struct sock *sk = (struct sock *)msk; -pr_debug ("msk=%p" , msk); +pr_debug ("msk=%p\n" , msk);if (!msk)return ;
@@ -324,7 +324,7 @@ static void mptcp_pm_add_timer(struct tispin_lock_bh (&msk->pm.lock);if (!mptcp_pm_should_add_signal_addr (msk)) { -pr_debug ("retransmit ADD_ADDR id=%d" , entry->addr.id); +pr_debug ("retransmit ADD_ADDR id=%d\n" , entry->addr.id);mptcp_pm_announce_addr (msk, &entry->addr, false);mptcp_pm_add_addr_send_ack (msk); entry->retrans_times++;
@@ -405,7 +405,7 @@ void mptcp_pm_free_anno_list(struct mptcstruct sock *sk = (struct sock *)msk;LIST_HEAD (free_list); -pr_debug ("msk=%p" , msk); +pr_debug ("msk=%p\n" , msk);spin_lock_bh (&msk->pm.lock);list_splice_init (&msk->pm.anno_list, &free_list);
@@ -482,7 +482,7 @@ static void __mptcp_pm_send_ack(struct mstruct sock *ssk =mptcp_subflow_tcp_sock (subflow);bool slow; -pr_debug ("send ack for %s" , +pr_debug ("send ack for %s\n" , prio ?"mp_prio" : (mptcp_pm_should_add_signal (msk) ?"add_addr" :"rm_addr" )); slow =lock_sock_fast (ssk);
@@ -732,7 +732,7 @@ static void mptcp_pm_nl_add_addr_receive add_addr_accept_max =mptcp_pm_get_add_addr_accept_max (msk); subflows_max =mptcp_pm_get_subflows_max (msk); -pr_debug ("accepted %d:%d remote family %d" , +pr_debug ("accepted %d:%d remote family %d\n" , msk->pm.add_addr_accepted, add_addr_accept_max, msk->pm.remote.family);
@@ -803,7 +803,7 @@ int mptcp_pm_nl_mp_prio_send_ack(struct {struct mptcp_subflow_context *subflow; -pr_debug ("bkup=%d" , bkup); +pr_debug ("bkup=%d\n" , bkup);mptcp_for_each_subflow (msk, subflow) {struct sock *ssk =mptcp_subflow_tcp_sock (subflow);
@@ -834,7 +834,7 @@ static void mptcp_pm_nl_rm_addr_or_subflstruct sock *sk = (struct sock *)msk;u8 i; -pr_debug ("%s rm_list_nr %d" , +pr_debug ("%s rm_list_nr %d\n" , rm_type ==MPTCP_MIB_RMADDR ?"address" :"subflow" , rm_list->nr);msk_owned_by_me (msk);
@@ -865,7 +865,7 @@ static void mptcp_pm_nl_rm_addr_or_subflif (rm_type ==MPTCP_MIB_RMSUBFLOW && id != rm_id)continue ; -pr_debug (" -> %s rm_list_ids[%d]=%u local_id=%u remote_id=%u mpc_id=%u" , +pr_debug (" -> %s rm_list_ids[%d]=%u local_id=%u remote_id=%u mpc_id=%u\n" , rm_type ==MPTCP_MIB_RMADDR ?"address" :"subflow" , i, rm_id, id, remote_id, msk->mpc_endpoint_id);spin_unlock_bh (&msk->pm.lock);
@@ -922,7 +922,7 @@ void mptcp_pm_nl_work(struct mptcp_sockspin_lock_bh (&msk->pm.lock); -pr_debug ("msk=%p status=%x" , msk, pm->status); +pr_debug ("msk=%p status=%x\n" , msk, pm->status);if (pm->status &BIT (MPTCP_PM_ADD_ADDR_RECEIVED )) { pm->status &= ~BIT (MPTCP_PM_ADD_ADDR_RECEIVED );mptcp_pm_nl_add_addr_received (msk);
@@ -1540,7 +1540,7 @@ static int mptcp_nl_remove_subflow_and_slong s_slot =0 , s_num =0 ;struct mptcp_sock *msk; -pr_debug ("remove_id=%d" , addr->id); +pr_debug ("remove_id=%d\n" , addr->id);while ((msk =mptcp_token_iter_next (net, &s_slot, &s_num)) !=NULL ) {struct sock *sk = (struct sock *)msk;
net/mptcp/protocol.c +26 -26
206 lines not on this page · raw message
net/mptcp/protocol.h +2 -2
@@ -973,7 +973,7 @@ static inline bool mptcp_check_fallback(static inline void __mptcp_do_fallback (struct mptcp_sock *msk) {if (test_bit (MPTCP_FALLBACK_DONE , &msk->flags)) { -pr_debug ("TCP fallback already done (msk=%p)" , msk); +pr_debug ("TCP fallback already done (msk=%p)\n" , msk);return ; }set_bit (MPTCP_FALLBACK_DONE , &msk->flags);
@@ -1000,7 +1000,7 @@ static inline void mptcp_do_fallback(str } } -#define pr_fallback (a) pr_debug("%s:fallback to TCP (msk=%p)", __func__, a) +#define pr_fallback (a) pr_debug("%s:fallback to TCP (msk=%p)\n", __func__, a)static inline bool mptcp_check_infinite_map (struct sk_buff *skb) {
net/mptcp/sockopt.c +2 -2
@@ -881,7 +881,7 @@ int mptcp_setsockopt(struct sock *sk, instruct mptcp_sock *msk =mptcp_sk (sk);struct sock *ssk; -pr_debug ("msk=%p" , msk); +pr_debug ("msk=%p\n" , msk);if (level ==SOL_SOCKET )return mptcp_setsockopt_sol_socket (msk, optname, optval, optlen);
@@ -1292,7 +1292,7 @@ int mptcp_getsockopt(struct sock *sk, instruct mptcp_sock *msk =mptcp_sk (sk);struct sock *ssk; -pr_debug ("msk=%p" , msk); +pr_debug ("msk=%p\n" , msk);/* @@ the meaning of setsockopt() when the socket is connected and * there are multiple subflows is not yet defined. It is up to the
net/mptcp/subflow.c +25 -25
200 lines not on this page · raw message
Patches currently in stable-queue which might be from [email protected] are
queue-6.1/mptcp-pm-fix-rm_addr-id-for-the-initial-subflow.patch queue-6.1/selftests-mptcp-join-validate-fullmesh-endp-on-1st-sf.patch queue-6.1/mptcp-pm-fix-id-0-endp-usage-after-multiple-re-creations.patch queue-6.1/mptcp-make-pm_remove_addrs_and_subflows-static.patch queue-6.1/mptcp-pm-avoid-possible-uaf-when-selecting-endp.patch queue-6.1/mptcp-pm-reuse-id-0-after-delete-and-re-add.patch queue-6.1/selftests-mptcp-join-check-re-adding-init-endp-with-id.patch queue-6.1/selftests-mptcp-join-test-for-flush-re-add-endpoints.patch queue-6.1/selftests-mptcp-add-explicit-test-case-for-remove-re.patch queue-6.1/selftests-mptcp-add-explicit-test-case-for-remove-readd.patch queue-6.1/selftests-mptcp-join-check-re-adding-init-endp-with-.patch queue-6.1/selftests-mptcp-join-check-re-using-id-of-closed-subflow.patch queue-6.1/mptcp-pm-fullmesh-select-the-right-id-later.patch queue-6.1/mptcp-pr_debug-add-missing-n-at-the-end.patch queue-6.1/selftests-mptcp-join-check-re-using-id-of-unused-add.patch queue-6.1/selftests-mptcp-join-check-re-using-id-of-unused-add_addr.patch
Re: [PATCH 6.1.y] mptcp: pr_debug: add missing \n at the end
In reply to Matthieu Baerts (NGI0)Quoted 2 lines · On Wed, Sep 04, 2024 at 01:09:27PM +0200, Matthieu Baerts (NGI0) wrote:
commit
cb41b195e634d3f1ecfcd845314e64fd4bb3c7aaupstream.
Applied