From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 91302C3D4 for ; Fri, 10 Jul 2015 17:35:42 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 10 Jul 2015 08:35:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,447,1432623600"; d="scan'208";a="762010854" Received: from pgsmsx108.gar.corp.intel.com ([10.221.44.103]) by orsmga002.jf.intel.com with ESMTP; 10 Jul 2015 08:35:40 -0700 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by PGSMSX108.gar.corp.intel.com (10.221.44.103) with Microsoft SMTP Server (TLS) id 14.3.224.2; Fri, 10 Jul 2015 23:35:39 +0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.129]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.146]) with mapi id 14.03.0224.002; Fri, 10 Jul 2015 23:35:38 +0800 From: "Zhang, Helin" To: "Xie, Huawei" , "Ouyang, Changchun" , "Liang, Cunming" Thread-Topic: [dpdk-dev] [PATCH v2 4/4] kni: fix missing validation when vhost HDR is enabled Thread-Index: AQHQsF2jZEDrcoHWRkS7ln6cBDEml53U60Dw Date: Fri, 10 Jul 2015 15:35:38 +0000 Message-ID: References: <1435259380-26251-1-git-send-email-miguel.bernal.marin@linux.intel.com> <1435356878-10304-1-git-send-email-miguel.bernal.marin@linux.intel.com> <1435356878-10304-5-git-send-email-miguel.bernal.marin@linux.intel.com> In-Reply-To: <1435356878-10304-5-git-send-email-miguel.bernal.marin@linux.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH v2 4/4] kni: fix missing validation when vhost HDR is enabled 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, 10 Jul 2015 15:35:43 -0000 Could one of you guys help to review the vhost part? Thanks, Helin > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Miguel Bernal Marin > Sent: Friday, June 26, 2015 3:15 PM > To: dev@dpdk.org > Subject: [dpdk-dev] [PATCH v2 4/4] kni: fix missing validation when vhost= HDR is > enabled >=20 > A missing port from memcpy_toiovecend to copy_to_iter is showed when vHos= t > HDR is enabled. DPDK would not build. >=20 > This patch add this validation to build with kernel > 3.19. >=20 > Fixes: 45e63ba8db31 ("kni: fix vhost build with kernels 3.19 and 4.0") > Fixes: ba7438aed924 ("vhost: don't bother copying iovecs in handle_rx(), = kill > memcpy_toiovecend()") >=20 > Signed-off-by: Miguel Bernal Marin > --- > lib/librte_eal/linuxapp/kni/kni_vhost.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) >=20 > diff --git a/lib/librte_eal/linuxapp/kni/kni_vhost.c > b/lib/librte_eal/linuxapp/kni/kni_vhost.c > index f21b47e..013a677 100644 > --- a/lib/librte_eal/linuxapp/kni/kni_vhost.c > +++ b/lib/librte_eal/linuxapp/kni/kni_vhost.c > @@ -427,10 +427,15 @@ kni_sock_rcvmsg(struct socket *sock, >=20 > #ifdef RTE_KNI_VHOST_VNET_HDR_EN > /* no need to copy hdr when no pkt received */ > +#ifdef HAVE_IOV_ITER_MSGHDR > + if (unlikely(copy_to_iter((void *)&vnet_hdr, vnet_hdr_len, > + &m->msg_iter))) > +#else > if (unlikely(memcpy_toiovecend(m->msg_iov, > (void *)&vnet_hdr, 0, vnet_hdr_len))) > +#endif /* HAVE_IOV_ITER_MSGHDR */ > return -EFAULT; > -#endif > +#endif /* RTE_KNI_VHOST_VNET_HDR_EN */ > KNI_DBG_RX("kni_rcvmsg expect_len %ld, flags 0x%08x, pkt_len %d\n", > (unsigned long)len, q->flags, pkt_len); >=20 > -- > 2.4.4