netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Garzik <jeff@garzik.org>
To: Josh Triplett <josh@freedesktop.org>
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] Allow pktgen to work with loopback devices.
Date: Fri, 09 Mar 2007 11:49:10 -0500	[thread overview]
Message-ID: <45F19006.9060607@garzik.org> (raw)
In-Reply-To: <45EEB011.5020606@freedesktop.org>

Josh Triplett wrote:
> pktgen currently only works on network devices with type ARPHRD_ETHER.  Add
> support for the loopback device, type ARPHRD_LOOPBACK.
> 
> I've tested this on my system, using a modified pktgen.conf-1-1 with
> s/eth1/lo/g, and it works fine; the network device statistics confirm packet
> transmission and receipt.
> 
> Thanks to Sarah Bailey for discovering and tracking down the problem.
> 
> Signed-off-by: Josh Triplett <josh@freedesktop.org>
> ---
> 
> I intentionally didn't change the error message "not an ethernet device".  For
> the purposes of pktgen, loopback devices act like ethernet devices.
> 
>  net/core/pktgen.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/net/core/pktgen.c b/net/core/pktgen.c
> index 74a9a32..6fc6f9d 100644
> --- a/net/core/pktgen.c
> +++ b/net/core/pktgen.c
> @@ -1930,7 +1930,7 @@ static struct net_device *pktgen_setup_dev(struct pktgen_dev *pkt_dev)
>  		printk("pktgen: no such netdevice: \"%s\"\n", pkt_dev->ifname);
>  		goto out;
>  	}
> -	if (odev->type != ARPHRD_ETHER) {
> +	if (odev->type != ARPHRD_LOOPBACK && odev->type != ARPHRD_ETHER) {
>  		printk("pktgen: not an ethernet device: \"%s\"\n",
>  		       pkt_dev->ifname);

I'll let DaveM queue this (or not)

      reply	other threads:[~2007-03-09 16:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-07 12:29 [PATCH] Allow pktgen to work with loopback devices Josh Triplett
2007-03-09 16:49 ` Jeff Garzik [this message]

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=45F19006.9060607@garzik.org \
    --to=jeff@garzik.org \
    --cc=akpm@linux-foundation.org \
    --cc=josh@freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.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).