DPDK 無鎖ring

本文整理下之前的學習筆記,基于DPDK17.11版本源碼,主要分析無鎖隊列ring的實現。

rte_ring_tailq保存rte_ring鏈表

創建ring后會將其插入共享內存鏈表rte_ring_tailq,以便主從進程都可以訪問。

//定義隊列頭結構 struct rte_tailq_elem_head
TAILQ_HEAD(rte_tailq_elem_head, rte_tailq_elem);

//聲明全局變量rte_tailq_elem_head,類型為struct rte_tailq_elem_head,
//相當于是鏈表頭,用來保存本進程注冊的隊列
/* local tailq list */
static struct rte_tailq_elem_head rte_tailq_elem_head =
    TAILQ_HEAD_INITIALIZER(rte_tailq_elem_head);

//調用EAL_REGISTER_TAILQ在main函數前注冊rte_ring_tailq到全局變量rte_tailq_elem_head。
#define RTE_TAILQ_RING_NAME "RTE_RING"
static struct rte_tailq_elem rte_ring_tailq = {
    .name = RTE_TAILQ_RING_NAME,
};
EAL_REGISTER_TAILQ(rte_ring_tailq)

調用rte_eal_tailq_update遍歷鏈表rte_tailq_elem_head上的節點,將節點中的head指向 struct rte_mem_ring->tailq_head[]數組中的一個tailq_head,此head又作為另一個鏈表頭。比如注冊的rte_ring_tailq節點,其head專門用來保存創建的rte_ring(將rte_ring作為struct rte_tailq_entry的data,將struct rte_tailq_entry插入head)。前面說過struct rte_mem_ring->tailq_head存放在共享內存中,主從進程都可以訪問,這樣對于rte_ring來說,主從進程都可以創建/訪問ring。

相關的數據結構如下圖所示


image.png

創建ring

調用函數rte_ring_create創建ring,它會申請一塊memzone的內存,大小為struct rte_ring結構加上count個void類型指針,內存結構如下


image.png

然后將ring中生產者和消費者的頭尾指向0,最后將ring作為struct rte_tailq_entry的data插入共享內存鏈表,這樣主從進程都可以訪問此ring。

/**
 * An RTE ring structure.
 *
 * The producer and the consumer have a head and a tail index. The particularity
 * of these index is that they are not between 0 and size(ring). These indexes
 * are between 0 and 2^32, and we mask their value when we access the ring[]
 * field. Thanks to this assumption, we can do subtractions between 2 index
 * values in a modulo-32bit base: that's why the overflow of the indexes is not
 * a problem.
 */
struct rte_ring {
    /*
     * Note: this field kept the RTE_MEMZONE_NAMESIZE size due to ABI
     * compatibility requirements, it could be changed to RTE_RING_NAMESIZE
     * next time the ABI changes
     */
    char name[RTE_MEMZONE_NAMESIZE] __rte_cache_aligned; /**< Name of the ring. */
    //flags有如下三個值:
    //RING_F_SP_ENQ創建單生產者,
    //RING_F_SC_DEQ創建單消費者,
    //RING_F_EXACT_SZ
    int flags;               /**< Flags supplied at creation. */
    //memzone內存管理的底層結構,用來分配內存
    const struct rte_memzone *memzone;
            /**< Memzone, if any, containing the rte_ring */
    //size為ring大小,值和RING_F_EXACT_SZ有關,如果指定了flag     
    //RING_F_EXACT_SZ,則size為rte_ring_create的參數count的
    //向上取2次方,比如count為15,則size就為16。如果沒有指定
    //flag,則count必須是2的次方,此時size等于count
    uint32_t size;           /**< Size of ring. */
    //mask值為size-1
    uint32_t mask;           /**< Mask (size-1) of ring. */
    //capacity的值也和RING_F_EXACT_SZ有關,如果指定了,
    //則capacity為rte_ring_create的參數count,如果沒指定,
    //則capacity為size-1
    uint32_t capacity;       /**< Usable size of ring */

    //生產者位置,包含head和tail,head代表著下一次生產時的起
    //始位置。tail代表消費者可以消費的位置界限,到達tail后就無  
    //法繼續消費,通常情況下生產完成后tail = head,意味著剛生
    //產的元素皆可以被消費
    /** Ring producer status. */
    struct rte_ring_headtail prod __rte_aligned(PROD_ALIGN);

