From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f46.google.com (mail-wg0-f46.google.com [74.125.82.46]) by dpdk.org (Postfix) with ESMTP id 03201C410 for ; Mon, 27 Apr 2015 18:26:43 +0200 (CEST) Received: by wgin8 with SMTP id n8so121879194wgi.0 for ; Mon, 27 Apr 2015 09:26:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=ioCtfynpuLS4N9EbBIIgk1OIaGP10kcT3sIJQZKZuL0=; b=hQ/sJPwmmySiPyEvmKdR00GxzmTX9bT6OFaCqu5IoVw3i+BjgDcUCZAaVepZiVTBwT Uf2QQvOtuEVZALS1McFBeWaXE33SHU7lxYke5MSr4zuLxbHpz79xaRKTqjPVYe80/CYd EE0ORYKydixImIUgcfn2tU9+4dZQhUdXCWSrNHaDoCKedvohgFzNKQ7OrUb2GEdykrqj ksJMqgAEiG1LGqzkQIc+2MkNxyB8xAS90Cq0x/NOn9iHzrfsoVfrGjWPBhFZVw1lybG5 DMJzqlt9ym6mVayoOLp2ILV/UMB8Vp0jrlOKWt6fJ6j16jDqbFZwY0cpRho+pi8+2mk8 5bLA== X-Gm-Message-State: ALoCoQkSrm6dEYhpcQWxuZh9rjZLitlBDLlT4p7E1E9miOwuNosHJ0+YStCKXv3NoD+B3d/Vj8KA X-Received: by 10.180.9.5 with SMTP id v5mr21772430wia.93.1430152002808; Mon, 27 Apr 2015 09:26:42 -0700 (PDT) Received: from [192.168.0.101] ([90.152.119.35]) by mx.google.com with ESMTPSA id xb3sm25618863wjc.38.2015.04.27.09.26.41 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Apr 2015 09:26:42 -0700 (PDT) Message-ID: <553E6344.6030104@linaro.org> Date: Mon, 27 Apr 2015 17:26:44 +0100 From: Zoltan Kiss User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Nikita Kalyazin , dev@dpdk.org References: <20150427115422.GI28809@kalyazin.rnd.samsung.ru> In-Reply-To: <20150427115422.GI28809@kalyazin.rnd.samsung.ru> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] data copy in vhost-user 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: Mon, 27 Apr 2015 16:26:43 -0000 On 27/04/15 12:54, Nikita Kalyazin wrote: > Hi, > > > As far as I understand, DPDK vhost-user implementation requires data copy for either RX or TX (rte_vhost_dequeue_burst() and rte_vhost_enqueue_burst()). It means that two data copies are needed to transfer a packet from one VM to another. > > Why is not it possible to eliminate one of the copies (e.g., rte_vhost_enqueue_burst() might set up a reference at vring descriptor to mbuf's data rather than copying the data)? I'm just guessing, but in case of VM-to-VM traffic the receiving one could hold onto the buffer indefinitely, preventing the sender to reuse the buffer. That could lead to a DoS in some cases, and shutting down the sender would be also tricky. At least in case of Xen netback/netfront that's the reason. A reasonable solution for this problem is to make sure the buffer is swapped out with a copy after a finite time. Regards, Zoltan