netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Robert Olsson <Robert.Olsson@data.slu.se>
To: "Alexey Dobriyan" <adobriyan@gmail.com>
Cc: "David Miller" <davem@davemloft.net>,
	pavol.gono@gmail.com, netdev@vger.kernel.org
Subject: Re: pktgen
Date: Thu, 30 Nov 2006 09:45:46 +0100	[thread overview]
Message-ID: <17774.39482.949953.625608@robur.slu.se> (raw)
In-Reply-To: <b6fcc0a0611292330n42fb1485h59804cc94a332f19@mail.gmail.com>



Hello!

Seems you found a race when rmmod is done before it's fully started

Try:

diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 733d86d..ac0b4b1 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -160,7 +160,7 @@
 #include <asm/div64.h>		/* do_div */
 #include <asm/timex.h>
 
-#define VERSION  "pktgen v2.68: Packet Generator for packet performance testing.\n"
+#define VERSION  "pktgen v2.69: Packet Generator for packet performance testing.\n"
 
 /* #define PG_DEBUG(a) a */
 #define PG_DEBUG(a)
@@ -3673,6 +3673,8 @@ static void __exit pg_cleanup(void)
 	struct list_head *q, *n;
 	wait_queue_head_t queue;
 	init_waitqueue_head(&queue);
+	
+	schedule_timeout_interruptible(msecs_to_jiffies(125));
 
 	/* Stop all interfaces & threads */
 


for i in 1 2 3 4 5 ; do modprobe pktgen ; rmmod pktgen ; done

In dmesg
pktgen v2.69: Packet Generator for packet performance testing.
pktgen v2.69: Packet Generator for packet performance testing.
pktgen v2.69: Packet Generator for packet performance testing.
pktgen v2.69: Packet Generator for packet performance testing.
pktgen v2.69: Packet Generator for packet performance testing.

Cheers.
					--ro



Alexey Dobriyan writes:
 > On 11/30/06, David Miller <davem@davemloft.net> wrote:
 > > From: Alexey Dobriyan <adobriyan@gmail.com>
 > > Date: Wed, 29 Nov 2006 23:04:37 +0300
 > >
 > > > Looks like worker thread strategically clears it if scheduled at wrong
 > > > moment.
 > > >
 > > > --- a/net/core/pktgen.c
 > > > +++ b/net/core/pktgen.c
 > > > @@ -3292,7 +3292,6 @@ static void pktgen_thread_worker(struct
 > > >
 > > >  	init_waitqueue_head(&t->queue);
 > > >
 > > > -	t->control &= ~(T_TERMINATE);
 > > >  	t->control &= ~(T_RUN);
 > > >  	t->control &= ~(T_STOP);
 > > >  	t->control &= ~(T_REMDEVALL);
 > >
 > > Good catch Alexey.  Did you rerun the load/unload test with
 > > this fix applied?  If it fixes things, I'll merge it.
 > 
 > Well, yes, it fixes things, except Ctrl+C getting you out of
 > modprobe/rmmod loop will spit
 > backtrace again. And other flags: T_RUN, T_STOP. Clearance is not
 > needed due to kZalloc and
 > create bugs as demostrated.
 > 
 > Give me some time.
 > -
 > To unsubscribe from this list: send the line "unsubscribe netdev" in
 > the body of a message to majordomo@vger.kernel.org
 > More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2006-11-30  8:45 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20061121174737.GA5220@martell.zuzino.mipt.ru>
     [not found] ` <9fa31860611211236i104cb510mb5100ea056b657db@mail.gmail.com>
2006-11-21 21:22   ` pktgen (was Re: tests of kernel modules) Alexey Dobriyan
2006-11-28 23:33     ` pktgen David Miller
2006-11-29 20:04       ` pktgen Alexey Dobriyan
2006-11-30  1:49         ` pktgen David Miller
2006-11-30  7:30           ` pktgen Alexey Dobriyan
2006-11-30  8:45             ` Robert Olsson [this message]
2006-11-30 17:33               ` pktgen Ben Greear
2006-12-01  4:14                 ` pktgen David Miller
2006-12-01  8:14                   ` pktgen Robert Olsson
2006-12-01  9:51                     ` pktgen Alexey Dobriyan
2006-12-01 17:18                       ` pktgen Robert Olsson
2006-12-01 23:25                       ` pktgen David Miller
2007-01-02  4:53                     ` pktgen David Miller
2006-12-01  8:22                   ` pktgen Christoph Hellwig
2006-12-01 23:17                     ` pktgen David Miller
     [not found] <20041110165318.GA19639@xi.wantstofly.org>
     [not found] ` <20041111233507.GA3202@xi.wantstofly.org>
     [not found]   ` <20041124161848.GA18059@xi.wantstofly.org>
     [not found]     ` <16804.48120.375307.718766@robur.slu.se>
     [not found]       ` <20041124170948.GC18059@xi.wantstofly.org>
     [not found]         ` <16804.60621.990421.525393@robur.slu.se>
     [not found]           ` <20041125030450.GA24417@xi.wantstofly.org>
     [not found]             ` <16805.40983.937641.670275@robur.slu.se>
     [not found]               ` <20041127002841.GA17184@xi.wantstofly.org>
     [not found]                 ` <20041127004325.GA17401@xi.wantstofly.org>
2004-11-27 12:04                   ` pktgen Robert Olsson
2004-11-27 13:53                     ` pktgen Lennert Buytenhek
2004-11-27 14:39                       ` pktgen Lennert Buytenhek
2004-11-27 15:04                         ` pktgen jamal
2004-11-28 18:31                           ` pktgen Lennert Buytenhek
2004-11-29 13:49                             ` pktgen jamal
2004-11-29 16:57                               ` pktgen Grant Grundler
2004-11-29 15:27                       ` pktgen Robert Olsson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=17774.39482.949953.625608@robur.slu.se \
    --to=robert.olsson@data.slu.se \
    --cc=adobriyan@gmail.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=pavol.gono@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).