xlate: Skip recirculation for output and set actions
authorSimon Horman <simon.horman@netronome.com>
Wed, 25 May 2016 01:34:31 +0000 (10:34 +0900)
committerSimon Horman <simon.horman@netronome.com>
Fri, 27 May 2016 04:24:21 +0000 (13:24 +0900)
commite12ec36b0c77f175af0a64c47e7c291798ef2013
tree86456ce4a70329beb0e76bc8d08a06384aa64690
parent622ad88544fa0eeb0a5797af0573485407a87eaf
xlate: Skip recirculation for output and set actions

Until 8bf009bf8ab4 ("xlate: Always recirculate after an MPLS POP to a
non-MPLS ethertype.") the translation code took some care to only
recirculate as a result of a pop_mpls action if necessary. This was
implemented using per-action checks and resulted in some maintenance
burden.

Unfortunately recirculation is a relatively expensive operation and a
performance degradation of up to 35% has been observed with the above
mentioned patch applied for the arguably common case of:

pop_mpls,set(l2 field),output

This patch attempts to strike a balance between performance and
maintainability by special casing set and output actions such
that recirculation may be avoided.

This partially reverts the above mentioned commit. In particular most
of the C code outside of do_xlate_actions().

Signed-off-by: Simon Horman <simon.horman@netronome.com>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
ofproto/ofproto-dpif-xlate.c
tests/mpls-xlate.at
tests/ofproto-dpif.at