From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 9A5C9532D for ; Sun, 25 Oct 2015 16:40:47 +0100 (CET) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga103.fm.intel.com with ESMTP; 25 Oct 2015 08:40:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,196,1444719600"; d="scan'208";a="835081744" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga002.fm.intel.com with ESMTP; 25 Oct 2015 08:40:46 -0700 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 25 Oct 2015 08:40:46 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX114.amr.corp.intel.com (10.18.116.8) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 25 Oct 2015 08:40:46 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.96]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.47]) with mapi id 14.03.0248.002; Sun, 25 Oct 2015 23:40:44 +0800 From: "Xie, Huawei" To: "Tan, Jianfeng" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v4 4/7] virtio: fill RX avail ring with blank mbufs Thread-Index: AdEPO4JDnGextSPYRTSDm5o/GfKmlA== Date: Sun, 25 Oct 2015 15:40:43 +0000 Message-ID: References: <1443537953-23917-1-git-send-email-huawei.xie@intel.com> <1445515791-25909-1-git-send-email-huawei.xie@intel.com> <1445515791-25909-5-git-send-email-huawei.xie@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 Subject: Re: [dpdk-dev] [PATCH v4 4/7] virtio: fill RX avail ring with blank mbufs 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: Sun, 25 Oct 2015 15:40:48 -0000 On 10/23/2015 1:56 PM, Tan, Jianfeng wrote:=0A= > On 10/23/2015 1:51 PM, Jianfeng wrote:=0A= >=0A= >> -----Original Message-----=0A= >> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Huawei Xie=0A= >> Sent: Thursday, October 22, 2015 8:10 PM=0A= >> To: dev@dpdk.org=0A= >> Subject: [dpdk-dev] [PATCH v4 4/7] virtio: fill RX avail ring with blank= mbufs=0A= >> +int __attribute__((cold))=0A= >> +virtqueue_enqueue_recv_refill_simple(struct virtqueue *vq,=0A= >> + struct rte_mbuf *cookie)=0A= >> +{=0A= >> + struct vq_desc_extra *dxp;=0A= >> + struct vring_desc *start_dp;=0A= >> + uint16_t desc_idx;=0A= >> +=0A= >> + desc_idx =3D vq->vq_avail_idx & (vq->vq_nentries - 1);=0A= >> + dxp =3D &vq->vq_descx[desc_idx];=0A= >> + dxp->cookie =3D (void *)cookie;=0A= >> + vq->sw_ring[desc_idx] =3D cookie;=0A= >> +=0A= >> + start_dp =3D vq->vq_ring.desc;=0A= >> + start_dp[desc_idx].addr =3D (uint64_t)((uintptr_t)cookie-=0A= >>> buf_physaddr +=0A= >> + RTE_PKTMBUF_HEADROOM - sizeof(struct virtio_net_hdr));=0A= > Please use RTE_MBUF_DATA_DMA_ADDR instead of "buf_physaddr + RTE_PKTMBUF_= HEADROOM".=0A= RTE_MBUF_DATA_DMA_ADDR is used for tx. For rx, we should use=0A= RTE_MBUF_DATA_DMA_DEFAULT. =0A= We could use a separate patch to fix all this in virito code.=0A= I remember there is a patch to move=0A= RTE_MBUF_DATA_DMA_ADDR/RTE_MBUF_DATA_DMA_DEFAULT definition into the=0A= common header file.=0A= >=0A= >> + start_dp[desc_idx].len =3D cookie->buf_len -=0A= >> + RTE_PKTMBUF_HEADROOM + sizeof(struct virtio_net_hdr);=0A= >> +=0A= >> + vq->vq_free_cnt--;=0A= >> + vq->vq_avail_idx++;=0A= >> +=0A= >> + return 0;=0A= >> +}=0A= >> --=0A= >> 1.8.1.4=0A= >=0A= =0A=