美文网首页
rte_ring_dequeue_burst() :__inli

rte_ring_dequeue_burst() :__inli

作者: Then丶 | 来源:发表于2020-03-20 10:33 被阅读0次

    rte_ring_dequeue_burst();

     rte_common.h
    #define __rte_always_inline   inline __attribute__((always_inline))
    
    mian.c:
    const uint16_t nb_in_deq = rte_ring_dequeue_burst(ring,
                (void *)rxtx_bufs, BURST_SIZE, NULL);
    
    rte_ring.h
    /**
     * Dequeue multiple objects from a ring up to a maximum number.
     *
     * This function calls the multi-consumers or the single-consumer
     * version, depending on the default behaviour that was specified at
     * ring creation time (see flags).
     *
     * @param r
     *   A pointer to the ring structure.
     * @param obj_table
     *   A pointer to a table of void * pointers (objects) that will be filled.
     * @param n
     *   The number of objects to dequeue from the ring to the obj_table.
     * @param available
     *   If non-NULL, returns the number of remaining ring entries after the
     *   dequeue has finished.
     * @return
     *   - Number of objects dequeued
     */
    static __rte_always_inline unsigned
    rte_ring_dequeue_burst(struct rte_ring *r, void **obj_table,
            unsigned int n, unsigned int *available)
    {
        return __rte_ring_do_dequeue(r, obj_table, n,
                    RTE_RING_QUEUE_VARIABLE,
                    r->cons.single, available);
    }
    

    相关文章

      网友评论

          本文标题:rte_ring_dequeue_burst() :__inli

          本文链接:https://www.haomeiwen.com/subject/bfpdyhtx.html