netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin LaHaise <bcrl@kvack.org>
To: Thomas Martitz <thomas.martitz@hhi.fraunhofer.de>
Cc: richard -rw- weinberger <richard.weinberger@gmail.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"edumazet@google.com" <edumazet@google.com>,
	"herbert@gondor.apana.org.au" <herbert@gondor.apana.org.au>
Subject: Re: Trying to implement secondary loopback
Date: Fri, 15 Mar 2013 11:37:40 -0400	[thread overview]
Message-ID: <20130315153740.GR8869@kvack.org> (raw)
In-Reply-To: <51433934.3080405@hhi.fraunhofer.de>

On Fri, Mar 15, 2013 at 04:07:32PM +0100, Thomas Martitz wrote:
> Same result. I assumed the kernel treats lo in a special way for 
> localhost-connections and that it would be impossible to achieve the 
> same with a custom interface.
> 
> I did the following:
> 
> ifconfig lo down
> insmod ./mykmod.ko
> ifconfig eth2 up
> ifconfig eth2 127.0.0.1
> 
> At this point ifconfig prints the same information for eth2 that it had 
> printed for lo before (except for the LOOPBACK flag, but I can enable 
> that one as well by adding IFF_LOOPBACK to the interface flags in the 
> module). Yet my test application only works with lo, not eth2.

Don't use loopback ip addresses; it makes no sense to do so.  I've worked  
on a couple opf nic implementations on FPGAs for a while now (a gige 
implementation that works, and now a 10G nic), and it's easy enough to 
develop it as a regular ethernet driver.  You can write test programs that 
use raw sockets to send/receive packets over the ethernet device, or use 
pktgen to send packets.  You don't even need to configure an ip address for 
testing with raw packets.  Testing with IP is a lot harder during early 
bring-up of your hardware as it requires everything to work (that is, you 
need ARP to work successfully before IP can work).  Just stick to simple 
packet injection initially, and don't confuse yourself by thinking about 
the loopback device.

		-ben
-- 
"Thought is the essence of where you are now."

  parent reply	other threads:[~2013-03-15 16:02 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-12 12:05 Trying to implement secondary loopback Thomas Martitz
2013-03-13 11:13 ` richard -rw- weinberger
2013-03-13 20:38   ` Martitz, Thomas
2013-03-13 20:46     ` Eric W. Biederman
2013-03-13 21:07       ` AW: " Martitz, Thomas
2013-03-13 21:21         ` Eric W. Biederman
2013-03-13 22:01           ` AW: " Martitz, Thomas
2013-03-15  7:30           ` Thomas Martitz
2013-03-15  8:59             ` Eric W. Biederman
2013-03-15 13:49               ` Thomas Martitz
2013-03-15 13:56                 ` richard -rw- weinberger
2013-03-15 14:08                   ` Thomas Martitz
2013-03-15 14:16                     ` richard -rw- weinberger
2013-03-15 14:20                       ` Thomas Martitz
2013-03-15 14:32                         ` richard -rw- weinberger
2013-03-15 14:35                           ` Thomas Martitz
2013-03-15 14:45                             ` richard -rw- weinberger
2013-03-15 14:50                               ` Thomas Martitz
2013-03-15 15:07                                 ` Thomas Martitz
2013-03-15 15:15                                   ` Hannes Frederic Sowa
2013-03-15 15:37                                   ` Benjamin LaHaise [this message]
2013-03-15 19:48                                     ` Martitz, Thomas
2013-03-18  9:33                                       ` Thomas Martitz
2013-03-15 18:36             ` Ben Hutchings
  -- strict thread matches above, loose matches on Subject: below --
2013-03-11  9:49 Thomas Martitz
2013-03-11  9:25 Thomas Martitz

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=20130315153740.GR8869@kvack.org \
    --to=bcrl@kvack.org \
    --cc=davem@davemloft.net \
    --cc=ebiederm@xmission.com \
    --cc=edumazet@google.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=netdev@vger.kernel.org \
    --cc=richard.weinberger@gmail.com \
    --cc=thomas.martitz@hhi.fraunhofer.de \
    /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).