From: Thomas Monjalon Date: Fri, 7 Nov 2014 14:45:34 +0000 (+0100) Subject: kni: fix build X-Git-Tag: spdx-start~10172 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=4ffab9b998c5456906546f49beef629df998718e;p=dpdk.git kni: fix build Since commit 08b563ffb19 ("mbuf: replace data pointer by an offset"), KNI vhost compilation (CONFIG_RTE_KNI_VHOST=y) was broken. rte_pktmbuf_mtod() is not used in the kernel context but is replaced by a simple addition of the base address and the offset. Signed-off-by: Thomas Monjalon Acked-by: Olivier Matz --- diff --git a/lib/librte_eal/linuxapp/kni/kni_vhost.c b/lib/librte_eal/linuxapp/kni/kni_vhost.c index fe512c2607..7bcc985799 100644 --- a/lib/librte_eal/linuxapp/kni/kni_vhost.c +++ b/lib/librte_eal/linuxapp/kni/kni_vhost.c @@ -104,7 +104,8 @@ kni_vhost_net_tx(struct kni_dev *kni, struct iovec *iov, void *data_kva; pkt_kva = (void *)pkt_va - kni->mbuf_va + kni->mbuf_kva; - data_kva = pkt_kva->data - kni->mbuf_va + kni->mbuf_kva; + data_kva = pkt_kva->buf_addr + pkt_kva->data_off + - kni->mbuf_va + kni->mbuf_kva; memcpy_fromiovecend(data_kva, iov, offset, len); if (unlikely(len < ETH_ZLEN)) { @@ -177,7 +178,7 @@ kni_vhost_net_rx(struct kni_dev *kni, struct iovec *iov, KNI_DBG_RX("rx offset=%d, len=%d, pkt_len=%d, iovlen=%d\n", offset, len, pkt_len, (int)iov->iov_len); - data_kva = kva->data - kni->mbuf_va + kni->mbuf_kva; + data_kva = kva->buf_addr + kva->data_off - kni->mbuf_va + kni->mbuf_kva; if (unlikely(memcpy_toiovecend(iov, data_kva, offset, pkt_len))) goto drop;