    // 消費者位置,也包含head和tail,head代表著下一次消費時的
    //起始位置。tail代表生產者可以生產的位置界限,到達tail后就
    //無法繼續生產,通常情況下消費完成后,tail =head,意味著
    //剛消費的位置皆可以被生產
    /** Ring consumer status. */
    struct rte_ring_headtail cons __rte_aligned(CONS_ALIGN);
};

下面看一下在函數rte_ring_create中ring是如何被創建的。

/* create the ring */
struct rte_ring *
rte_ring_create(const char *name, unsigned count, int socket_id, unsigned flags)
{
    char mz_name[RTE_MEMZONE_NAMESIZE];
    struct rte_ring *r;
    struct rte_tailq_entry *te;
    const struct rte_memzone *mz;
    ssize_t ring_size;
    int mz_flags = 0;
    struct rte_ring_list* ring_list = NULL;
    const unsigned int requested_count = count;
    int ret;

    //(tailq_entry)->tailq_head 的類型應該是 struct rte_tailq_entry_head,
    //但是返回的卻是 struct rte_ring_list,因為 rte_tailq_entry_head 和 rte_ring_list 定義都是一樣的,
    //可以認為是等同的。
    #define RTE_TAILQ_CAST(tailq_entry, struct_name) \
        (struct struct_name *)&(tailq_entry)->tailq_head
    ring_list = RTE_TAILQ_CAST(rte_ring_tailq.head, rte_ring_list);

    /* for an exact size ring, round up from count to a power of two */
    if (flags & RING_F_EXACT_SZ)
        count = rte_align32pow2(count + 1);

    //獲取需要的內存大小,包括結構體 struct rte_ring 和 count 個指針
    ring_size = rte_ring_get_memsize(count);
        ssize_t sz;
        sz = sizeof(struct rte_ring) + count * sizeof(void *);
        sz = RTE_ALIGN(sz, RTE_CACHE_LINE_SIZE);
    
    #define RTE_RING_MZ_PREFIX "RG_"
    snprintf(mz_name, sizeof(mz_name), "%s%s", RTE_RING_MZ_PREFIX, name);

    //分配 struct rte_tailq_entry,用來將申請的ring掛到共享鏈表ring_list中
    te = rte_zmalloc("RING_TAILQ_ENTRY", sizeof(*te), 0);

    rte_rwlock_write_lock(RTE_EAL_TAILQ_RWLOCK);

    //申請memzone,
    /* reserve a memory zone for this ring. If we can't get rte_config or
     * we are secondary process, the memzone_reserve function will set
     * rte_errno for us appropriately - hence no check in this this function */
    mz = rte_memzone_reserve_aligned(mz_name, ring_size, socket_id, mz_flags, __alignof__(*r));
    if (mz != NULL) {
        //memzone的的addr指向分配的內存,ring也從此內存開始
        r = mz->addr;
        /* no need to check return value here, we already checked the
         * arguments above */
        rte_ring_init(r, name, requested_count, flags);

        //將ring保存到鏈表entry中
        te->data = (void *) r;
        r->memzone = mz;

        //將鏈表entry插入鏈表ring_list
        TAILQ_INSERT_TAIL(ring_list, te, next);
    } else {
        r = NULL;
        RTE_LOG(ERR, RING, "Cannot reserve memory\n");
        rte_free(te);
    }
    rte_rwlock_write_unlock(RTE_EAL_TAILQ_RWLOCK);

    return r;
}

int
rte_ring_init(struct rte_ring *r, const char *name, unsigned count,
    unsigned flags)
{
    int ret;

    /* compilation-time checks */
    RTE_BUILD_BUG_ON((sizeof(struct rte_ring) &
              RTE_CACHE_LINE_MASK) != 0);
    RTE_BUILD_BUG_ON((offsetof(struct rte_ring, cons) &
              RTE_CACHE_LINE_MASK) != 0);
    RTE_BUILD_BUG_ON((offsetof(struct rte_ring, prod) &
              RTE_CACHE_LINE_MASK) != 0);

    /* init the ring structure */
    memset(r, 0, sizeof(*r));
    ret = snprintf(r->name, sizeof(r->name), "%s", name);
    if (ret < 0 || ret >= (int)sizeof(r->name))
        return -ENAMETOOLONG;
    r->flags = flags;
    r->prod.single = (flags & RING_F_SP_ENQ) ? __IS_SP : __IS_MP;
    r->cons.single = (flags & RING_F_SC_DEQ) ? __IS_SC : __IS_MC;

    if (flags & RING_F_EXACT_SZ) {
        r->size = rte_align32pow2(count + 1);
        r->mask = r->size - 1;
        r->capacity = count;
    } else {
        if ((!POWEROF2(count)) || (count > RTE_RING_SZ_MASK)) {
            RTE_LOG(ERR, RING,
                "Requested size is invalid, must be power of 2, and not exceed the size limit %u\n",
                RTE_RING_SZ_MASK);
            return -EINVAL;
        }
        r->size = count;
        r->mask = count - 1;
        r->capacity = r->mask;
    }
    //初始時,生產者和消費者的首尾都為0
    r->prod.head = r->cons.head = 0;
    r->prod.tail = r->cons.tail = 0;

    return 0;
}

