packetgraph icon indicating copy to clipboard operation
packetgraph copied to clipboard

Allow to set one burst callback per sides

Open outscale-mgo opened this issue 8 years ago • 0 comments

Each brick have a burst callback which should in most case have a completely different behaviours depending of the direction of packets passing though the brick so, on a lot of brick the first job of the callback is to determine where the packet come from with that kind of code:

if (sate->output == from)
       return sub-function-1(...);
else
       return sub-function-2(...);

So maybe it would be faster if instead of having a callback that check the output at each call, we have one callback for each sides.

The simplest way to start implementing thi, would be to replace

int (*burst)(struct pg_brick *brick, enum pg_side from,
uint16_t edge_index, struct rte_mbuf **pkts,
uint64_t pkts_mask, struct pg_error **errp);

per

int (*burst[MAX_SIDES])(struct pg_brick *brick, enum pg_side from,
uint16_t edge_index, struct rte_mbuf **pkts,
uint64_t pkts_mask, struct pg_error **errp);

outscale-mgo avatar Jul 21 '17 09:07 outscale-mgo