examples/ip_pipeline: add swap action in pass-through
authorJasvinder Singh <jasvinder.singh@intel.com>
Fri, 26 Aug 2016 21:21:44 +0000 (22:21 +0100)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Wed, 12 Oct 2016 20:44:08 +0000 (22:44 +0200)
commitcbe82f6cfb0a8d30abeccc84693bbe7ee815bfb9
tree0090562824ea7032fed3433b55e6336826212a02
parenteb87d619fa91d4bbc5adca3d89ce8214b79032f8
examples/ip_pipeline: add swap action in pass-through

Pass-through pipeline is updated with addition of packet fields swap
action. To enable swap action, new entry i.e 'swap' is required in
the passthrough pipeline section of the configuration file, and this
entry contains the offsets (in bytes) of the packet fields to be
swapped.

Each swap entry specifies the pair of packet fields offsets to be
swapped. Therefore, to perform swap action on more than one pair of
packets fields, separate swap entries, each one responsible for unique
pair of packet fields are needed.

Following illustrates the pass-through pipeline configuration that
swaps the source and destination addresses of the mac and tcp
ports of the received packets.

[EAL]
log_level = 0

[PIPELINE0]
type = MASTER
core = 0

[PIPELINE1]
type = PASS-THROUGH
core = 1
pktq_in = RXQ0.0 RXQ1.0 RXQ2.0 RXQ3.0
pktq_out = TXQ0.0 TXQ1.0 TXQ2.0 TXQ3.0

swap = 256 262; MACDST <-> MACSRC
;swap = 282 286; IPSRC <-> IPDST
swap = 290 292; PORTSRC <-> PORTDST

Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
examples/ip_pipeline/pipeline/pipeline_passthrough.c
examples/ip_pipeline/pipeline/pipeline_passthrough_be.c
examples/ip_pipeline/pipeline/pipeline_passthrough_be.h