X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=lib%2Flibrte_kni%2Frte_kni.c;h=4b45d1a014488672e687102e5fe1fb912f44d3ca;hb=6e7cbd63706f3435b9d9a2057a37db1da01db9a7;hp=8c483c1f41bacf6cd9a71a619fecd10898e18c7a;hpb=f239aed5e674965691846e8ce3f187dd47523689;p=deb_dpdk.git diff --git a/lib/librte_kni/rte_kni.c b/lib/librte_kni/rte_kni.c index 8c483c1f..4b45d1a0 100644 --- a/lib/librte_kni/rte_kni.c +++ b/lib/librte_kni/rte_kni.c @@ -340,7 +340,7 @@ rte_kni_alloc(struct rte_mempool *pktmbuf_pool, /* Get an available slot from the pool */ slot = kni_memzone_pool_alloc(); if (!slot) { - RTE_LOG(ERR, KNI, "Cannot allocate more KNI interfaces; increase the number of max_kni_ifaces(current %d) or release unusued ones.\n", + RTE_LOG(ERR, KNI, "Cannot allocate more KNI interfaces; increase the number of max_kni_ifaces(current %d) or release unused ones.\n", kni_memzone_pool.max_ifaces); return NULL; } @@ -456,7 +456,7 @@ va2pa(struct rte_mbuf *m) { return (void *)((unsigned long)m - ((unsigned long)m->buf_addr - - (unsigned long)m->buf_physaddr)); + (unsigned long)m->buf_iova)); } static void @@ -659,7 +659,7 @@ kni_allocate_mbufs(struct rte_kni *kni) phys[i] = va2pa(pkts[i]); } - /* No pkt mbuf alocated */ + /* No pkt mbuf allocated */ if (i <= 0) return; @@ -681,6 +681,9 @@ rte_kni_get(const char *name) struct rte_kni_memzone_slot *it; struct rte_kni *kni; + if (name == NULL || name[0] == '\0') + return NULL; + /* Note: could be improved perf-wise if necessary */ for (i = 0; i < kni_memzone_pool.max_ifaces; i++) { it = &kni_memzone_pool.slots[i];