From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 737735690 for ; Fri, 27 May 2016 11:05:56 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP; 27 May 2016 02:05:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,373,1459839600"; d="scan'208";a="963464132" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.67.162]) by orsmga001.jf.intel.com with ESMTP; 27 May 2016 02:05:54 -0700 Date: Fri, 27 May 2016 17:07:56 +0800 From: Yuanhan Liu To: Huawei Xie Cc: dev@dpdk.org Message-ID: <20160527090756.GC5641@yliu-dev.sh.intel.com> References: <1462323027-91942-1-git-send-email-huawei.xie@intel.com> <1464097112-47411-1-git-send-email-huawei.xie@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1464097112-47411-1-git-send-email-huawei.xie@intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH] virtio: split virtio rx/tx queue 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, 27 May 2016 09:05:56 -0000 On Tue, May 24, 2016 at 09:38:32PM +0800, Huawei Xie wrote: > vq->vq_ring_mem = mz->phys_addr; > vq->vq_ring_virt_mem = mz->addr; > - PMD_INIT_LOG(DEBUG, "vq->vq_ring_mem: 0x%"PRIx64, (uint64_t)mz->phys_addr); > - PMD_INIT_LOG(DEBUG, "vq->vq_ring_virt_mem: 0x%"PRIx64, (uint64_t)(uintptr_t)mz->addr); > - vq->virtio_net_hdr_mz = NULL; > - vq->virtio_net_hdr_mem = 0; > + PMD_INIT_LOG(DEBUG, "vq->vq_ring_mem: 0x%"PRIx64, > + (uint64_t)mz->phys_addr); > + PMD_INIT_LOG(DEBUG, "vq->vq_ring_virt_mem: 0x%"PRIx64, > + (uint64_t)(uintptr_t)mz->addr); > + > + hdr_mz = rte_memzone_reserve_aligned(vq_hdr_name, sz_hdr_mz, socket_id, > + 0, RTE_CACHE_LINE_SIZE); We don't need allocate hdr_mz for Rx queue, and in such case, sz_hdr_mz is 0. I'm wondering what hdr_mz would be then, NULL? Anyway, you should skip the hdr_mz allocation for Rx queue, and I also would suggest you to move the vq_hdr_name setup here. > + if (hdr_mz == NULL) { > + if (rte_errno == EEXIST) > + hdr_mz = rte_memzone_lookup(vq_hdr_name); > + if (hdr_mz == NULL) { > + ret = -ENOMEM; > + goto fail_q_alloc; > + } > + } > ... > > PMD_INIT_FUNC_TRACE(); > ret = virtio_dev_queue_setup(dev, VTNET_CQ, VTNET_SQ_CQ_QUEUE_IDX, > - vtpci_queue_idx, 0, socket_id, &vq); > + vtpci_queue_idx, 0, socket_id, (void **)&cvq); Unnecessary cast. Note that there are few others like that in this patch. > - PMD_RX_LOG(DEBUG, "dequeue:%d", num); > - PMD_RX_LOG(DEBUG, "packet len:%d", len[0]); > + PMD_RX_LOG(DEBUG, "dequeue:%d\n", num); > + PMD_RX_LOG(DEBUG, "packet len:%d\n", len[0]); We should not append "\n" for PMD_RX_LOG; this macro alreadys does it. Another note is that you might want to run checkpatch; I saw quite many warnings. --yliu