Exemplo n.º 1
0
/* Initialize DPDK link layer.
 *
 * No need to free any memory on shutdown as memory is owned by datapath.
 */
int
dpdk_link_init(void)
{
    DPDK_DEBUG()

    reply_ring = rte_ring_lookup(VSWITCHD_REPLY_RING_NAME);
    if (reply_ring == NULL) {
        rte_exit(EXIT_FAILURE, "Cannot get reply ring - is datapath running?\n");
    }

    message_ring = rte_ring_lookup(VSWITCHD_MESSAGE_RING_NAME);
    if (message_ring == NULL) {
        rte_exit(EXIT_FAILURE, "Cannot get message ring - is datapath running?\n");
    }

    packet_ring = rte_ring_lookup(VSWITCHD_PACKET_RING_NAME);
    if (packet_ring == NULL) {
        rte_exit(EXIT_FAILURE,
                 "Cannot get packet packet ring - is datapath running?\n");
    }

    mp = rte_mempool_lookup(PKTMBUF_POOL_NAME);
    if (mp == NULL) {
        rte_exit(EXIT_FAILURE,
                 "Cannot get mempool for mbufs - is datapath running?\n");
    }

    return 0;
}
Exemplo n.º 2
0
static void
dpif_dpdk_close(struct dpif *dpif_)
{
    dpif_assert_class(dpif_, &dpif_dpdk_class);
    DPDK_DEBUG()

    free(dpif_);
}