FW: [ixp1200] HELP!!

Øyvind Hvamstad oyvindh at ifi.uio.no
Thu Jun 17 08:28:01 EDT 2004


On tor, 2004-06-17 at 13:28, ULStudent:Denis.Lyons wrote:
> Hi again,
> 
> Just resending this mail as I'm not sure if it was sent successfully last
> time.  I desperately need some help with the following!!
> 
> Can anyone provide me with code to do the following..
> 
> I want to create a lookup table in SRAM as follows:
> 
> -------------------------------------------
> | packet offset | signature len | signature | N matched pkts|
> -------------------------------------------
> |					              |
> |					              |
> -------------------------------------------
> 
> As packets arrive I want to search this table and increment the N matched
> packets counter if a packet contains any of the signatures in the table.
> 
> Any help will be greatly appreciated,

You could initialize your table from the core ACE component in a way
similar to this pseodo code:

RmMalloc(RM_SRAM, &table_handle, NO_OF_ENTRIES*SIZE_OF_ENTRY);
RmGetPhysOffset(RM_SRAM, table_handle, &table_base_offset);

Then you must patch a symbol to the microblock so it knows the address
where it starts.

strcpy(symbols[1].name, SRAM_TBL_BASE);
symbols[1].value = table_base_offset;

for(i = 0; i < MAX_NUM_UENG; i++) {
       if(((aced->ue >> i) & 0x1)) {
             RmUengPatchSymbols(i, symbols, POL_NUM_SYMBOLS);
       }
}

The microblock code then needs to import this symbol. The examples from
Intel or Comer's wwbump shows how this is done. You simply include a .h
file in both the core and microblock which look like this:

#ifndef MICROCODE

#define SRAM_TBL_BASE "_SRAM_TBL_BASE"

#else

.import_var _SRAM_TBL_BASE

#endif

The microblock code then use this patched value

immed32[t_base, _SRAM_TBL_BASE]
sram[read, $res[0], t_offset, t_base, 1], ctx_swap, optimize_mem

This is not a full example, but it may give you an idea of how to start.
Add you own logic and have a look at some of the example code. There are
probably other ways to do it as well. I have left out error checks here.

> Thanks for your time,

Hope this helps.

> Denis
-- 
Øyvind Hvamstad <oyvindh at ifi.uio.no>



More information about the ixp1200 mailing list