入隊操作

DPDK提供了如下幾個api用來執行入隊操作,它們最終都會調用__rte_ring_do_enqueue來實現,所以重點分析函數__rte_ring_do_enqueue。

//多生產者批量入隊。入隊個數n必須全部成功,否則入隊失敗。調用者明確知道是多生產者
rte_ring_mp_enqueue_bulk
//單生產者批量入隊。入隊個數n必須全部成功,否則入隊失敗。調用者明確知道是單生產者
rte_ring_sp_enqueue_bulk
//批量入隊。入隊個數n必須全部成功,否則入隊失敗。調用者不用關心是不是單生產者
rte_ring_enqueue_bulk
//多生產者批量入隊。入隊個數n不一定全部成功。調用者明確知道是多生產者
rte_ring_mp_enqueue_burst
//單生產者批量入隊。入隊個數n不一定全部成功。調用者明確知道是單生產者
rte_ring_sp_enqueue_burst
//批量入隊。入隊個數n不一定全部成功。調用者不用關心是不是單生產者
rte_ring_enqueue_burst

__rte_ring_do_enqueue主要做了三個事情:
a. 移動生產者head,此處在多生產者下可能會有沖突,需要使用cas操作循環檢測,只有自己能移動head時才行。
b. 執行入隊操作,將obj插入ring,從老的head開始,直到新head結束。
c. 更新生產者tail,只有這樣消費者才能看到最新的消費對象。

其參數r指定了目標ring。
參數obj_table指定了入隊對象。
參數n指定了入隊對象個數。
參數behavior指定了入隊行為,有兩個值RTE_RING_QUEUE_FIXED和RTE_RING_QUEUE_VARIABLE,前者表示入隊對象必須一次性全部成功,后者表示盡可能多的入隊。
參數is_sp指定了是否為單生產者模式,默認為多生產者模式。

static __rte_always_inline unsigned int
__rte_ring_do_enqueue(struct rte_ring *r, void * const *obj_table,
         unsigned int n, enum rte_ring_queue_behavior behavior,
         int is_sp, unsigned int *free_space)
{
    uint32_t prod_head, prod_next;
    uint32_t free_entries;

    //先移動生產者的頭指針,prod_head保存移動前的head,prod_next保存移動后的head
    n = __rte_ring_move_prod_head(r, is_sp, n, behavior,
            &prod_head, &prod_next, &free_entries);
    if (n == 0)
        goto end;

    //&r[1]指向存放對象的內存。
    //從prod_head開始,將n個對象obj_table插入ring的prod_head位置
    ENQUEUE_PTRS(r, &r[1], prod_head, obj_table, n, void *);
    rte_smp_wmb();

    //更新生產者tail
    update_tail(&r->prod, prod_head, prod_next, is_sp);
end:
    if (free_space != NULL)
        *free_space = free_entries - n;
    return n;
}

__rte_ring_move_prod_head用來使用cas操作更新生產者head。

static __rte_always_inline unsigned int
__rte_ring_move_prod_head(struct rte_ring *r, int is_sp,
        unsigned int n, enum rte_ring_queue_behavior behavior,
        uint32_t *old_head, uint32_t *new_head,
        uint32_t *free_entries)
{
    const uint32_t capacity = r->capacity;
    unsigned int max = n;
    int success;

    do {
        /* Reset n to the initial burst count */
        n = max;

        //獲取生產者當前的head位置
        *old_head = r->prod.head;

        /* add rmb barrier to avoid load/load reorder in weak
         * memory model. It is noop on x86
         */
        rte_smp_rmb();

        const uint32_t cons_tail = r->cons.tail;
        /*
         *  The subtraction is done between two unsigned 32bits value
         * (the result is always modulo 32 bits even if we have
         * *old_head > cons_tail). So 'free_entries' is always between 0
         * and capacity (which is < size).
         */
        //獲取空閑 entry 個數
        *free_entries = (capacity + cons_tail - *old_head);

        //如果入隊的對象個數大于空閑entry個數,則如果入隊要求固定大小,則入隊失敗,返回0,否則
        //只入隊空閑entry個數的對象
        /* check that we have enough room in ring */
        if (unlikely(n > *free_entries))
            n = (behavior == RTE_RING_QUEUE_FIXED) ?
                    0 : *free_entries;

        if (n == 0)
            return 0;

        //當前head位置加上入隊對象個數獲取新的生產者head
        *new_head = *old_head + n;
        //如果是單生產者,直接更新生產者head,并返回1
        if (is_sp)
            r->prod.head = *new_head, success = 1;
        else //如果是多生產者,需要借助函數rte_atomic32_cmpset,比較old_head和r->prod.head是否相同,
             //如果相同,則將r->prod.head更新為new_head,并返回1,退出循環,
             //如果不相同說明有其他生產者更新head了,返回0,繼續循環。
            success = rte_atomic32_cmpset(&r->prod.head,
                    *old_head, *new_head);
    } while (unlikely(success == 0));
    return n;
}

ENQUEUE_PTRS定義了入隊操作。

/* the actual enqueue of pointers on the ring.
 * Placed here since identical code needed in both
 * single and multi producer enqueue functions */
#define ENQUEUE_PTRS(r, ring_start, prod_head, obj_table, n, obj_type) do { \
    unsigned int i; \
    const uint32_t size = (r)->size; \
    uint32_t idx = prod_head & (r)->mask; \
    obj_type *ring = (obj_type *)ring_start; \
    //idx+n 大于 size,說明入隊n個對象后,ring還沒滿,還沒翻轉
    if (likely(idx + n < size)) { \
        //一次循環入隊四個對象
        for (i = 0; i < (n & ((~(unsigned)0x3))); i+=4, idx+=4) { \
            ring[idx] = obj_table[i]; \
            ring[idx+1] = obj_table[i+1]; \
            ring[idx+2] = obj_table[i+2]; \
            ring[idx+3] = obj_table[i+3]; \
        } \
        //還有剩余不滿四個對象,則在switch里入隊
        switch (n & 0x3) { \
        case 3: \
            ring[idx++] = obj_table[i++]; /* fallthrough */ \
        case 2: \
            ring[idx++] = obj_table[i++]; /* fallthrough */ \
        case 1: \
            ring[idx++] = obj_table[i++]; \
        } \
    } else { \
        //入隊n個對象,會導致ring滿,發生翻轉,
        //則先入隊idx到size的位置,
        for (i = 0; idx < size; i++, idx++)\
            ring[idx] = obj_table[i]; \
        //再翻轉回到ring起始位置,入隊剩余的對象
        for (idx = 0; i < n; i++, idx++) \
            ring[idx] = obj_table[i]; \
    } \
} while (0)

最后更新生產者tail。

static __rte_always_inline void
update_tail(struct rte_ring_headtail *ht, uint32_t old_val, uint32_t new_val,
        uint32_t single)
{
    /*
     * If there are other enqueues/dequeues in progress that preceded us,
     * we need to wait for them to complete
     */
    if (!single)
        //多生產者時,必須等到其他生產者入隊成功,再更新自己的tail
        while (unlikely(ht->tail != old_val))
            rte_pause();

    ht->tail = new_val;
}

出隊操作

DPDK提供了如下幾個api用來執行出隊操作,它們最終都會調用__rte_ring_do_dequeue來實現,所以重點分析函數__rte_ring_do_dequeue。

//多消費者批量出隊。出隊個數n必須全部成功,否則出隊失敗。調用者明確知道是多消費者
rte_ring_mc_dequeue_bulk
//單消費者批量出隊。出隊個數n必須全部成功,否則出隊失敗。調用者明確知道是單消費者
rte_ring_sc_dequeue_bulk
//批量出隊。出隊個數n必須全部成功,否則出隊失敗。調用者不用關心是不是單消費者
rte_ring_dequeue_bulk
//多消費者批量出隊。出隊個數n不一定全部成功。調用者明確知道是多消費者
rte_ring_mc_dequeue_burst
//單消費者批量出隊。出隊個數n不一定全部成功。調用者明確知道是單消費者
rte_ring_sc_dequeue_burst
//批量出隊。出隊個數n不一定全部成功。調用者不用關心是不是單消費者
rte_ring_dequeue_burst

