From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f51.google.com (mail-wg0-f51.google.com [74.125.82.51]) by dpdk.org (Postfix) with ESMTP id 3F1067F4D for ; Fri, 7 Nov 2014 15:43:27 +0100 (CET) Received: by mail-wg0-f51.google.com with SMTP id l18so3889942wgh.38 for ; Fri, 07 Nov 2014 06:52:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=TLo8HXdpWTVbWgA516CShNh3TboRvI63fgeLLDh/MXQ=; b=CrYW8VjClKAbPSvWcXJcBrpwHyNBE5Sgid/Xm7CJOmOWUVza8g9U5qrk+vRAuyNYwW fs79V+vA9ktsl+4o48CULmKVQTsvH/bRiN9GWmUzMDDJSS+PB0jVi0T/3N0WnXutAX/P 1RFm0Sq7onoDQ2ukpohSpoEF7pnywPqEiEazsExN3UtQ11hgAt7kZ/ufKHq6l5flHCmi BJzXGZKNv7vRBYKjLhif59J1cgONpsO3+CcO8zMdmhANY5RqQz3miWPMy6a0t6N6kLtI lQaBbXOinYbhyI1xVvJjvhlwrGbiSPThKYvf5IzGKapG4KyVFAZf7IvXOMMmDQRXiDX8 cCYA== X-Gm-Message-State: ALoCoQlZw8kwkxA2qihYxeSghKJZCA/QVvSiu02+DoxQXNh0/Lf6DZhJdki2zj1QutNYyPZamqXo X-Received: by 10.194.76.202 with SMTP id m10mr17208102wjw.42.1415371979469; Fri, 07 Nov 2014 06:52:59 -0800 (PST) Received: from localhost.localdomain (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by mx.google.com with ESMTPSA id 10sm12072606wjs.21.2014.11.07.06.52.57 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 07 Nov 2014 06:52:58 -0800 (PST) From: Thomas Monjalon To: dev@dpdk.org Date: Fri, 7 Nov 2014 15:51:07 +0100 Message-Id: <1415371867-3730-1-git-send-email-thomas.monjalon@6wind.com> X-Mailer: git-send-email 2.1.3 Subject: [dpdk-dev] [PATCH] kni: fix build X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Nov 2014 14:43:27 -0000 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 --- 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