All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] Trivial print improvements in ndo_dflt_fdb_{add,del}
@ 2021-06-29  0:29 Vladimir Oltean
  2021-06-29  0:29 ` [PATCH net-next 1/2] net: use netdev_info " Vladimir Oltean
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Vladimir Oltean @ 2021-06-29  0:29 UTC (permalink / raw)
  To: netdev, Jakub Kicinski, David S. Miller; +Cc: Vladimir Oltean

From: Vladimir Oltean <vladimir.oltean@nxp.com>

These are some changes brought to the informational messages printed in
the default .ndo_fdb_add and .ndo_fdb_del method implementations.

Vladimir Oltean (2):
  net: use netdev_info in ndo_dflt_fdb_{add,del}
  net: say "local" instead of "static" addresses in
    ndo_dflt_fdb_{add,del}

 net/core/rtnetlink.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH net-next 1/2] net: use netdev_info in ndo_dflt_fdb_{add,del}
  2021-06-29  0:29 [PATCH net-next 0/2] Trivial print improvements in ndo_dflt_fdb_{add,del} Vladimir Oltean
@ 2021-06-29  0:29 ` Vladimir Oltean
  2021-06-29  0:29 ` [PATCH net-next 2/2] net: say "local" instead of "static" addresses " Vladimir Oltean
  2021-06-29 18:40 ` [PATCH net-next 0/2] Trivial print improvements " patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Vladimir Oltean @ 2021-06-29  0:29 UTC (permalink / raw)
  To: netdev, Jakub Kicinski, David S. Miller; +Cc: Vladimir Oltean

From: Vladimir Oltean <vladimir.oltean@nxp.com>

Use the more modern printk helper for network interfaces, which also
contains information about the associated struct device, and results in
overall shorter line lengths compared to printing an open-coded
dev->name.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
 net/core/rtnetlink.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 745965e49f78..ab11c9d5002b 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -3947,12 +3947,12 @@ int ndo_dflt_fdb_add(struct ndmsg *ndm,
 	 * implement its own handler for this.
 	 */
 	if (ndm->ndm_state && !(ndm->ndm_state & NUD_PERMANENT)) {
-		pr_info("%s: FDB only supports static addresses\n", dev->name);
+		netdev_info(dev, "FDB only supports static addresses\n");
 		return err;
 	}
 
 	if (vid) {
-		pr_info("%s: vlans aren't supported yet for dev_uc|mc_add()\n", dev->name);
+		netdev_info(dev, "vlans aren't supported yet for dev_uc|mc_add()\n");
 		return err;
 	}
 
@@ -4086,7 +4086,7 @@ int ndo_dflt_fdb_del(struct ndmsg *ndm,
 	 * implement its own handler for this.
 	 */
 	if (!(ndm->ndm_state & NUD_PERMANENT)) {
-		pr_info("%s: FDB only supports static addresses\n", dev->name);
+		netdev_info(dev, "FDB only supports static addresses\n");
 		return err;
 	}
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH net-next 2/2] net: say "local" instead of "static" addresses in ndo_dflt_fdb_{add,del}
  2021-06-29  0:29 [PATCH net-next 0/2] Trivial print improvements in ndo_dflt_fdb_{add,del} Vladimir Oltean
  2021-06-29  0:29 ` [PATCH net-next 1/2] net: use netdev_info " Vladimir Oltean
@ 2021-06-29  0:29 ` Vladimir Oltean
  2021-06-29 18:40 ` [PATCH net-next 0/2] Trivial print improvements " patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Vladimir Oltean @ 2021-06-29  0:29 UTC (permalink / raw)
  To: netdev, Jakub Kicinski, David S. Miller; +Cc: Vladimir Oltean

From: Vladimir Oltean <vladimir.oltean@nxp.com>

"Static" is a loaded word, and probably not what the author meant when
the code was written.

In particular, this looks weird:
$ bridge fdb add dev swp0 00:01:02:03:04:05 local        # totally fine, but
$ bridge fdb add dev swp0 00:01:02:03:04:05 static
[ 2020.708298] swp0: FDB only supports static addresses  # hmm what?

By looking at the implementation which uses dev_uc_add/dev_uc_del it is
absolutely clear that only local addresses are supported, and the proper
Network Unreachability Detection state is being used for this purpose
(user space indeed sets NUD_PERMANENT when local addresses are meant).
So it is just the message that is wrong, fix it.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
 net/core/rtnetlink.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index ab11c9d5002b..f6af3e74fc44 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -3947,7 +3947,7 @@ int ndo_dflt_fdb_add(struct ndmsg *ndm,
 	 * implement its own handler for this.
 	 */
 	if (ndm->ndm_state && !(ndm->ndm_state & NUD_PERMANENT)) {
-		netdev_info(dev, "FDB only supports static addresses\n");
+		netdev_info(dev, "default FDB implementation only supports local addresses\n");
 		return err;
 	}
 
@@ -4086,7 +4086,7 @@ int ndo_dflt_fdb_del(struct ndmsg *ndm,
 	 * implement its own handler for this.
 	 */
 	if (!(ndm->ndm_state & NUD_PERMANENT)) {
-		netdev_info(dev, "FDB only supports static addresses\n");
+		netdev_info(dev, "default FDB implementation only supports local addresses\n");
 		return err;
 	}
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next 0/2] Trivial print improvements in ndo_dflt_fdb_{add,del}
  2021-06-29  0:29 [PATCH net-next 0/2] Trivial print improvements in ndo_dflt_fdb_{add,del} Vladimir Oltean
  2021-06-29  0:29 ` [PATCH net-next 1/2] net: use netdev_info " Vladimir Oltean
  2021-06-29  0:29 ` [PATCH net-next 2/2] net: say "local" instead of "static" addresses " Vladimir Oltean
@ 2021-06-29 18:40 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-06-29 18:40 UTC (permalink / raw)
  To: Vladimir Oltean; +Cc: netdev, kuba, davem, vladimir.oltean

Hello:

This series was applied to netdev/net-next.git (refs/heads/master):

On Tue, 29 Jun 2021 03:29:24 +0300 you wrote:
> From: Vladimir Oltean <vladimir.oltean@nxp.com>
> 
> These are some changes brought to the informational messages printed in
> the default .ndo_fdb_add and .ndo_fdb_del method implementations.
> 
> Vladimir Oltean (2):
>   net: use netdev_info in ndo_dflt_fdb_{add,del}
>   net: say "local" instead of "static" addresses in
>     ndo_dflt_fdb_{add,del}
> 
> [...]

Here is the summary with links:
  - [net-next,1/2] net: use netdev_info in ndo_dflt_fdb_{add,del}
    https://git.kernel.org/netdev/net-next/c/23ac0b421674
  - [net-next,2/2] net: say "local" instead of "static" addresses in ndo_dflt_fdb_{add,del}
    https://git.kernel.org/netdev/net-next/c/78ecc8903de2

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-06-29 18:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-29  0:29 [PATCH net-next 0/2] Trivial print improvements in ndo_dflt_fdb_{add,del} Vladimir Oltean
2021-06-29  0:29 ` [PATCH net-next 1/2] net: use netdev_info " Vladimir Oltean
2021-06-29  0:29 ` [PATCH net-next 2/2] net: say "local" instead of "static" addresses " Vladimir Oltean
2021-06-29 18:40 ` [PATCH net-next 0/2] Trivial print improvements " patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.