__rte_ring_do_dequeue主要做了三個事情:
a. 移動消費者head,此處在多消費者下可能會有沖突,需要使用cas操作循環檢測,只有自己能移動head時才行。
b. 執行出隊操作,將ring中的obj插入obj_table,從老的head開始,直到新head結束。
c. 更新消費者tail,只有這樣生成者才能進行生產。

其參數r指定了目標ring。
參數obj_table指定了出隊對象出隊后存放位置。
參數n指定了入隊對象個數。
參數behavior指定了出隊行為,有兩個值RTE_RING_QUEUE_FIXED和RTE_RING_QUEUE_VARIABLE,前者表示出隊對象必須一次性全部成功,后者表示盡可能多的出隊。
參數is_sp指定了是否為單消費者模式,默認為多消費者模式。

static __rte_always_inline unsigned int
__rte_ring_do_dequeue(struct rte_ring *r, void **obj_table,
         unsigned int n, enum rte_ring_queue_behavior behavior,
         int is_sc, unsigned int *available)
{
    uint32_t cons_head, cons_next;
    uint32_t entries;

    //先移動消費者head,成功后,cons_head為老的head,cons_next為新的head,
    //兩者之間的部分為此次可消費的對象
    n = __rte_ring_move_cons_head(r, is_sc, n, behavior,
            &cons_head, &cons_next, &entries);
    if (n == 0)
        goto end;

    //執行出隊操作,從老的cons_head開始出隊n個對象
    DEQUEUE_PTRS(r, &r[1], cons_head, obj_table, n, void *);
    rte_smp_rmb();

    //更新消費者tail,和前面更新生產者head代碼相同
    update_tail(&r->cons, cons_head, cons_next, is_sc);

end:
    if (available != NULL)
        *available = entries - n;
    return n;
}

__rte_ring_move_cons_head用來使用cas操作更新消費者head。

static __rte_always_inline unsigned int
__rte_ring_move_cons_head(struct rte_ring *r, int is_sc,
        unsigned int n, enum rte_ring_queue_behavior behavior,
        uint32_t *old_head, uint32_t *new_head,
        uint32_t *entries)
{
    unsigned int max = n;
    int success;

    /* move cons.head atomically */
    do {
        /* Restore n as it may change every loop */
        n = max;

        //取出當前head位置
        *old_head = r->cons.head;

        /* add rmb barrier to avoid load/load reorder in weak
         * memory model. It is noop on x86
         */
        rte_smp_rmb();

        //生產者tail減去消費者head為可消費的對象個數。
        //因為head和tail都是無符號32位類型,即使生產者tail比消費者head
        //小,也能正確得出結果,不用擔心溢出。
        const uint32_t prod_tail = r->prod.tail;
        /* The subtraction is done between two unsigned 32bits value
         * (the result is always modulo 32 bits even if we have
         * cons_head > prod_tail). So 'entries' is always between 0
         * and size(ring)-1. */
        *entries = (prod_tail - *old_head);

        //要求出隊對象個數大于實際可消費對象個數
        /* Set the actual entries for dequeue */
        if (n > *entries)
            //此時如果behavior為RTE_RING_QUEUE_FIXED,表示必須滿足n,滿足不了就一個都不出隊,返回0,
            //如果不為RTE_RING_QUEUE_FIXED,則盡可能多的出隊
            n = (behavior == RTE_RING_QUEUE_FIXED) ? 0 : *entries;

        if (unlikely(n == 0))
            return 0;
        
        //當前head加上n即為新的消費者head
        *new_head = *old_head + n;
        if (is_sc)
            //如果單消費者,直接更新head即可,返回1
            r->cons.head = *new_head, success = 1;
        else
            //多消費者,需要借用rte_atomic32_cmpset更新head
            success = rte_atomic32_cmpset(&r->cons.head, *old_head,
                    *new_head);
    } while (unlikely(success == 0));
    return n;
}

ring是否滿或者是否為空

函數rte_ring_full用來判斷ring是否滿
static inline int
rte_ring_full(const struct rte_ring *r)
{
    return rte_ring_free_count(r) == 0;
}

static inline unsigned
rte_ring_free_count(const struct rte_ring *r)
{
    return r->capacity - rte_ring_count(r);
}

函數rte_ring_empty用來判斷ring是否為空

static inline int
rte_ring_empty(const struct rte_ring *r)
{
    return rte_ring_count(r) == 0;
}

