summaryrefslogtreecommitdiff
path: root/examples/ipv4_multicast
diff options
context:
space:
mode:
authorOlivier Matz <olivier.matz@6wind.com>2014-08-28 16:42:37 +0100
committerThomas Monjalon <thomas.monjalon@6wind.com>2014-09-17 11:27:51 +0200
commitea672a8b1655bbb44876d2550ff56f384968a43b (patch)
treea3a44af5b72c8dd45550107eedcc10f0fc7d5c2f /examples/ipv4_multicast
parent9aaccf1abdb2894ec23870e1d2199a657f85850e (diff)
downloaddpdk-ea672a8b1655bbb44876d2550ff56f384968a43b.zip
dpdk-ea672a8b1655bbb44876d2550ff56f384968a43b.tar.gz
dpdk-ea672a8b1655bbb44876d2550ff56f384968a43b.tar.xz
mbuf: remove the rte_pktmbuf structure
The rte_pktmbuf structure was initially included in the rte_mbuf structure. This was needed when there was 2 types of mbuf (ctrl and packet). As the control mbuf has been removed, we can merge the rte_pktmbuf into the rte_mbuf structure. Advantages of doing this: - the access to mbuf fields is easier (ex: m->data instead of m->pkt.data) - make the structure more consistent: for instance, there was no reason to have the ol_flags field in rte_mbuf - it will allow a deeper reorganization of the rte_mbuf structure in the next commits, allowing to gain several bytes in it Signed-off-by: Olivier Matz <olivier.matz@6wind.com> [Bruce: updated for latest code and new example apps] Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Diffstat (limited to 'examples/ipv4_multicast')
-rw-r--r--examples/ipv4_multicast/main.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c
index 7b53296..cc12d9d 100644
--- a/examples/ipv4_multicast/main.c
+++ b/examples/ipv4_multicast/main.c
@@ -329,17 +329,17 @@ mcast_out_pkt(struct rte_mbuf *pkt, int use_clone)
}
/* prepend new header */
- hdr->pkt.next = pkt;
+ hdr->next = pkt;
/* update header's fields */
- hdr->pkt.pkt_len = (uint16_t)(hdr->pkt.data_len + pkt->pkt.pkt_len);
- hdr->pkt.nb_segs = (uint8_t)(pkt->pkt.nb_segs + 1);
+ hdr->pkt_len = (uint16_t)(hdr->data_len + pkt->pkt_len);
+ hdr->nb_segs = (uint8_t)(pkt->nb_segs + 1);
/* copy metadata from source packet*/
- hdr->pkt.in_port = pkt->pkt.in_port;
- hdr->pkt.vlan_macip = pkt->pkt.vlan_macip;
- hdr->pkt.hash = pkt->pkt.hash;
+ hdr->in_port = pkt->in_port;
+ hdr->vlan_macip = pkt->vlan_macip;
+ hdr->hash = pkt->hash;
hdr->ol_flags = pkt->ol_flags;
@@ -412,7 +412,7 @@ mcast_forward(struct rte_mbuf *m, struct lcore_queue_conf *qconf)
/* Should we use rte_pktmbuf_clone() or not. */
use_clone = (port_num <= MCAST_CLONE_PORTS &&
- m->pkt.nb_segs <= MCAST_CLONE_SEGS);
+ m->nb_segs <= MCAST_CLONE_SEGS);
/* Mark all packet's segments as referenced port_num times */
if (use_clone == 0)