DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] kni: fix build
@ 2014-11-07 14:51 Thomas Monjalon
  2014-11-07 15:07 ` Olivier MATZ
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Monjalon @ 2014-11-07 14:51 UTC (permalink / raw)
  To: dev

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 <thomas.monjalon@6wind.com>
---
 lib/librte_eal/linuxapp/kni/kni_vhost.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/librte_eal/linuxapp/kni/kni_vhost.c b/lib/librte_eal/linuxapp/kni/kni_vhost.c
index fe512c2..7bcc985 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;
 
-- 
2.1.3

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] kni: fix build
  2014-11-07 14:51 [dpdk-dev] [PATCH] kni: fix build Thomas Monjalon
@ 2014-11-07 15:07 ` Olivier MATZ
  2014-11-10  9:29   ` Thomas Monjalon
  0 siblings, 1 reply; 3+ messages in thread
From: Olivier MATZ @ 2014-11-07 15:07 UTC (permalink / raw)
  To: Thomas Monjalon, dev

Hi Thomas,

On 11/07/2014 03:51 PM, Thomas Monjalon wrote:
> 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 <thomas.monjalon@6wind.com>

Acked-by: Olivier Matz <olivier.matz@6wind.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH] kni: fix build
  2014-11-07 15:07 ` Olivier MATZ
@ 2014-11-10  9:29   ` Thomas Monjalon
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2014-11-10  9:29 UTC (permalink / raw)
  To: Olivier MATZ; +Cc: dev

> > 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 <thomas.monjalon@6wind.com>
> 
> Acked-by: Olivier Matz <olivier.matz@6wind.com>

Applied
-- 
Thomas

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-11-10  9:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-07 14:51 [dpdk-dev] [PATCH] kni: fix build Thomas Monjalon
2014-11-07 15:07 ` Olivier MATZ
2014-11-10  9:29   ` Thomas Monjalon

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git