From patchwork Tue Dec 19 14:38:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kirjanov X-Patchwork-Id: 13498390 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com [209.85.208.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 020741C68A for ; Tue, 19 Dec 2023 14:38:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Hhf8Aa0B" Received: by mail-lj1-f175.google.com with SMTP id 38308e7fff4ca-2cc73761da8so4895491fa.0 for ; Tue, 19 Dec 2023 06:38:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702996719; x=1703601519; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=qKgoMy076WE34vDGvIcACbz4bJojD67rt9QR1z9EtFk=; b=Hhf8Aa0BKfjscoh1OeGrNhZsqh9usnFDbctv3VUnv8ogt0Dr4IS97dWRPcTNz0ktb2 7+mAwVBwQC08pvpcFBozjKwhlem6W6fRplRjUgD+GhmqJJIJ51yQxZfG5A7epASHGq/I BhAahSbMK5LyzrbsIg8K1vGSZlhN7owdI+gZVOUdNc24xfsdSZSLqH5DCVKQsQOdem6i AdlCgDDmojRokRYwI4c/Ah7hlY8qcCxN9H8LPx9zdSztZy0aJVzgGgJabARsDLRHXeny fDA36g+tFjUg5KD2qTvk+SkC7wWsBwCosGWxqUa7jIiM0J7ix39e7mk2gaOLjSYNO9ql y6YQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702996719; x=1703601519; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=qKgoMy076WE34vDGvIcACbz4bJojD67rt9QR1z9EtFk=; b=XlaxSRbe2bGYcsGDsUfhxKBnij+9ypShaQY8M9BIP/kHiLc5HfMqAO2zkoCBuLk2O9 ts2SuDqvdyrYNd5s4yhH58bD7jLrtm4mgZPhpz0Jui66DnKnREz8XYPO+pDW5fudpNWS YLXKYkD42+Twyor/06Tp4Z6gKF3zb8VnhhYeHm66Z57AiqxZtwy0Ylin0cyYycaXjyzO 3SVNiDFNjJfMzn/0OOHRtYX1aYQ1JRy/1/dZVSyfzVZXNrwaGOKqPcVOhpLPSdwsDlYL lbDVmg/LnUZZ12eMRdoBRmat5ZRJIHsV2G+yjN8GkX+kdJkrIXVBN7HA0khE5i/5vi6i hBXQ== X-Gm-Message-State: AOJu0YzRUYWXI5Rvk7bW8UFIhV4yQdPK7rbZmchCLhxbQMlpvy1XleXb qarqSJ1FGi79Kd+onqh+6Fg+XpvwoyBWWGMg X-Google-Smtp-Source: AGHT+IHZlynjtMyoJq3VniF+c5LKYULwHY5lh7N8tv46jHe7SWw+9gWnb9h8ypsVWMhrrcv/QPOucw== X-Received: by 2002:a2e:a99f:0:b0:2cc:6ce9:b927 with SMTP id x31-20020a2ea99f000000b002cc6ce9b927mr4927577ljq.1.1702996718430; Tue, 19 Dec 2023 06:38:38 -0800 (PST) Received: from localhost.localdomain ([83.217.200.104]) by smtp.gmail.com with ESMTPSA id c6-20020a2e9d86000000b002cc68cce064sm1011014ljj.62.2023.12.19.06.38.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 06:38:38 -0800 (PST) From: Denis Kirjanov X-Google-Original-From: Denis Kirjanov To: netdev@vger.kernel.org Cc: pabeni@redhat.com, Denis Kirjanov Subject: [PATCH net-next v2 1/2] net: remove SOCK_DEBUG leftovers Date: Tue, 19 Dec 2023 17:38:19 +0300 Message-Id: <20231219143820.9379-1-dkirjanov@suse.de> X-Mailer: git-send-email 2.35.1 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org SOCK_DEBUG comes from the old days. Let's move logging to standard net core ratelimited logging functions Signed-off-by: Denis Kirjanov changes in v2: - remove SOCK_DEBUG macro altogether --- net/appletalk/ddp.c | 16 ++++++++-------- net/dccp/ipv6.c | 2 +- net/x25/af_x25.c | 14 +++++++------- net/x25/x25_facilities.c | 14 +++++++------- net/x25/x25_out.c | 2 +- 5 files changed, 24 insertions(+), 24 deletions(-) diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c index a852ec093fa8..198f5ba2feae 100644 --- a/net/appletalk/ddp.c +++ b/net/appletalk/ddp.c @@ -1581,7 +1581,7 @@ static int atalk_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) } /* Build a packet */ - SOCK_DEBUG(sk, "SK %p: Got address.\n", sk); + net_dbg_ratelimited("SK %p: Got address.\n", sk); /* For headers */ size = sizeof(struct ddpehdr) + len + ddp_dl->header_length; @@ -1602,7 +1602,7 @@ static int atalk_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) dev = rt->dev; - SOCK_DEBUG(sk, "SK %p: Size needed %d, device %s\n", + net_dbg_ratelimited("SK %p: Size needed %d, device %s\n", sk, size, dev->name); hard_header_len = dev->hard_header_len; @@ -1631,7 +1631,7 @@ static int atalk_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) skb_reserve(skb, hard_header_len); skb->dev = dev; - SOCK_DEBUG(sk, "SK %p: Begin build.\n", sk); + net_dbg_ratelimited("SK %p: Begin build.\n", sk); ddp = skb_put(skb, sizeof(struct ddpehdr)); ddp->deh_len_hops = htons(len + sizeof(*ddp)); @@ -1642,7 +1642,7 @@ static int atalk_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) ddp->deh_dport = usat->sat_port; ddp->deh_sport = at->src_port; - SOCK_DEBUG(sk, "SK %p: Copy user data (%zd bytes).\n", sk, len); + net_dbg_ratelimited("SK %p: Copy user data (%zd bytes).\n", sk, len); err = memcpy_from_msg(skb_put(skb, len), msg, len); if (err) { @@ -1666,7 +1666,7 @@ static int atalk_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) if (skb2) { loopback = 1; - SOCK_DEBUG(sk, "SK %p: send out(copy).\n", sk); + net_dbg_ratelimited("SK %p: send out(copy).\n", sk); /* * If it fails it is queued/sent above in the aarp queue */ @@ -1675,7 +1675,7 @@ static int atalk_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) } if (dev->flags & IFF_LOOPBACK || loopback) { - SOCK_DEBUG(sk, "SK %p: Loop back.\n", sk); + net_dbg_ratelimited("SK %p: Loop back.\n", sk); /* loop back */ skb_orphan(skb); if (ddp->deh_dnode == ATADDR_BCAST) { @@ -1689,7 +1689,7 @@ static int atalk_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) } ddp_dl->request(ddp_dl, skb, dev->dev_addr); } else { - SOCK_DEBUG(sk, "SK %p: send out.\n", sk); + net_dbg_ratelimited("SK %p: send out.\n", sk); if (rt->flags & RTF_GATEWAY) { gsat.sat_addr = rt->gateway; usat = &gsat; @@ -1700,7 +1700,7 @@ static int atalk_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) */ aarp_send_ddp(dev, skb, &usat->sat_addr, NULL); } - SOCK_DEBUG(sk, "SK %p: Done write (%zd).\n", sk, len); + net_dbg_ratelimited("SK %p: Done write (%zd).\n", sk, len); out: release_sock(sk); diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c index 06d7324276ec..ded07e09f813 100644 --- a/net/dccp/ipv6.c +++ b/net/dccp/ipv6.c @@ -889,7 +889,7 @@ static int dccp_v6_connect(struct sock *sk, struct sockaddr *uaddr, u32 exthdrlen = icsk->icsk_ext_hdr_len; struct sockaddr_in sin; - SOCK_DEBUG(sk, "connect: ipv4 mapped\n"); + net_dbg_ratelimited("connect: ipv4 mapped\n"); if (ipv6_only_sock(sk)) return -ENETUNREACH; diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c index aad8ffeaee04..f7a7c7798c3b 100644 --- a/net/x25/af_x25.c +++ b/net/x25/af_x25.c @@ -704,7 +704,7 @@ static int x25_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) rc = -EINVAL; } release_sock(sk); - SOCK_DEBUG(sk, "x25_bind: socket is bound\n"); + net_dbg_ratelimited("x25_bind: socket is bound\n"); out: return rc; } @@ -1165,10 +1165,10 @@ static int x25_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) goto out; } - SOCK_DEBUG(sk, "x25_sendmsg: sendto: Addresses built.\n"); + net_dbg_ratelimited("x25_sendmsg: sendto: Addresses built.\n"); /* Build a packet */ - SOCK_DEBUG(sk, "x25_sendmsg: sendto: building packet.\n"); + net_dbg_ratelimited("x25_sendmsg: sendto: building packet.\n"); if ((msg->msg_flags & MSG_OOB) && len > 32) len = 32; @@ -1187,7 +1187,7 @@ static int x25_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) /* * Put the data on the end */ - SOCK_DEBUG(sk, "x25_sendmsg: Copying user data\n"); + net_dbg_ratelimited("x25_sendmsg: Copying user data\n"); skb_reset_transport_header(skb); skb_put(skb, len); @@ -1211,7 +1211,7 @@ static int x25_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) /* * Push down the X.25 header */ - SOCK_DEBUG(sk, "x25_sendmsg: Building X.25 Header.\n"); + net_dbg_ratelimited("x25_sendmsg: Building X.25 Header.\n"); if (msg->msg_flags & MSG_OOB) { if (x25->neighbour->extended) { @@ -1245,8 +1245,8 @@ static int x25_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) skb->data[0] |= X25_Q_BIT; } - SOCK_DEBUG(sk, "x25_sendmsg: Built header.\n"); - SOCK_DEBUG(sk, "x25_sendmsg: Transmitting buffer\n"); + net_dbg_ratelimited("x25_sendmsg: Built header.\n"); + net_dbg_ratelimited("x25_sendmsg: Transmitting buffer\n"); rc = -ENOTCONN; if (sk->sk_state != TCP_ESTABLISHED) diff --git a/net/x25/x25_facilities.c b/net/x25/x25_facilities.c index 8e1a49b0c0dc..6dadb217e101 100644 --- a/net/x25/x25_facilities.c +++ b/net/x25/x25_facilities.c @@ -282,7 +282,7 @@ int x25_negotiate_facilities(struct sk_buff *skb, struct sock *sk, * They want reverse charging, we won't accept it. */ if ((theirs.reverse & 0x01 ) && (ours->reverse & 0x01)) { - SOCK_DEBUG(sk, "X.25: rejecting reverse charging request\n"); + net_dbg_ratelimited("X.25: rejecting reverse charging request\n"); return -1; } @@ -294,11 +294,11 @@ int x25_negotiate_facilities(struct sk_buff *skb, struct sock *sk, int ours_in = ours->throughput & 0x0f; int ours_out = ours->throughput & 0xf0; if (!ours_in || theirs_in < ours_in) { - SOCK_DEBUG(sk, "X.25: inbound throughput negotiated\n"); + net_dbg_ratelimited("X.25: inbound throughput negotiated\n"); new->throughput = (new->throughput & 0xf0) | theirs_in; } if (!ours_out || theirs_out < ours_out) { - SOCK_DEBUG(sk, + net_dbg_ratelimited( "X.25: outbound throughput negotiated\n"); new->throughput = (new->throughput & 0x0f) | theirs_out; } @@ -306,22 +306,22 @@ int x25_negotiate_facilities(struct sk_buff *skb, struct sock *sk, if (theirs.pacsize_in && theirs.pacsize_out) { if (theirs.pacsize_in < ours->pacsize_in) { - SOCK_DEBUG(sk, "X.25: packet size inwards negotiated down\n"); + net_dbg_ratelimited("X.25: packet size inwards negotiated down\n"); new->pacsize_in = theirs.pacsize_in; } if (theirs.pacsize_out < ours->pacsize_out) { - SOCK_DEBUG(sk, "X.25: packet size outwards negotiated down\n"); + net_dbg_ratelimited("X.25: packet size outwards negotiated down\n"); new->pacsize_out = theirs.pacsize_out; } } if (theirs.winsize_in && theirs.winsize_out) { if (theirs.winsize_in < ours->winsize_in) { - SOCK_DEBUG(sk, "X.25: window size inwards negotiated down\n"); + net_dbg_ratelimited("X.25: window size inwards negotiated down\n"); new->winsize_in = theirs.winsize_in; } if (theirs.winsize_out < ours->winsize_out) { - SOCK_DEBUG(sk, "X.25: window size outwards negotiated down\n"); + net_dbg_ratelimited("X.25: window size outwards negotiated down\n"); new->winsize_out = theirs.winsize_out; } } diff --git a/net/x25/x25_out.c b/net/x25/x25_out.c index dbc0940bf35f..f8922b0e23a4 100644 --- a/net/x25/x25_out.c +++ b/net/x25/x25_out.c @@ -72,7 +72,7 @@ int x25_output(struct sock *sk, struct sk_buff *skb) kfree_skb(skb); return sent; } - SOCK_DEBUG(sk, "x25_output: fragment alloc" + net_dbg_ratelimited("x25_output: fragment alloc" " failed, err=%d, %d bytes " "sent\n", err, sent); return err; From patchwork Tue Dec 19 14:38:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Kirjanov X-Patchwork-Id: 13498391 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com [209.85.208.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B5E511BDF8 for ; Tue, 19 Dec 2023 14:38:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="efn7jtUH" Received: by mail-lj1-f180.google.com with SMTP id 38308e7fff4ca-2cc2adbcf87so13539501fa.0 for ; Tue, 19 Dec 2023 06:38:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702996721; x=1703601521; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BWSAM4JsfdqzIuyAx+IdTO0qt6TDFvdTGLZtS03HYUE=; b=efn7jtUHS0Dt+/jVBp865jNakcxKQMXkRCmBMkEqykfv8QlK/e6AdsOVN+H/xB3ZCj xfLyj9xhNgqYLUeS/bB0Ynfgo/VH7ruWOWvdUIGA9SV/Y4m14J2g2Sc3yPw0+tI4SYWP sS3PX+RyohF/SDVwVOLQivZyMNcq7S7ZpHmM6m0sMzzo/piuswTATme1ZMhcHkgT6bKM qjxB4WzR4KWNMokb7mIrhGZ2SszbhCkspYaFBEEetyEXOIQTy66MlKXSAaoPY6dtZ33r Dbe/o7SShky0cbV7IfWTdnFRk78cNxYyisRyTVa6zwWkiKU5D/YAcg9eL7ifSx1TrhIG g+mA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702996721; x=1703601521; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BWSAM4JsfdqzIuyAx+IdTO0qt6TDFvdTGLZtS03HYUE=; b=PBoPC4wogWNx541wpaZaXvZ1sPx0i9lsYfwO9xoA4Yne8QjT3gncTudtozxcz4HRp1 gR4cLyHaW+nR0PbNqTvg25Urw5OjMRL2o0llOdFTuKc7AgGL3h7hXKltE8HCX9P92ehS JDpcViXZkMS6LwexIe8aLggjNLtCGYPEGOPwUY+YkdF8i/HUM5vNDyf0FpGl2JDrNtbX AVDlAgGDExO1pxWGouZvG7vm7yd0DabR9hLCEIX77uiuT5zkM3iNOEqN5zlzXhW3SDe/ qNOBYoS3NKWXc6qa3iE+3ycuEm/4m5Ze/RPGC4OaVO+bhu1NCKDOBcJOiRtouLEWnh6p MHlA== X-Gm-Message-State: AOJu0YycQC//UsoW5z2oeU0SGFe/kZYJzeNeM8eTQgSjLBoiNNhqQZuc ATLhSdRGhTDSnH9qZb++lDtCzHaSnVbgf+u+ X-Google-Smtp-Source: AGHT+IFLhg+xtbV+M+nVmNE5s2OiGWHNhS7K/CarW1reqabeeFVHr542zmiSFHaWmp0Yx3S6kAYTiw== X-Received: by 2002:a2e:9914:0:b0:2cc:5f22:ba34 with SMTP id v20-20020a2e9914000000b002cc5f22ba34mr5433670lji.1.1702996720413; Tue, 19 Dec 2023 06:38:40 -0800 (PST) Received: from localhost.localdomain ([83.217.200.104]) by smtp.gmail.com with ESMTPSA id c6-20020a2e9d86000000b002cc68cce064sm1011014ljj.62.2023.12.19.06.38.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 06:38:39 -0800 (PST) From: Denis Kirjanov X-Google-Original-From: Denis Kirjanov To: netdev@vger.kernel.org Cc: pabeni@redhat.com, Denis Kirjanov Subject: [PATCH net-next v2 2/2] net: remove SOCK_DEBUG macro Date: Tue, 19 Dec 2023 17:38:20 +0300 Message-Id: <20231219143820.9379-2-dkirjanov@suse.de> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20231219143820.9379-1-dkirjanov@suse.de> References: <20231219143820.9379-1-dkirjanov@suse.de> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Since there are no more users of the macro let's finally burn it Signed-off-by: Denis Kirjanov --- include/net/sock.h | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/include/net/sock.h b/include/net/sock.h index 8b6fe164b218..7c0353fcdfaf 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -76,19 +76,6 @@ * the other protocols. */ -/* Define this to get the SOCK_DBG debugging facility. */ -#define SOCK_DEBUGGING -#ifdef SOCK_DEBUGGING -#define SOCK_DEBUG(sk, msg...) do { if ((sk) && sock_flag((sk), SOCK_DBG)) \ - printk(KERN_DEBUG msg); } while (0) -#else -/* Validate arguments and do nothing */ -static inline __printf(2, 3) -void SOCK_DEBUG(const struct sock *sk, const char *msg, ...) -{ -} -#endif - /* This is the per-socket lock. The spinlock provides a synchronization * between user contexts and software interrupt processing, whereas the * mini-semaphore synchronizes multiple users amongst themselves.