mbuf: flatten struct vlan_macip
authorBruce Richardson <bruce.richardson@intel.com>
Tue, 9 Sep 2014 14:40:56 +0000 (15:40 +0100)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Wed, 17 Sep 2014 09:29:17 +0000 (11:29 +0200)
commit7869536f3f8edace05043be6f322b835702b201c
tree7613b41dd1d24b7546fee20be457b2b5ee9cb925
parentca04aaea8011f983178d295cd9e73a43fc2eaf7c
mbuf: flatten struct vlan_macip

The vlan_macip structure combined a vlan tag id with l2 and l3 headers
lengths for tracking offloads. However, this structure was only used as
a unit by the e1000 and ixgbe drivers, not generally.

This patch removes the structure from the mbuf header and places the
fields into the mbuf structure directly at the required point, without
any net effect on the structure layout. This allows us to treat the vlan
tags and header length fields as separate for future mbuf changes. The
drivers which were written to use the combined structure still do so,
using a driver-local definition of it.

Reduce perf regression caused by splitting vlan_macip field. This is
done by providing a single uint16_t value to allow writing/clearing
the l2 and l3 lengths together. There is still a small perf hit to the
slow path TX due to the reads from vlan_tci and l2/l3 lengths being
separated. (<5% in my tests with testpmd with no extra params).
Unfortunately, this cannot be eliminated, without restoring the vlan
tags and l2/l3 lengths as a combined 32-bit field. This would prevent
us from ever looking to move those fields about and is an artificial tie
that applies only for performance in igb and ixgbe drivers. Therefore,
this patch keeps the vlan_tci field separate from the lengths as the
best solution going forward.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Olivier Matz <olivier.matz@6wind.com>
Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
25 files changed:
app/test-pmd/csumonly.c
app/test-pmd/flowgen.c
app/test-pmd/macfwd.c
app/test-pmd/macswap.c
app/test-pmd/rxonly.c
app/test-pmd/testpmd.c
app/test-pmd/txonly.c
app/test/packet_burst_generator.c
examples/ip_fragmentation/main.c
examples/ip_pipeline/pipeline_rx.c
examples/ip_pipeline/pipeline_tx.c
examples/ip_reassembly/main.c
examples/ipv4_multicast/main.c
examples/vhost/main.c
lib/librte_ip_frag/ip_frag_common.h
lib/librte_ip_frag/rte_ipv4_fragmentation.c
lib/librte_ip_frag/rte_ipv4_reassembly.c
lib/librte_ip_frag/rte_ipv6_reassembly.c
lib/librte_mbuf/rte_mbuf.h
lib/librte_pmd_e1000/em_rxtx.c
lib/librte_pmd_e1000/igb_rxtx.c
lib/librte_pmd_i40e/i40e_rxtx.c
lib/librte_pmd_ixgbe/ixgbe_rxtx.c
lib/librte_pmd_ixgbe/ixgbe_rxtx.h
lib/librte_pmd_vmxnet3/vmxnet3_rxtx.c