MCPcopy Create free account
hub / github.com/NetSys/bess / PostPopulate

Method PostPopulate

core/packet_pool.cc:147–164  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

145}
146
147void PacketPool::PostPopulate() {
148 PoolPrivate priv = {
149 .dpdk_priv = {.mbuf_data_room_size = SNBUF_HEADROOM + SNBUF_DATA,
150 .mbuf_priv_size = SNBUF_RESERVE},
151 .owner = this};
152
153 rte_pktmbuf_pool_init(pool_, &priv.dpdk_priv);
154 rte_mempool_obj_iter(pool_, InitPacket, nullptr);
155
156 LOG(INFO) << name_ << " has been created with " << Capacity() << " packets";
157 if (Capacity() == 0) {
158 LOG(FATAL) << name_ << " has no packets allocated\n"
159 << "Troubleshooting:\n"
160 << " - Check 'ulimit -l'\n"
161 << " - Do you have enough memory on the machine?\n"
162 << " - Maybe memory is too fragmented. Try rebooting.\n";
163 }
164}
165
166PlainPacketPool::PlainPacketPool(size_t capacity, int socket_id)
167 : PacketPool(capacity, socket_id) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected