From patchwork Sun Apr 1 09:13:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Si-Wei Liu X-Patchwork-Id: 893970 Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=oracle.com header.i=@oracle.com header.b="LBVujMpQ"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 40DVXs6vrRz9s15 for ; Sun, 1 Apr 2018 19:33:49 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753287AbeDAJdf (ORCPT ); Sun, 1 Apr 2018 05:33:35 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:33290 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753221AbeDAJdd (ORCPT ); Sun, 1 Apr 2018 05:33:33 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w319IB9Z027956; Sun, 1 Apr 2018 09:33:22 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : subject : date : message-id; s=corp-2017-10-26; bh=5vPP08zNUyZdLMkQwGpVUdxEMlfqcx/2RbAyV0q0KjA=; b=LBVujMpQKTk21VOMal2CUtJ+NSnfFYUooWHHHYT4cgzINGnew2LHQ/h/Kkl2PuhWpIJf FDIIM7vDiZAEsFPWcawbr8VI1kx0jYOG5TTxWoIFuHYslpiVvl58mPJYahPRF/V8tC60 uDvwHMbivBt9x7YAQp3T0ZHAa+0ymUhI0dxENk7i2UzJQhPBN2Zca/c5d7NIXEXGGwnv Pcsg0XhuUS+2YI8Eun9ZQKeHotA9Xkknn776XuT06487ytaZT3DqnMXUMzLGUWM2RyF5 pmCZSvHQ1LuiXdLyuHRDaVKowkoiGBIFP2RzRIgDp35dcFC/v/Eh7lo7Wk7vB57axjBE iA== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2120.oracle.com with ESMTP id 2h2vp100uq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 01 Apr 2018 09:33:22 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w319XLPG008821 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 1 Apr 2018 09:33:21 GMT Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w319XJKj016897; Sun, 1 Apr 2018 09:33:19 GMT Received: from ban25x6uut24.us.oracle.com (/10.153.73.24) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 01 Apr 2018 02:33:19 -0700 From: Si-Wei Liu To: mst@redhat.com, jiri@resnulli.us, stephen@networkplumber.org, alexander.h.duyck@intel.com, davem@davemloft.net, jesse.brandeburg@intel.com, kubakici@wp.pl, jasowang@redhat.com, sridhar.samudrala@intel.com, netdev@vger.kernel.org, virtualization@lists.linux-foundation.org, virtio-dev@lists.oasis-open.org Subject: [RFC PATCH 0/3] Userspace compatible driver model for virtio_bypass Date: Sun, 1 Apr 2018 05:13:07 -0400 Message-Id: <1522573990-5242-1-git-send-email-si-wei.liu@oracle.com> X-Mailer: git-send-email 1.8.3.1 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8849 signatures=668697 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=661 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1804010099 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This RFC patch series attempts to hide the lower netdevs for virtio_bypass from userspace visibility, and tighten up the association between virtio_bypass and the lower passthrough netdev to be enslaved by binding to a specific device identifier explicitly. This in turn has the benefits of taking the merit of the 2-netdev driver model from netvsc (userspace compliance) to a perfect sense, while keeping the internal implementation still a 3-netdev model. There's no loss of feature such as XDP, and continously adding improvements for performance and features thanks to the good bypass nature of the 3-netdev model are also possible in the long run. As said, this change should make the code sharing between netvsc and virtio_bypass easier and more approachable, as I think the concerns Stephen pointed out was mainly regarding userspace compatibility and not the hardware offloading tunables on the VF slave that had to be exposed to netvsc users today, if I'm not mistaken. Jiri expressed concerns around the weak check depending on MAC address only during enslavement and we really need to do strict checks more than that. With the change to requiring user explicitly specifying the passthrough device to which virtio_bypass is expected to be bound, virtio_bypass now would match device based on the PCI slot info in device tree, rather than rely on MAC address inadvertently. In addition, the PCI slot info passed in will be helpful to accommodate udevd to name the virtio_bypass interface specifically, making a transparent and automatic upgrade from existing VF setup to virtio_bypass possible (expect udevd patch to come later on). Since I'd like to get the discussion going as early as possible, this series just shows essential changes to a minimal set. Although not included in the series, I would like to remind ahead that a few neccessary pieces must be built upon the assumption of hidden lower netdevs and explicit binding. Such as sysfs interfaces for udev's naming of virtio_bypass interace. Such as passing down HW offloading configs to the active lower slave, and making it persistent across live migration. And so on.. The current patch series is based on Sridhar's v4 patch "Enable virtio to act as a backup for a passthru device", but I can resync anyway to his upcoming version once posted. Si-Wei Liu (1): qemu: virtio-bypass should explicitly bind to a passthrough device hw/net/virtio-net.c | 29 ++++++++++++- include/hw/pci/pci.h | 3 ++ include/hw/virtio/virtio-net.h | 2 + include/standard-headers/linux/virtio_net.h | 1 + qdev-monitor.c | 64 +++++++++++++++++++++++++++++ 5 files changed, 97 insertions(+), 2 deletions(-) Si-Wei Liu (2): netdev: kernel-only IFF_HIDDEN netdevice virtio_net: make lower netdevs for virtio_bypass hidden drivers/net/virtio_net.c | 159 +++++++++++++++++++++-- include/linux/netdevice.h | 12 ++ include/net/net_namespace.h | 2 + include/uapi/linux/virtio_net.h | 2 + net/core/dev.c | 281 +++++++++++++++++++++++++++++++++++----- net/core/net_namespace.c | 1 + 6 files changed, 411 insertions(+), 46 deletions(-)