From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com [74.125.82.41]) by dpdk.org (Postfix) with ESMTP id ECA462C4F for ; Mon, 29 Feb 2016 12:39:57 +0100 (CET) Received: by mail-wm0-f41.google.com with SMTP id n186so44852314wmn.1 for ; Mon, 29 Feb 2016 03:39:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=scylladb-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=PkElLMWyPOURNn5wJZdG3k31eoJDmMkQuLTGmgyWL4k=; b=uvniU6i+fnGh+DXzwyohmBc46fFl/3f3UxhBFYaK0v4XSqbp3x7RPfM4Ve51W9optT btvMJzT+ck9WXSlcncHVZwvmrF13lZGWpq4W57bkmbQ9vyBIhXWbZdjLMOXEIK8wFl0e 0C8VPlx+Bm9jtIdrUFpr7iEXTBBoqv19p0P308IE86yK3yD4pWEqQoLzqX06PaVD9Sc8 0s7lSO2IL66lK4BptI7xzZ+VBp2AubyuQqRiMFSB/13yKsktSrt9gfZgUDPrk3Tgfj6U rmi400S97DMUuMz2LZOByCiR+aJsh4f9Z4vAo5T/qUQBdC1Ui21WXP2an/S2+2P2845I EjYg== 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:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=PkElLMWyPOURNn5wJZdG3k31eoJDmMkQuLTGmgyWL4k=; b=VClU9sANnbqn5jfrg7EJhUrjxnIJO9dMiR5wjkrdnjF/UiVvi9CCgtyWL8A8+0gPCq oNjP33seFGndqQSiuTUlZgqzSnexvy5xCaodnNCrvvzBo88H+jzEE06NT/+yKjfqitur qRZwUlhQuqMiqsYrPOEHt7YI+L4bZ//+gt+WIJ++4P7+RQwtx/zd07FqU+/uk4lWByo2 RDXNRFW59H6CUMmSDwp5Wrv6+0BZYSZFR588DNK5PYJdMW0OOK4UgB3gb2OYTOitsV9+ iUgTeEcnKVMMdbFqq6bPHIC4qPlUfpsIQvKKl+y9Yh7OJ2MKd4mtliweOLgFQHsAQXN5 Cyfg== X-Gm-Message-State: AD7BkJLI6DheWItFxIri7cSIT2Ms2JGZ6vylo8RkWjgzrtpLHW5af2Oyr/+fiARr+OarTA== X-Received: by 10.194.174.134 with SMTP id bs6mr6489972wjc.111.1456745997770; Mon, 29 Feb 2016 03:39:57 -0800 (PST) Received: from avi.cloudius-systems.com ([37.142.229.250]) by smtp.googlemail.com with ESMTPSA id ys9sm25456172wjc.35.2016.02.29.03.39.56 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 29 Feb 2016 03:39:56 -0800 (PST) To: Ferruh Yigit , dev@dpdk.org References: <1453911849-16562-1-git-send-email-ferruh.yigit@intel.com> <1453911849-16562-2-git-send-email-ferruh.yigit@intel.com> <56D3137D.1090106@scylladb.com> <56D3559F.2000100@intel.com> <56D412C2.5050806@scylladb.com> <56D420E5.9010802@intel.com> <56D42462.3020905@scylladb.com> <56D42B22.4040906@intel.com> From: Avi Kivity Message-ID: <56D42E0B.6030109@scylladb.com> Date: Mon, 29 Feb 2016 13:39:55 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <56D42B22.4040906@intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH 1/3] kcp: add kernel control path kernel module 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, 29 Feb 2016 11:39:58 -0000 On 02/29/2016 01:27 PM, Ferruh Yigit wrote: > On 2/29/2016 10:58 AM, Avi Kivity wrote: >> >> On 02/29/2016 12:43 PM, Ferruh Yigit wrote: >>> On 2/29/2016 9:43 AM, Avi Kivity wrote: >>>> On 02/28/2016 10:16 PM, Ferruh Yigit wrote: >>>>> On 2/28/2016 3:34 PM, Avi Kivity wrote: >>>>>> On 01/27/2016 06:24 PM, Ferruh Yigit wrote: >>>>>>> This kernel module is based on KNI module, but this one is stripped >>>>>>> version of it and only for control messages, no data transfer >>>>>>> functionality provided. >>>>>>> >>>>>>> This Linux kernel module helps userspace application create virtual >>>>>>> interfaces and when a control command issued into that virtual >>>>>>> interface, module pushes the command to the userspace and gets the >>>>>>> response back for the caller application. >>>>>>> >>>>>>> The Linux tools like ethtool/ifconfig/ip can be used on virtual >>>>>>> interfaces but not ones for related data, like tcpdump. >>>>>>> >>>>>>> In long term this patch intends to replace the KNI and KNI will be >>>>>>> depreciated. >>>>>> Instead of adding yet another out-of-tree kernel module, why not >>>>>> extend >>>>>> the existing in-tree tap driver? This will make everyone's life >>>>>> easier. >>>>>> >>>>>> Since tap also supports data transfer, an application can also forward >>>>>> packets not intended to it to the kernel, and forward packets from the >>>>>> kernel through the device. >>>>>> >>>>> Hi Avi, >>>>> >>>>> KDP (Kernel Data Path) does what you have described, it is implemented >>>>> as PMD and it benefits from tap driver to data transfer through the >>>>> kernel. It also support custom kernel module for better performance. >>>>> >>>>> For KCP (Kernel Control Path), network driver forwards control commands >>>>> to the userspace driver, I doubt this is something wanted for tun/tap >>>>> driver, so extending tun/tap driver like this can be hard to upstream. >>>> Have you tried asking? Maybe if you explain it they will be open to the >>>> extension. >>>> >>> Not communicated but tun/tap already doing something different. >>> For KCP, created interface is map of the DPDK port. All data interface >>> shows coming from DPDK port. For example if you get stats information >>> with ifconfig, the values you observe are DPDK port statistics -not >>> statistics of data between userspace and kernelspace, statistics of data >>> forwarded between DPDK ports. If you down the interface, DPDK port >>> stopped, etc... >>> >>> If you extend the tun/tap, it won't be map of the DPDK port, and if you >>> get statistics information from that interface, what do you expect to >>> see, the data transferred between kernel and userspace, or underlying >>> DPDK port forwarding statistics? >> Good point. But you really have to involve netdev on this, or you'll >> live out-of-tree forever. >> > Why do we need to touch netdev? By netdev, I meant the mailing list. If you don't touch it, your driver will remain out-of-tree forever. > A simple network driver, similar to kcp, can be solution. > > This driver implements all net_device_ops and ethtool_ops in a way to > forward everything to the userspace via netlink. All needs to know about > userspace driver is it's unique id. Any userspace application, not only > DPDK drivers, can listen the netlink messages and response to the > requests come to itself. > > This kind of driver is not big or complicated, kcp already does %90 of > what described above. I am not arguing against kcp. It fulfills an important need. This is my argument: 1. having multiple interfaces for the control and data path is bad for the user 2. therefore, we need to either add tap functionality to kcp, or add kcp functionality to tap 3. netdev@ is more likely (IMO) to accept additional functionality to tap than a new driver, but the only way to know is to engage with them > >>> Extending tun/tap in a way we want, forwarding all control commands to >>> userspace, will break the current tun/tap, this doesn't looks like a >>> valid option to me. >> It's possible to enhance it while preserving backwards compatibility, by >> enabling a feature flag (statistics from userspace). >> >>> For data path, using tun/tap is OK and we are already doing it, for the >>> control path I believe we need a new driver. >>> >>>> Certainly it will be better to have KCP and KDP use the same kernel >>>> interface name; so we'll need to either add data path support to kcp >>>> (causing duplication with tap), or add control path support to tap. I >>>> think the latter is preferable. >>>> >>> Why it is better to have same interface? Anyone who is not interested >>> with kernel data path may want to control DPDK ports using common tools, >>> or want to get some basic information and stats using ethtool or >>> ifconfig. Why we need to bind two different functionality together? >> Having two interfaces will be confusing for the user. If I wish to >> firewall data packets coming from the dpdk port, do I set firewall rules >> on dpdk0 or tap0? >> > Agreed that it is confusing to have two interfaces. > > I think if user wants to use both data and control paths, a way can be > found to end up with single interface, using module params or something > else. Two different drivers for data and control not conflict with each > other and can cooperate. Module parameters are for module-wide options. A single module can support multiple interfaces, so module parameters don't apply. Let's make it simple for the users, even if it is more complex for us (and by us, I mean you, unfortunately). > But to work on this first both KCP and KDP should go in. Go in where? It doesn't help if it goes into dpdk.git and then netdev@ rejects it. > >> I don't think it matters whether you extend tap, or add a data path to >> kcp, but if you want to upstream it, it needs to be blessed by netdev. >> > I still think not good idea to merge these two, because they may be used > independently, but we can improve how they work together. > From a developer's perspective, maybe so, but from a user's perspective, there should be exactly one interface for the functionality exposed by kcp and kdp.