public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: ebiederm@xmission•com (Eric W. Biederman)
To: Cong Wang <amwang@redhat•com>
Cc: netdev@vger•kernel.org, "David S. Miller" <davem@davemloft•net>
Subject: Re: [Patch net-next v2] pktgen: support net namespace
Date: Mon, 28 Jan 2013 18:36:02 -0800	[thread overview]
Message-ID: <874ni0k965.fsf@xmission.com> (raw)
In-Reply-To: <1359424389-21919-1-git-send-email-amwang@redhat.com> (Cong Wang's message of "Tue, 29 Jan 2013 09:53:09 +0800")

Cong Wang <amwang@redhat•com> writes:

> From: Cong Wang <amwang@redhat•com>
>
> v2: remove a useless check
>
> This patch add net namespace to pktgen, so that
> we can use pktgen in different namespaces.
>
> Cc: Eric W. Biederman <ebiederm@xmission•com>
> Cc: David S. Miller <davem@davemloft•net>
> Signed-off-by: Cong Wang <amwang@redhat•com>
>
> ---
>  net/core/pktgen.c |  123 +++++++++++++++++++++++++++++++++++------------------
>  1 files changed, 81 insertions(+), 42 deletions(-)

Skiming through this again I have spotted what looks like a pretty
major bug.  You are limiting yourself to one network device per network
namespace when the actual limit is one network device per thread.

I think you can just kill the dev member of pktgen_net and the two or
three lines of code that touch it.

> +static int pg_net_id __read_mostly;
> +
> +struct pktgen_net {
> +	struct net		*net;
> +	struct net_device	*dev;
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> +	struct proc_dir_entry	*proc_dir;
>  };

Eric

  reply	other threads:[~2013-01-29  2:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-29  1:53 [Patch net-next v2] pktgen: support net namespace Cong Wang
2013-01-29  2:36 ` Eric W. Biederman [this message]
2013-01-29  3:02   ` Cong Wang
2013-01-29  3:33     ` Eric W. Biederman
2013-01-29  3:54       ` Cong Wang
2013-01-29  4:17         ` Eric W. Biederman

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=874ni0k965.fsf@xmission.com \
    --to=ebiederm@xmission$(echo .)com \
    --cc=amwang@redhat$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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