/* * Allocate packets for transmission. */ static int alloc_packets(odp_packet_t *pkt_tbl, int num_pkts) { int n; for (n = 0; n < num_pkts; ++n) { pkt_tbl[n] = pktio_create_packet(); if (pkt_tbl[n] == ODP_PACKET_INVALID) break; } return n; }
/* * Allocate packets for transmission. */ static int alloc_packets(odp_event_t *event_tbl, int num_pkts) { odp_packet_t pkt_tbl[num_pkts]; int n; for (n = 0; n < num_pkts; ++n) { pkt_tbl[n] = pktio_create_packet(); if (pkt_tbl[n] == ODP_PACKET_INVALID) break; event_tbl[n] = odp_packet_to_event(pkt_tbl[n]); } return n; }