align = RTE_CACHE_LINE_ROUNDUP(align); rte_spinlock_lock(&heap->lock); /*找到合适的malloc_elem结构*/ elem = find_suitable_element(heap, size, flags, align, bound); if (elem != NULL) { elem = malloc_elem_alloc(elem, size, align, bound); /* increase heap's count of allocated el...
(rte_spinlock_trylock(&vq->access_lock) == 0)) //对该虚拟队列加锁 return 0; if (unlikely(vq->enabled == 0)) //如果vq不可访问,对虚拟队列解锁退出 goto out_access_unlock; vq->batch_copy_nb_elems = 0; //批处理需要拷贝的数据包数目 if (dev->features & (1ULL << VIRTIO_F_...
unsignedintsize_flags = flags & ~RTE_MEMZONE_SIZE_HINT_ONLY;intsocket_id;void*ret;conststructinternal_config *internal_conf =eal_get_internal_configuration(); rte_spinlock_lock(&(heap->lock)); align= align ==0?1: align;/*for legacy mode, try once and with all flags*/if(internal_conf...
size_t size, unsigned flags,4size_t align, size_t bound)5{6structmalloc_elem *elem;7/*将size调整为cache line对齐*/8size =RTE_CACHE_LINE_ROUNDUP(size);9align =RTE_CACHE_LINE_ROUNDUP(align);1011rte_spinlock_lock(&heap->lock);12/*找到合适的malloc_elem结构*/13elem =find_suitable...
rte_spinlock_lock(&rte_eth_dev_shared_data->ownership_lock); //check一下,此name是否已经被申请。 if (_rte_eth_dev_allocated(name) != NULL) { RTE_ETHDEV_LOG(ERR, "Ethernet device with name %s already allocated\n", name); goto unlock; ...
*/ int rte_mempool_register_ops(const struct rte_mempool_ops *h) { struct rte_mempool_ops *ops; int16_t ops_index; rte_spinlock_lock(&rte_mempool_ops_table.sl); if (rte_mempool_ops_table.num_ops >= RTE_MEMPOOL_MAX_OPS_IDX) { rte_spinlock_unlock(&rte_mempool_ops_table.sl); ...
Provide feedback We read every piece of feedback, and take your input very seriously. Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Cancel Create saved search Sign in Sign up...
1void*2malloc_heap_alloc(structmalloc_heap *heap,3constchar*type __attribute__((unused)), size_t size, unsigned align)4{5if(!heap->initialised)6malloc_heap_init(heap);78size =CACHE_LINE_ROUNDUP(size);9align =CACHE_LINE_ROUNDUP(align);10rte_spinlock_lock(&heap->lock);11structmalloc_...
rte_spinlock_lock( @@ -954,8 +954,8 @@ struct rte_timer_data { * operations above the status update are observed * before the update by all threads */ - __atomic_store_n(&tim->status.u32, status.u32, - __ATOMIC_RELEASE); ...
rte_spinlock_unlock(&rte_cryptodev_callback_lock); @@ -1555,7 +1555,8 @@ struct rte_cryptodev_cb * struct rte_cryptodev_cb *cb) { struct rte_cryptodev *dev; - struct rte_cryptodev_cb **prev_cb, *curr_cb; + RTE_ATOMIC(struct rte_cryptodev_cb *) *prev_cb; ...