netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: Fix incorrect comment in netif_tx_stop_queue()
@ 2012-08-13 14:43 Ilya Shchepetkov
  2012-08-14 21:46 ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Ilya Shchepetkov @ 2012-08-13 14:43 UTC (permalink / raw)
  To: David S. Miller; +Cc: Ilya Shchepetkov, netdev, linux-kernel, ldv-project

netif_stop_queue() can be called before register_netdev() because now
TX queues are allocated inside alloc_netdev_mqs().

(since ed9af2e839c06c18f721da2c768fbb444c4a10e5 commit)

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Ilya Shchepetkov <shchepetkov@ispras.ru>
---
 include/linux/netdevice.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index a9db4f3..a94fbbd 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1860,7 +1860,7 @@ static inline void netif_tx_wake_all_queues(struct net_device *dev)
 static inline void netif_tx_stop_queue(struct netdev_queue *dev_queue)
 {
 	if (WARN_ON(!dev_queue)) {
-		pr_info("netif_stop_queue() cannot be called before register_netdev()\n");
+		pr_info("dev_queue is null\n");
 		return;
 	}
 	set_bit(__QUEUE_STATE_DRV_XOFF, &dev_queue->state);
-- 
1.7.7

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

* Re: [PATCH] net: Fix incorrect comment in netif_tx_stop_queue()
  2012-08-13 14:43 [PATCH] net: Fix incorrect comment in netif_tx_stop_queue() Ilya Shchepetkov
@ 2012-08-14 21:46 ` David Miller
  2012-08-17  8:01   ` Ilya Shchepetkov
  0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2012-08-14 21:46 UTC (permalink / raw)
  To: shchepetkov; +Cc: netdev, linux-kernel, ldv-project


From: Ilya Shchepetkov <shchepetkov@ispras.ru>
Date: Mon, 13 Aug 2012 18:43:34 +0400

> netif_stop_queue() can be called before register_netdev() because now
> TX queues are allocated inside alloc_netdev_mqs().
> 
> (since ed9af2e839c06c18f721da2c768fbb444c4a10e5 commit)
> 
> Found by Linux Driver Verification project (linuxtesting.org).
> 
> Signed-off-by: Ilya Shchepetkov <shchepetkov@ispras.ru>

You're not changing a "comment", you're changing a kernel log message.

Have you actually triggered this condition?

I doubt it, and I'm not applying this patch.

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

* Re: [PATCH] net: Fix incorrect comment in netif_tx_stop_queue()
  2012-08-14 21:46 ` David Miller
@ 2012-08-17  8:01   ` Ilya Shchepetkov
  0 siblings, 0 replies; 3+ messages in thread
From: Ilya Shchepetkov @ 2012-08-17  8:01 UTC (permalink / raw)
  To: David S. Miller; +Cc: Ilya Shchepetkov, netdev, linux-kernel, ldv-project

> > netif_stop_queue() can be called before register_netdev() because now
> > TX queues are allocated inside alloc_netdev_mqs().
> > 
> > (since ed9af2e839c06c18f721da2c768fbb444c4a10e5 commit)
> > 
> > Found by Linux Driver Verification project (linuxtesting.org).
> > 
> > Signed-off-by: Ilya Shchepetkov <shchepetkov@ispras.ru>
> 
> You're not changing a "comment", you're changing a kernel log message.
> 
> Have you actually triggered this condition?
> 
> I doubt it, and I'm not applying this patch.

My test driver calls netif_carrier_off before register_netdev and works
well,
without "netif_stop_queue() cannot be called before register_netdev()"
message.

Also, there are drivers that call netif_tx_stop_queue directly
and possible error message (with a reference to netif_stop_queue) will
be wrong.

Look at these commits:
e6484930d7c73d324bccda7d43d131088da697b9
18543a643fae694982c7d89c22436885f3506497
ed9af2e839c06c18f721da2c768fbb444c4a10e5

After the third commit, the second one became unnecessary.

Thus, I suggest either to remove the misleading message, or to replace
it with this:

pr_info("netif_tx_stop_queue(): dev_queue is null()\n");

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

end of thread, other threads:[~2012-08-17  8:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-13 14:43 [PATCH] net: Fix incorrect comment in netif_tx_stop_queue() Ilya Shchepetkov
2012-08-14 21:46 ` David Miller
2012-08-17  8:01   ` Ilya Shchepetkov

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).