All of lore.kernel.org
 help / color / mirror / Atom feed
From: jozsef imrek <imrek@atomki.hu>
To: linuxppc-embedded@ozlabs.org
Subject: RE: Speed of plb_temac 3.00 on ML403
Date: Wed, 14 Feb 2007 08:24:52 +0100 (CET)	[thread overview]
Message-ID: <Pine.LNX.4.61.0702140546360.32655@imrek.org> (raw)
In-Reply-To: <BAY110-F266A0C4987983C9B579C76B2910@phx.gbl>

On Mon, 12 Feb 2007, Ming Liu wrote:

> You said in your application the data path can bypass the IP stack, the CPU, 
> and with some work even the main memory. How can you achieve that? Then who 
> will process the UDP packets? If you add the work of processing packets in,

a precondition for this to work is to have all your data processing
implemented in hardware, since the CPU will not see the payload of
the udp packets, so it will have no chance to modify it.

the trick is (as i mentioned in my first reply) is to use an IPIF with
address range support (so it looks like a memory), and have the s/g dma
engine of the plb_temac read the udp payload from this "memory" instead
of your system ram.

the packet header (ethernet + ip + udp) in our application is assembled
by a code based on pktgen. you could implement it in hw as well, but there
is no need for that since you can utilize the full gigabit bandwith (this
you have seen.. :), and it is more convinient to have that functionality
in sw.


a quick hack to see this theory working:

1, create a new peripherial with address range support.
 	(start xps -> hardware -> create or import new peripherial,
 	plb bus, no sw reset/mir, no interrupt, no user regs, with
 	burst support, no fifo, with user address range, no dma,
 	no master iface)

 	you might want to replace the bram in the sample code
 	(pcores/*/hdl/vhdl/user_logic.vhd) with a fixed value
 	or a counter.

2, add this core to your design, create and download your new bitfile.

3, modify the source of the plb_temac linux driver. when a packet
 	is sent with fragments a buffer descriptor (bd) will be set
 	up for each fragment. the first bd will be used for the
 	packet header, and the rest of the bd's will point to the
 	the udp payload. so you want to make sure, that the physical
  	address of all but the first bd's is pointing to the physical
  	address of your IPIF's address range (you can find it in your
 	mhs file, search for C_AR_BASEADDR).

 	in adapter.c in xenet_SgSend_internal() search for the loop
 	where a bd is set up for each payload fragment (something like
 	for (i = 1; i < total_frags; i++, frag++)..), and set the
 	phy_addr to the address of your core (ie. phy_addr = 0x70090000;).

 	compile your new kernel, download it.

4, start pktgen with frags = 1 (use pgset "frags 1"). check the
 	payload of the packets sent on the wire (ie. with tcpdump).

 	if you have replaced the bram in step 1 with a fixed value
 	you should see that value. if you have replaced it with a
 	counter you should see the values rolling. if you did not
 	replace the bram, you should see the contents of the bram - it
 	is filled with all zeroes on reset, but you can fill it with
 	any test pattern.



good luck, and let me know how it works!


-- 
mazsi

----------------------------------------------------------------
strawberry fields forever!                       imrek@atomki.hu
----------------------------------------------------------------

  reply	other threads:[~2007-02-14  7:17 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-05 19:08 Speed of plb_temac 3.00 on ML403 Rick Moleres
2006-12-12 11:08 ` Ming Liu
2007-02-09 14:16 ` Ming Liu
2007-02-09 14:57   ` jozsef imrek
2007-02-11 15:25     ` Ming Liu
2007-02-12 18:09       ` jozsef imrek
2007-02-12 19:18         ` Ming Liu
2007-02-14  7:24           ` jozsef imrek [this message]
2007-02-09 16:00   ` Rick Moleres
2007-02-11  6:22     ` Leonid
2007-02-11 13:37     ` Ming Liu
2007-02-12 19:45       ` Rick Moleres
2007-02-12 20:39         ` Ming Liu
2007-02-11  6:55   ` Linux " Leonid
2007-02-11 13:10     ` Ming Liu
  -- strict thread matches above, loose matches on Subject: below --
2006-12-13  0:11 Speed of plb_temac 3.00 " Rick Moleres
2006-12-17 15:05 ` Ming Liu
2006-12-05 16:18 Thomas Denzinger
2006-12-05 16:49 ` Ming Liu
2006-12-05 18:42 ` Michael Galassi

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=Pine.LNX.4.61.0702140546360.32655@imrek.org \
    --to=imrek@atomki.hu \
    --cc=linuxppc-embedded@ozlabs.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.