X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=lib%2Flibrte_kni%2Frte_kni.c;h=a0daa2358a96ac768386682251fe4585048ad350;hb=57f0ba5f8b8588dfa6ffcd001447ef6337afa6cd;hp=8e8741fdd25cda5db9b4198b3008ba878c520d96;hpb=fbf895d44cfebf7bd92bb4edf3f7ff15365e57a5;p=dpdk.git diff --git a/lib/librte_kni/rte_kni.c b/lib/librte_kni/rte_kni.c index 8e8741fdd2..a0daa2358a 100644 --- a/lib/librte_kni/rte_kni.c +++ b/lib/librte_kni/rte_kni.c @@ -1,7 +1,7 @@ /*- * BSD LICENSE * - * Copyright(c) 2010-2013 Intel Corporation. All rights reserved. + * Copyright(c) 2010-2014 Intel Corporation. All rights reserved. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -179,6 +179,8 @@ rte_kni_alloc(struct rte_mempool *pktmbuf_pool, dev_info.function = conf->addr.function; dev_info.vendor_id = conf->id.vendor_id; dev_info.device_id = conf->id.device_id; + dev_info.core_id = conf->core_id; + dev_info.force_bind = conf->force_bind; dev_info.group_id = conf->group_id; dev_info.mbuf_size = conf->mbuf_size; @@ -246,7 +248,8 @@ rte_kni_alloc(struct rte_mempool *pktmbuf_pool, dev_info.sync_phys = mz->phys_addr; /* MBUF mempool */ - rte_snprintf(mz_name, sizeof(mz_name), "MP_%s", pktmbuf_pool->name); + rte_snprintf(mz_name, sizeof(mz_name), RTE_MEMPOOL_OBJ_NAME, + pktmbuf_pool->name); mz = rte_memzone_lookup(mz_name); KNI_MZ_CHECK(mz == NULL); dev_info.mbuf_va = mz->addr; @@ -520,3 +523,12 @@ rte_kni_unregister_handlers(struct rte_kni *kni) kni->ops.config_network_if = NULL; return 0; } +void +rte_kni_close(void) +{ + if (kni_fd < 0) + return; + + close(kni_fd); + kni_fd = -1; +}