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 8684E8E8C for ; Fri, 23 Oct 2015 07:57:01 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP; 22 Oct 2015 22:57:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,185,1444719600"; d="scan'208";a="586463949" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by FMSMGA003.fm.intel.com with ESMTP; 22 Oct 2015 22:56:58 -0700 Received: from fmsmsx101.amr.corp.intel.com (10.18.124.199) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 22 Oct 2015 22:56:58 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx101.amr.corp.intel.com (10.18.124.199) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 22 Oct 2015 22:56:58 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.204]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.47]) with mapi id 14.03.0248.002; Fri, 23 Oct 2015 13:56:56 +0800 From: "Tan, Jianfeng" To: "Xie, Huawei" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v4 4/7] virtio: fill RX avail ring with blank mbufs Thread-Index: AQHRDMLGY0oL8hgp8kCq1aqFSYcoK554lDTQ Date: Fri, 23 Oct 2015 05:56:56 +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> In-Reply-To: <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: Fri, 23 Oct 2015 05:57:01 -0000 On 10/23/2015 1:51 PM, Jianfeng wrote: > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Huawei Xie > Sent: Thursday, October 22, 2015 8:10 PM > To: dev@dpdk.org > Subject: [dpdk-dev] [PATCH v4 4/7] virtio: fill RX avail ring with blank = mbufs > +int __attribute__((cold)) > +virtqueue_enqueue_recv_refill_simple(struct virtqueue *vq, > + struct rte_mbuf *cookie) > +{ > + struct vq_desc_extra *dxp; > + struct vring_desc *start_dp; > + uint16_t desc_idx; > + > + desc_idx =3D vq->vq_avail_idx & (vq->vq_nentries - 1); > + dxp =3D &vq->vq_descx[desc_idx]; > + dxp->cookie =3D (void *)cookie; > + vq->sw_ring[desc_idx] =3D cookie; > + > + start_dp =3D vq->vq_ring.desc; > + start_dp[desc_idx].addr =3D (uint64_t)((uintptr_t)cookie- > >buf_physaddr + > + RTE_PKTMBUF_HEADROOM - sizeof(struct virtio_net_hdr)); Please use RTE_MBUF_DATA_DMA_ADDR instead of "buf_physaddr + RTE_PKTMBUF_HE= ADROOM". > + start_dp[desc_idx].len =3D cookie->buf_len - > + RTE_PKTMBUF_HEADROOM + sizeof(struct virtio_net_hdr); > + > + vq->vq_free_cnt--; > + vq->vq_avail_idx++; > + > + return 0; > +} > -- > 1.8.1.4