[ixp1200] How to duplicate a packet in memory?

Johnson, Erik J erik.j.johnson at intel.com
Thu Jun 10 17:16:17 EDT 2004


 Hi Øyvind 

I am unaware of any magic instructions.  My main suggestion is to consider alternative buffer representations.  If it is common for your application to perform this type of "multicast", a buffer representation that had reference counting capabilities (so you can copy by only increasing the reference count) and non-contiguous data layout (for example, like mbufs so that the multiple owners of packets and modify, say, the packet headers independently while sharing the packet payload) will probably provide the best performance.  The downside is integrating a new buffer scheme with the existing SDK, which will require touching several of the SDK components (rx, tx, resource manager).

If you don't want to write a new buffer data structure, my only other thought would be to dedicate a microengine to buffer copying.  This ME could receive packet (handles) on one queue and return the duplicated handle on another queue.  The implementation of the buffer copy could obviously use multiple threads in the ME, but could also include a single thread working on copying multiple packets at once if you need to hide even more memory latency.

erik

~~~~~~~~~~~~~~~~~~~~~~~~
Erik J. Johnson
erik.j.johnson at intel.com
Not speaking for Intel
~~~~~~~~~~~~~~~~~~~~~~~~

-----Original Message-----
From: ixp1200-bounces at lists.cs.princeton.edu [mailto:ixp1200-bounces at lists.cs.princeton.edu] On Behalf Of Øyvind Hvamstad
Sent: Thursday, June 10, 2004 6:58 AM
To: ixp1200 at lists.cs.princeton.edu
Subject: [ixp1200] How to duplicate a packet in memory?

Hi, I'm wondering what is the best way to duplicate a packet in SDRAM?
The reason for this is that I want to send one copy of the packet to the StrongARM and the other copy will be forwarded to a different host after some modifications.

1. I could loop in microcode and use sdram[read] -> sdram[write] in sequence until I reach the end of the packet.

2. I can copy it using the StrongARM, but this would probably mean that the whole forwarding process will be stalled until the copying is finished.

3. There is some 'magic' instruction that does this for me, that I'm unaware of.

I'd much appreciate it if someone could give me a clue about what is the best practice here?

Info: ENP-2505, embedded linux, Intel SDK 2.01
--
Øyvind Hvamstad <oyvindh at ifi.uio.no>

_______________________________________________
ixp1200 mailing list
ixp1200 at lists.cs.princeton.edu
https://lists.cs.princeton.edu/mailman/listinfo/ixp1200



More information about the ixp1200 mailing list