OSDN Git Service

net-core: use netdev_* calls for kernel messages
authorJesse Brandeburg <jesse.brandeburg@intel.com>
Tue, 19 Oct 2021 16:42:28 +0000 (09:42 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 20 Oct 2021 13:30:34 +0000 (14:30 +0100)
commit5b92be649605504e1019a1ad0c95b0d74a4e2be1
tree55857b775615133ce73c65ba2137eb57ee2de3d9
parent0f00e70ef645e43527a1b622721ae084149c21ca
net-core: use netdev_* calls for kernel messages

While loading a driver and changing the number of queues, I noticed this
message in the kernel log:

"[253489.070080] Number of in use tx queues changed invalidating tc
mappings. Priority traffic classification disabled!"

But I had no idea what interface was being talked about because this
message used pr_warn().

After investigating, it appears we can use the netdev_* helpers already
defined to create predictably formatted messages, and that already handle
<unknown netdev> cases, in more of the messages in dev.c.

After this change, this message (and others) will look like this:
"[  170.181093] ice 0000:3b:00.0 ens785f0: Number of in use tx queues
changed invalidating tc mappings. Priority traffic classification
disabled!"

One goal here was not to change the message significantly from the
original format so as to not break user's expectations, so I just
changed messages that used pr_* and generally started with %s ==
dev->name.

Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/dev.c