netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ipv6/addrconf: use netdev_info()/netdev_warn()/netdev_dbg() for logging
@ 2019-09-20 12:16 Konstantin Khlebnikov
  0 siblings, 0 replies; only message in thread
From: Konstantin Khlebnikov @ 2019-09-20 12:16 UTC (permalink / raw)
  To: netdev, David S. Miller

Print prefix "<driver> <pci_dev> <dev_name>: " or "<kind> <dev_name>: ".
Add "IPv6: " into format: netdev_info() does not use macro pr_fmt().

Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
---
 net/ipv6/addrconf.c      |   28 ++++++++++++----------------
 net/ipv6/addrconf_core.c |    2 +-
 2 files changed, 13 insertions(+), 17 deletions(-)

diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 6a576ff92c39..0d1568cf1e89 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -417,7 +417,7 @@ static struct inet6_dev *ipv6_add_dev(struct net_device *dev)
 
 #if IS_ENABLED(CONFIG_IPV6_SIT)
 	if (dev->type == ARPHRD_SIT && (dev->priv_flags & IFF_ISATAP)) {
-		pr_info("%s: Disabled Multicast RS\n", dev->name);
+		netdev_info(dev, "IPv6: Disabled Multicast RS\n");
 		ndev->cnf.rtr_solicits = 0;
 	}
 #endif
@@ -951,7 +951,7 @@ void inet6_ifa_finish_destroy(struct inet6_ifaddr *ifp)
 	WARN_ON(!hlist_unhashed(&ifp->addr_lst));
 
 #ifdef NET_REFCNT_DEBUG
-	pr_debug("%s\n", __func__);
+	netdev_dbg(ifp->idev->dev, "%s\n", __func__);
 #endif
 
 	in6_dev_put(ifp->idev);
@@ -1329,7 +1329,7 @@ static int ipv6_create_tempaddr(struct inet6_ifaddr *ifp,
 	in6_dev_hold(idev);
 	if (idev->cnf.use_tempaddr <= 0) {
 		write_unlock_bh(&idev->lock);
-		pr_info("%s: use_tempaddr is disabled\n", __func__);
+		netdev_info(idev->dev, "IPv6: use_tempaddr is disabled\n");
 		in6_dev_put(idev);
 		ret = -1;
 		goto out;
@@ -1339,8 +1339,7 @@ static int ipv6_create_tempaddr(struct inet6_ifaddr *ifp,
 		idev->cnf.use_tempaddr = -1;	/*XXX*/
 		spin_unlock_bh(&ifp->lock);
 		write_unlock_bh(&idev->lock);
-		pr_warn("%s: regeneration time exceeded - disabled temporary address support\n",
-			__func__);
+		netdev_warn(idev->dev, "IPv6: regeneration time exceeded - disabled temporary address support\n");
 		in6_dev_put(idev);
 		ret = -1;
 		goto out;
@@ -1412,7 +1411,7 @@ static int ipv6_create_tempaddr(struct inet6_ifaddr *ifp,
 	if (IS_ERR(ift)) {
 		in6_ifa_put(ifp);
 		in6_dev_put(idev);
-		pr_info("%s: retry temporary address regeneration\n", __func__);
+		netdev_info(idev->dev, "IPv6: retry temporary address regeneration\n");
 		tmpaddr = &addr;
 		write_lock_bh(&idev->lock);
 		goto retry;
@@ -3160,7 +3159,7 @@ static void init_loopback(struct net_device *dev)
 
 	idev = ipv6_find_idev(dev);
 	if (IS_ERR(idev)) {
-		pr_debug("%s: add_dev failed\n", __func__);
+		netdev_dbg(dev, "IPv6: %s: add_dev failed\n", __func__);
 		return;
 	}
 
@@ -3375,7 +3374,7 @@ static void addrconf_sit_config(struct net_device *dev)
 
 	idev = ipv6_find_idev(dev);
 	if (IS_ERR(idev)) {
-		pr_debug("%s: add_dev failed\n", __func__);
+		netdev_dbg(dev, "IPv6: %s: add_dev failed\n", __func__);
 		return;
 	}
 
@@ -3400,7 +3399,7 @@ static void addrconf_gre_config(struct net_device *dev)
 
 	idev = ipv6_find_idev(dev);
 	if (IS_ERR(idev)) {
-		pr_debug("%s: add_dev failed\n", __func__);
+		netdev_dbg(dev, "IPv6: %s: add_dev failed\n", __func__);
 		return;
 	}
 
@@ -3534,8 +3533,7 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event,
 
 			if (!addrconf_link_ready(dev)) {
 				/* device is not ready yet. */
-				pr_debug("ADDRCONF(NETDEV_UP): %s: link is not ready\n",
-					 dev->name);
+				netdev_dbg(dev, "IPv6: ADDRCONF(NETDEV_UP): link is not ready\n");
 				break;
 			}
 
@@ -3570,8 +3568,7 @@ static int addrconf_notify(struct notifier_block *this, unsigned long event,
 				idev->if_flags |= IF_READY;
 			}
 
-			pr_info("ADDRCONF(NETDEV_CHANGE): %s: link becomes ready\n",
-				dev->name);
+			netdev_info(dev, "IPv6: ADDRCONF(NETDEV_CHANGE): link becomes ready\n");
 
 			run_pending = 1;
 		}
@@ -3894,7 +3891,7 @@ static void addrconf_rs_timer(struct timer_list *t)
 		 * Note: we do not support deprecated "all on-link"
 		 * assumption any longer.
 		 */
-		pr_debug("%s: no IPv6 routers present\n", idev->dev->name);
+		netdev_dbg(dev, "no IPv6 routers present\n");
 	}
 
 out:
@@ -4054,8 +4051,7 @@ static void addrconf_dad_work(struct work_struct *w)
 				/* DAD failed for link-local based on MAC */
 				idev->cnf.disable_ipv6 = 1;
 
-				pr_info("%s: IPv6 being disabled!\n",
-					ifp->idev->dev->name);
+				netdev_info(idev->dev, "IPv6 being disabled!\n");
 				disable_ipv6 = true;
 			}
 		}
diff --git a/net/ipv6/addrconf_core.c b/net/ipv6/addrconf_core.c
index 783f3c1466da..d2b589fb6889 100644
--- a/net/ipv6/addrconf_core.c
+++ b/net/ipv6/addrconf_core.c
@@ -243,7 +243,7 @@ void in6_dev_finish_destroy(struct inet6_dev *idev)
 	WARN_ON(timer_pending(&idev->rs_timer));
 
 #ifdef NET_REFCNT_DEBUG
-	pr_debug("%s: %s\n", __func__, dev ? dev->name : "NIL");
+	netdev_dbg(dev, "%s\n", __func__);
 #endif
 	dev_put(dev);
 	if (!idev->dead) {


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-09-20 12:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-20 12:16 [PATCH] ipv6/addrconf: use netdev_info()/netdev_warn()/netdev_dbg() for logging Konstantin Khlebnikov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).