From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f45.google.com (mail-pa0-f45.google.com [209.85.220.45]) by dpdk.org (Postfix) with ESMTP id ED42758D8 for ; Tue, 24 Nov 2015 05:41:45 +0100 (CET) Received: by pacej9 with SMTP id ej9so8458625pac.2 for ; Mon, 23 Nov 2015 20:41:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=igel-co-jp.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=Ld863jUgemxBJEMd7WXFtH3jB8gr1yPn4BdcO+7u71Y=; b=MFFQejXAYTmyJoQ5qRO+HQniBKzBXaM8xKBLYBwtbID6i7iqFtIpWdnNKH3EqyjE37 oHHD/XN531Y/G8IR/DkpWAyZv73BLrakONJYyCbtKlaqlFPtv6eAjuSh0/4iQrAlZGgG d6SxDOU8FzayXVVx++DWE73ciXrurWwR6hWomyveN+bHwjQUc+wyx5mW2NZrfAyGT4W+ W35KKR7jDID8V52q7Gzlm5IqEaWAjtPYMFuB9lBHv21rSxdRLbvF+A4iU5RY3qsEQowA NOI9qhPCYj4jGfF0jaZqfm7WggbYJltpEKUw5MKZ2WrOyT9F/HfDSFPCv1OvhBkOgLuK geGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=Ld863jUgemxBJEMd7WXFtH3jB8gr1yPn4BdcO+7u71Y=; b=DIaM85H6yRCsCIDu/lA7AnVEXAGRy7oyxDlm26kmtT5WcEDmySC3pXq1PVO+9N1DGD TcA3WzBvtNu417lhOsJDuMZH5e9qtxuH1QS35dbg6rBFQuu2ssIlXR6lNz+Y41h92f4W ChYUV8tAMc77LNr/tFFQMiBCsK4hM2nnk10L74sP3ch18UfC8K8xXJQfsJAONzrIaQYg 9eytzaBYbd8iXgdmg2q1HJ5YmcUMttyf/mj4Lm2A/fn91iqdXA8k6vvzw+E3Zv/kthXB WWxdJzmQT9Hkflcw6ksgFdDo4Hds7OtQa6eehMPHDzKjM6rdP52vSSsznFpzSO8KZOcF r4Qw== X-Gm-Message-State: ALoCoQnXQmHSr8vpVdEQj39U8D3nBALlPyBULg7Uk1zuufSX1yam4v0MxhLa4JDBnGO6yMzIUotK X-Received: by 10.66.124.135 with SMTP id mi7mr40386969pab.102.1448340105358; Mon, 23 Nov 2015 20:41:45 -0800 (PST) Received: from [10.16.129.101] (napt.igel.co.jp. [219.106.231.132]) by smtp.googlemail.com with ESMTPSA id qz2sm6356738pab.14.2015.11.23.20.41.42 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 23 Nov 2015 20:41:44 -0800 (PST) To: Rich Lane References: <1447046221-20811-3-git-send-email-mukawa@igel.co.jp> <1447392031-24970-1-git-send-email-mukawa@igel.co.jp> <1447392031-24970-3-git-send-email-mukawa@igel.co.jp> From: Tetsuya Mukawa X-Enigmail-Draft-Status: N1110 Message-ID: <5653EA86.70106@igel.co.jp> Date: Tue, 24 Nov 2015 13:41:42 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: yuanhan.liu@intel.com, dev@dpdk.org, ann.zhuangyanying@huawei.com Subject: Re: [dpdk-dev] [PATCH v4 2/2] vhost: Add VHOST PMD 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: Tue, 24 Nov 2015 04:41:46 -0000 On 2015/11/21 9:15, Rich Lane wrote: > On Thu, Nov 12, 2015 at 9:20 PM, Tetsuya Mukawa wrote: > >> +static uint16_t >> +eth_vhost_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs) >> +{ >> > ... > >> + >> + /* Enqueue packets to guest RX queue */ >> + nb_tx = rte_vhost_enqueue_burst(r->device, >> + r->virtqueue_id, bufs, nb_bufs); >> + >> + r->tx_pkts += nb_tx; >> + r->err_pkts += nb_bufs - nb_tx; >> > I don't think a full TX queue is counted as an error by physical NIC PMDs > like ixgbe and i40e. It is counted as an error by the af_packet, pcap, and > ring PMDs. I'd suggest not counting it as an error because it's a common > and expected condition, and the application might just retry the TX later. Hi Rich, Thanks for commenting. I will count it as "imissed". > Are the byte counts left out because it would be a performance hit? It > seems like it would be a minimal cost given how much we're already touching > each packet. I just ignore it for performance. But you are correct, I will add it. > >> +static int >> +new_device(struct virtio_net *dev) >> +{ >> > ... > >> + >> + if ((dev->virt_qp_nb < internal->nb_rx_queues) || >> + (dev->virt_qp_nb < internal->nb_tx_queues)) { >> + RTE_LOG(INFO, PMD, "Not enough queues\n"); >> + return -1; >> + } >> > Would it make sense to take the minimum of the guest and host queuepairs > and use that below in place of nb_rx_queues/nb_tx_queues? That way the host > can support a large maximum number of queues and each guest can choose how > many it wants to use. The host application will receive vring_state_changed > callbacks for each queue the guest activates. > Thanks for checking this. I agree with you. After reading your comment, here is my guess for this PMD behavior. This PMD should assume that virtio-net device(QEMU) has same or more queues than specified in vhost PMD option. In a case that the assumption is break, application should handle vring_state_change callback correctly. (Then stop accessing to disabled queues not to spend CPU power.) Anyway, I will just remove above if-condition, because of above PMD assumption. Thanks, Tetsuya