Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2098214imu; Thu, 17 Jan 2019 08:21:10 -0800 (PST) X-Google-Smtp-Source: ALg8bN5pl0DstNZW5YdZ1h54GELtZDaDbRR+RDvEKnlLqxk4ppsZLEaiJv4AwEr9sLvsWjKSvZe3 X-Received: by 2002:a62:1e45:: with SMTP id e66mr15408517pfe.152.1547742070325; Thu, 17 Jan 2019 08:21:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547742070; cv=none; d=google.com; s=arc-20160816; b=e+YwiV6GHfjHr6DUxzMHYUBxz6wDVuBMADcPnxWyiv07vV5C/hlUvqPtarw+ikSjgQ v97Dp+2AR6fc1yNXQyqTypPa0OS8aTy4T3ggAJAJQTurKaFa5OAcpbDE+Ne3uyY/tMC3 FFXILyVZOHkvh9lz0N6/0TnAXjD782joRfdYnBjKGL9s6NOAK/iT2YhpBpViKuh6bEbn KIwa8N7M/YmAoneNYdAGMa9MXoLx1/LTdjB8Z5suBmzcSX2wZjuoIq98ib/6ynHNC8UM Ynwey8Mc76OCRSDFr7RH9Uz0N9Aaz/kd3C5XNRpTHwkZVjiacj8PzF/bT4eK56ba+bRR RaEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=MbyU6DABQlQUu0Tvo/yIMkfmtsqZt+GuYhN0wrtNSyk=; b=fLmGrTy3uOMIvX2AOWMtFVk7bGPpZJrc6oa/jGu/p8nR/koMWVk2SfkSVei9xpEvll RVDqW9xR2VcgfVZ2S1v8oIMcEEZoXLztII5hvKOMI3+hX/fC65uMyravh7pPUcZ8E+vp HzH4VLIAJGJMbPnISV+wSAI1utB54BuwdfnZSGDm4RSx8n8C0GVj9Z19lhIPIohIMHSx qX8xNIhcVFLDN7mkyIGMdcW6+EKpvebOsufFQI5S8xOY2lclVFSICE9FSQyAG1MvQAVG OSpXR/bxo3490qgS8+9xrzqfbMrxXhz5gP1kV0yZ7PMAZvUGzvALrwWoDdtBdoKlMgeO DhBg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y11si2029797plg.236.2019.01.17.08.20.53; Thu, 17 Jan 2019 08:21:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729074AbfAQQSV (ORCPT + 99 others); Thu, 17 Jan 2019 11:18:21 -0500 Received: from mail-qk1-f194.google.com ([209.85.222.194]:45128 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728675AbfAQQSU (ORCPT ); Thu, 17 Jan 2019 11:18:20 -0500 Received: by mail-qk1-f194.google.com with SMTP id y78so6277874qka.12; Thu, 17 Jan 2019 08:18:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MbyU6DABQlQUu0Tvo/yIMkfmtsqZt+GuYhN0wrtNSyk=; b=kX/nNx+Z+c/FGGgZbKK8vgQ/ricXO8kNZiNHaXSzk7TkR91VBVLGunNDBsNxOrAJ3U fVsDOtKfLIlGAxaS49NX3HfEsM/Gm9y9Ip6oVCl9x4T1d2jMm7Mxl7A3z01FhVdYdNeT bZxDDnFjTOIzOd2BlXfdD7FnoovqCDYgRdkrWGHJzk6eCN71fob97yFQuvZQd/Y4OzZm 8FbjTEpDvXg4CJvrLN2pr/zawxq0vacEAf1ZUSYw89Ft/6YeriFQYTYAUpVCN+02nl7o 4Rhi7zXjP2aIiwDVXrQ8HPWs2jeoX3Buf1vNyYzqAetQQk5+KlDOj0/Fcca7hUSnHcY6 pa6w== X-Gm-Message-State: AJcUukdhJ9ohu64q+DQlwGQWURRSRFCiIZs2qWxgMogaztu4FHR00GkU EcbNZFVGsuD3kJfQcxVISVE9xThtC1lyVLNSz/k= X-Received: by 2002:ae9:d8c2:: with SMTP id u185mr10967732qkf.107.1547741898800; Thu, 17 Jan 2019 08:18:18 -0800 (PST) MIME-Version: 1.0 References: <20190116163253.23780-1-vincent.whitchurch@axis.com> <20190117105441.eqediwlekofp2srg@axis.com> <20190117151906.odvozs6kz3uvx32y@axis.com> <20190117152142.GB20359@infradead.org> <20190117153206.2flxqb26tbdrwp4z@axis.com> <20190117154612.GA6262@infradead.org> In-Reply-To: <20190117154612.GA6262@infradead.org> From: Arnd Bergmann Date: Thu, 17 Jan 2019 17:18:02 +0100 Message-ID: Subject: Re: [PATCH 0/8] Virtio-over-PCIe on non-MIC To: Christoph Hellwig Cc: Vincent Whitchurch , sudeep.dutt@intel.com, ashutosh.dixit@intel.com, gregkh , Linux Kernel Mailing List , Kishon Vijay Abraham I , Lorenzo Pieralisi , linux-pci , linux-ntb@googlegroups.com, Jon Mason , Dave Jiang , Allen Hubbe Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 17, 2019 at 4:46 PM Christoph Hellwig wrote: > > On Thu, Jan 17, 2019 at 04:32:06PM +0100, Vincent Whitchurch wrote: > > If I understand you correctly, I think you're talking about the RC > > running the virtio drivers and the endpoint implementing the virtio > > device? This vop stuff is used for the other way around: the virtio > > device is implement on the RC and the endpoint runs the virtio drivers. > > Oh. That is really weird and not that way I'd implement it.. It does make sense to me for the very special requirements of the MIC device, which has a regular PC-style server that provides the environment for a special embedded device inside of a PCIe card, so the PCI-EP stuff is just used as a transport here going one way, and then the configuration of the devices implemented through it goes the other way, providing network connectivity and file system to the embedded machine on the PCI-EP. This is actually very similar to a setup that I considered implementing over USB, where one might have an embedded machine (or a bunch of them on a USB hub) connected to a USB host port, and then use it in the opposite way of a regular gadget driver, by providing a virtfs over USB to the gadget with files residing on a disk on the USB host. Apparently Vincent has the same use case that both the Intel MIC folks and I had here, so doing it like this is clearly useful. On the other hand, I agree that there are lots of other use cases that need the opposite, so we should try to come up with a design that can cover both. An example of this might be a PCIe-endpoint device providing network connectivity to the host using a vhost-net device, which ideally just shows up as a device on the host as a virtio-net without requiring any configuration. So for configuring this, I think it'd like to see a way to have either the PCI-EP or the PCI-host side be the one that can create virtio devices that show up on the other end. This configuration is currently done using an ioctl interface, which was probably the easiest to do for the MIC case, but for consistency with the PCI-EP framework, using configfs is probably better. A different matter is the question of what a virtio device talks to. A lot of virtio devices are fundamentally asymmetric (9pfs, rng, block, ...), so you'd have to have the virtio device on one side, and a user space or vhost driver on the other. The VOP driver seems to assume that it's always the slave that uses virtio, while the master side (which could be on the PCI EP or PCI host for the sake of this argument) implements it in user space or otherwise. Is this a safe assumption, or can we imagine cases where this would be reversed as well? Arnd