判斷ring是否為空或者是否滿都需要調用rte_ring_count獲取當前ring中已使用的個數。

static inline unsigned
rte_ring_count(const struct rte_ring *r)
{
    uint32_t prod_tail = r->prod.tail;
    uint32_t cons_tail = r->cons.tail;
    uint32_t count = (prod_tail - cons_tail) & r->mask;
    return (count > r->capacity) ? r->capacity : count;
}

參考

http://doc.dpdk.org/guides/prog_guide/ring_lib.html
https://www.cnblogs.com/jungle1996/p/12194243.html

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。
  • 序言:七十年代末,一起剝皮案震驚了整個濱河市,隨后出現的幾起案子,更是在濱河造成了極大的恐慌,老刑警劉巖,帶你破解...
    沈念sama閱讀 228,505評論 6 533
  • 序言:濱河連續發生了三起死亡事件,死亡現場離奇詭異,居然都是意外死亡,警方通過查閱死者的電腦和手機,發現死者居然都...
    沈念sama閱讀 98,556評論 3 418
  • 文/潘曉璐 我一進店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人,你說我怎么就攤上這事。” “怎么了?”我有些...
    開封第一講書人閱讀 176,463評論 0 376
  • 文/不壞的土叔 我叫張陵,是天一觀的道長。 經常有香客問我,道長,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 63,009評論 1 312
  • 正文 為了忘掉前任,我火速辦了婚禮,結果婚禮上,老公的妹妹穿的比我還像新娘。我一直安慰自己,他們只是感情好,可當我...
    茶點故事閱讀 71,778評論 6 410
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著,像睡著了一般。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發上,一...
    開封第一講書人閱讀 55,218評論 1 324
  • 那天,我揣著相機與錄音,去河邊找鬼。 笑死,一個胖子當著我的面吹牛,可吹牛的內容都是我干的。 我是一名探鬼主播,決...
    沈念sama閱讀 43,281評論 3 441
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了?” 一聲冷哼從身側響起,我...
    開封第一講書人閱讀 42,436評論 0 288
  • 序言:老撾萬榮一對情侶失蹤,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后,有當地人在樹林里發現了一具尸體,經...
    沈念sama閱讀 48,969評論 1 335
  • 正文 獨居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內容為張勛視角 年9月15日...
    茶點故事閱讀 40,795評論 3 354
  • 正文 我和宋清朗相戀三年,在試婚紗的時候發現自己被綠了。 大學時的朋友給我發了我未婚夫和他白月光在一起吃飯的照片。...
    茶點故事閱讀 42,993評論 1 369
  • 序言:一個原本活蹦亂跳的男人離奇死亡,死狀恐怖,靈堂內的尸體忽然破棺而出,到底是詐尸還是另有隱情,我是刑警寧澤,帶...
    沈念sama閱讀 38,537評論 5 359
  • 正文 年R本政府宣布,位于F島的核電站,受9級特大地震影響,放射性物質發生泄漏。R本人自食惡果不足惜,卻給世界環境...
    茶點故事閱讀 44,229評論 3 347
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧,春花似錦、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 34,659評論 0 26
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至,卻和暖如春,著一層夾襖步出監牢的瞬間,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 35,917評論 1 286
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留,地道東北人。 一個月前我還...
    沈念sama閱讀 51,687評論 3 392
  • 正文 我出身青樓,卻偏偏與公主長得像,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個殘疾皇子,可洞房花燭夜當晚...
    茶點故事閱讀 47,990評論 2 374

推薦閱讀更多精彩內容

  • 在之前分析過dpdk中的相關一些開源實現,然后當時的版本是16.07.2,現在最新的是19.11,代碼方面還是有很...
    fooboo閱讀 679評論 0 0
  • 因為最近在研究高性能方面的技術,突然想起上一份工作從事抗D的項目,在項目中使用到的dpdk組件,其中之一有無鎖相關...
    fooboo閱讀 9,657評論 2 3
  • 1. DPDK技術介紹 1) 簡介 DPDK全稱Intel Data Plane Development Kit,...
    Aubrey_de6c閱讀 71,166評論 0 7
  • 3. 環境抽象層 環境抽象層(EAL)為底層資源如硬件和存儲空間的訪問提供了接口。這些接口為上層應用程序和庫隱藏了...
    半天妖閱讀 4,633評論 0 10
  • 3. 環境抽象層 環境抽象層(Environment Abstraction Layer,下文簡稱EAL)是對操作...
    希爾哥哥s閱讀 4,698評論 0 1