Changes between Version 1 and Version 2 of user_applications


Ignore:
Timestamp:
Apr 4, 2015, 1:16:05 PM (9 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • user_applications

    v1 v2  
    2727
    2828== __Classif__ ==
     29
     30This multi-threaded application takes a stream of Gigabit Ethernet packets, and makes packet analysis and classification, based on the source MAC address.
     31It uses the multi-channels NIC peripheral, and the chained buffers DMA controller, to receive and send packets on the Gigabit Ethernet port.
     32
     33It can run on architectures containing up to 256 clusters, and up to 8 processors per cluster.
     34
     35This application is described as a TCG (Task and Communication Graph)  containing (N+2) tasks per cluster: one '''load''' task, one '''store''' task, and N '''analyse''' tasks. Each container can contain from 2 to 60 packets and has a fixed size of 4 Kbytes. These containers are distributed in clusters:
     36 * one RX container per cluster (part of the kernel rx_chbuf), in the kernel heap.
     37 * one TX container per cluster (part of the kernel tx-chbuf), in the kernel heap.
     38 * N working containers per cluster (one per analysis task), in the user heap.
     39In each cluster, the "load", analysis" and "store" tasks communicates through three local MWMR FIFOs:
     40 * fifo_l2a : tranfer a full container from "load" to "analyse" task.
     41 * fifo_a2s : transfer a full container from "analyse" to "store" task.
     42 * fifo_s2l : transfer an empty container from "store" to "load" task.
     43For each fifo, one item is a 32 bits word defining the index of an available working container.
     44
     45The pointers on the working containers, and the pointers on the MWMR fifos are defined by global arrays stored in cluster[0][0].
     46The MWMR fifo descriptors array is defined as a global variable in cluster[0][0].
     47
     48Initialisation is done in three steps by the "load" & "store" tasks:
     49 1. Task "load" in cluster[0][0] initialises the heaps in all clusters. Other tasks are waiting on the global_sync synchronisation variable.
     50 2. Task "load" in cluster[0][0] initialises the barrier between all "load" tasks, allocates NIC & CMA RX channel, and starts the NIC_CMA RX transfer. Other "load" tasks are waiting on the load_sync synchronisation variable. Task "store" in cluster[0][0] initialises the barrier between all "store" tasks, allocates NIC & CMA TX channels, and starts the NIC_CMA TX transfer. Other "store" tasks are waiting on the store_sync synchronisation variable.
     51 3. When this global initialisation is completed, the "load" task in all clusters allocates the working containers and the MWMR fifos descriptors from the user local heap. In each cluster, the "analyse" and "store" tasks are waiting the local initialisation completion on the local_sync[x][y] variables.
     52
     53When initialisation is completed, all tasks loop on containers:
     54 1. The "load" task get an empty working container from the fifo_s2l, transfer one container from the kernel rx_chbuf to this user container, and transfer ownership of this container to one "analysis" task by writing into the fifo_l2a.   
     55 2. The "analyse" task get one working container from the fifo_l2a, analyse each packet header, compute the packet type (depending on the SRC MAC address), increment the correspondint classification counter, and transpose the SRC and the DST MAC addresses fot TX tranmission.
     56 3. The "store" task transfer get a full working container from the fifo_a2s, transfer this user container content to the the kernel tx_chbuf, and transfer ownership of this empty container to the "load" task by writing into the fifo_s2l.   
     57
     58Instrumentation results display is done by the "store" task in cluster[0][0] when all "store" tasks completed the number of clusters specified by the CONTAINERS_MAX parameter.