path: root/examples/ipv4_multicast
diff options
authorBruce Richardson <>2014-09-09 15:40:56 +0100
committerThomas Monjalon <>2014-09-17 11:29:17 +0200
commit7869536f3f8edace05043be6f322b835702b201c (patch)
tree7613b41dd1d24b7546fee20be457b2b5ee9cb925 /examples/ipv4_multicast
parentca04aaea8011f983178d295cd9e73a43fc2eaf7c (diff)
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 <> Acked-by: Olivier Matz <> Acked-by: Pablo de Lara <>
Diffstat (limited to 'examples/ipv4_multicast')
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c
index 2232851..35bd842 100644
--- a/examples/ipv4_multicast/main.c
+++ b/examples/ipv4_multicast/main.c
@@ -338,7 +338,8 @@ mcast_out_pkt(struct rte_mbuf *pkt, int use_clone)
/* copy metadata from source packet*/
hdr->port = pkt->port;
- hdr->vlan_macip = pkt->vlan_macip;
+ hdr->vlan_tci = pkt->vlan_tci;
+ hdr->l2_l3_len = pkt->l2_l3_len;
hdr->hash = pkt->hash;
hdr->ol_flags = pkt->ol_flags;