netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Cliff White <cliffw@osdl.org>
To: Robert Olsson <Robert.Olsson@data.slu.se>
Cc: Stephen Hemminger <shemminger@osdl.org>, netdev@oss.sgi.com
Subject: Re: pktgen: causing lots of errors in console log
Date: Fri, 11 Mar 2005 10:13:09 -0800	[thread overview]
Message-ID: <E1D9odJ-0002FK-CJ@es175> (raw)
In-Reply-To: <16945.41992.799695.358632@robur.slu.se>

> 
> cliff white writes:
> 
>  > Okay,  I can reproduce it on two machines, no problem.
> 
>  I too with CONFIG_PREEMPT=y. Thanks.
> 
>  Please try:
> 
> 
> --- net/core/pktgen.c.050310	2005-03-10 22:12:43.000000000 +0100
> +++ net/core/pktgen.c	2005-03-11 10:48:43.000000000 +0100
> @@ -151,7 +151,7 @@
>  #include <asm/timex.h>
>  
>  
> -#define VERSION  "pktgen v2.59: Packet Generator for packet performance test
> ing.\n"
> +#define VERSION  "pktgen v2.60: Packet Generator for packet performance test
> ing.\n"
>  
>  /* #define PG_DEBUG(a) a */
>  #define PG_DEBUG(a) 
> @@ -1419,7 +1419,6 @@
>  	if (debug) 
>  		printk("pktgen: t=%s, count=%lu\n", name, count);
>          
> -	thread_lock();
>  
>          t = (struct pktgen_thread*)(data);
>  	if(!t) {
> @@ -1441,14 +1440,18 @@
>  		if( copy_from_user(f, &user_buffer[i], len) )
>  			return -EFAULT;
>  		i += len;
> +		thread_lock();
>                  pktgen_add_device(t, f);
> +		thread_unlock();
>                  ret = count;
>                  sprintf(pg_result, "OK: add_device=%s", f);
>  		goto out;
>  	}
>  
>          if (!strcmp(name, "rem_device_all")) {
> +		thread_lock();
>  		t->control |= T_REMDEV;
> +		thread_unlock();
>  		current->state = TASK_INTERRUPTIBLE;
>  		schedule_timeout(HZ/8);  /* Propagate thread->control  */
>  		ret = count;
> @@ -1456,10 +1459,11 @@
>  		goto out;
>  	}
>  
> -
>          if (!strcmp(name, "max_before_softirq")) {
>                  len = num_arg(&user_buffer[i], 10, &value);
> +		thread_lock();
>                  t->max_before_softirq = value;
> +		thread_unlock();
>                  ret = count;
>                  sprintf(pg_result, "OK: max_before_softirq=%lu", value);
>  		goto out;
> @@ -1467,7 +1471,6 @@
>  
>  	ret = -EINVAL;
>   out:
> -	thread_unlock();
>  
>  	return ret;
>  }
> 
> 

This stops the errors, thanks. 
cliffw

> 
> 						--ro
> 

  reply	other threads:[~2005-03-11 18:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-08 22:08 pktgen: causing lots of errors in console log Stephen Hemminger
2005-03-09 11:10 ` Robert Olsson
2005-03-09 19:11   ` Stephen Hemminger
2005-03-10 18:48   ` cliff white
2005-03-11 13:58     ` Robert Olsson
2005-03-11 18:13       ` Cliff White [this message]
2005-03-15  5:44       ` David S. Miller
2005-03-11  2:58   ` David S. Miller

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=E1D9odJ-0002FK-CJ@es175 \
    --to=cliffw@osdl.org \
    --cc=Robert.Olsson@data.slu.se \
    --cc=netdev@oss.sgi.com \
    --cc=shemminger@osdl.org \
    /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).