예제 #1
0
/*
 * this is used by the mmap code. mmap sees the whole flow table
 * (including the overflow table) as one large table. so, given
 * an offset into that large memory, we should return the correct
 * virtual address
 */
void *
vr_flow_get_va(struct vrouter *router, uint64_t offset)
{
    struct vr_btable *table = router->vr_flow_table;
    unsigned int size = vr_flow_table_size(router);

    if (offset >= vr_flow_table_size(router)) {
        table = router->vr_oflow_table;
        offset -= size;
    }

    return vr_btable_get_address(table, offset);
}
예제 #2
0
void *
vr_htable_get_address(vr_htable_t htable, uint64_t offset)
{
    struct vr_htable *table = (struct vr_htable *)htable;
    unsigned int size = vr_btable_size(table->ht_htable);
    struct vr_btable *btable;

    btable = table->ht_htable;
    if (offset >= size) {
        offset -= size;
        btable = table->ht_otable;
    }

    return vr_btable_get_address(btable, offset);
}