/*-
* BSD LICENSE
*
- * Copyright(c) 2010-2012 Intel Corporation. All rights reserved.
+ * Copyright(c) 2010-2013 Intel Corporation. All rights reserved.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * version: DPDK.L.1.2.3-3
*/
#include <stdarg.h>
tx_mbuf_alloc(struct rte_mempool *mp)
{
struct rte_mbuf *m;
- void *mb;
- if (rte_mempool_get(mp, &mb) < 0)
- return NULL;
- m = (struct rte_mbuf *)mb;
- __rte_mbuf_sanity_check(m, RTE_MBUF_PKT, 1);
- return m;
+ m = __rte_mbuf_raw_alloc(mp);
+ __rte_mbuf_sanity_check_raw(m, RTE_MBUF_PKT, 0);
+ return (m);
}
static void
for (i = 1; i < tx_pkt_nb_segs; i++) {
pkt_seg->pkt.next = tx_mbuf_alloc(mbp);
if (pkt_seg->pkt.next == NULL) {
+ pkt->pkt.nb_segs = i;
rte_pktmbuf_free(pkt);
goto nomore_mbuf;
}
pkt->pkt.nb_segs = tx_pkt_nb_segs;
pkt->pkt.pkt_len = tx_pkt_length;
pkt->ol_flags = ol_flags;
- pkt->pkt.vlan_tci = vlan_tci;
- pkt->pkt.l2_len = sizeof(struct ether_hdr);
- pkt->pkt.l3_len = sizeof(struct ipv4_hdr);
+ pkt->pkt.vlan_macip.f.vlan_tci = vlan_tci;
+ pkt->pkt.vlan_macip.f.l2_len = sizeof(struct ether_hdr);
+ pkt->pkt.vlan_macip.f.l3_len = sizeof(struct ipv4_hdr);
pkts_burst[nb_pkt] = pkt;
}
nb_tx = rte_eth_tx_burst(fs->tx_port, fs->tx_queue, pkts_burst, nb_pkt);