From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0062.outbound.protection.outlook.com [104.47.1.62]) by dpdk.org (Postfix) with ESMTP id 040AF1B024 for ; Thu, 18 Jan 2018 09:44:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=jrDdC+xn8iWL2mp8CiJcCedsTTX8JB2R+fxYonKxRKg=; b=av/xodaAz5rFhUsV8OKeeGhjmoYuWXxxKAjX4VhBC8EFYTelOkqzsgNker4xmr2WGHQCxFz7cCxTIGkBbNlK05bEmasu1IUNztQ8ClPz+pg+24pLvwzw2/j+q82xx42EvdCevCer02Tc37h4kyFRJRWxWKpmtZ91YXDaznIvYaU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=matan@mellanox.com; Received: from mellanox.com (37.142.13.130) by AM6PR0502MB3797.eurprd05.prod.outlook.com (2603:10a6:209:a::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.428.17; Thu, 18 Jan 2018 08:44:04 +0000 From: Matan Azrad To: Ferruh Yigit Cc: Thomas Monjalon , dev@dpdk.org, stephen@networkplumber.org Date: Thu, 18 Jan 2018 08:43:38 +0000 Message-Id: <1516265026-6469-1-git-send-email-matan@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1515509253-17834-1-git-send-email-matan@mellanox.com> References: <1515509253-17834-1-git-send-email-matan@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: VI1PR0902CA0040.eurprd09.prod.outlook.com (2603:10a6:802:1::29) To AM6PR0502MB3797.eurprd05.prod.outlook.com (2603:10a6:209:a::26) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a8dd992c-7207-4efc-0fe3-08d55e4fa1c5 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(48565401081)(2017052603307)(7153060)(7193020); SRVR:AM6PR0502MB3797; X-Microsoft-Exchange-Diagnostics: 1; AM6PR0502MB3797; 3:pajLAqtnz78u9e9NnIR+iNKfaJDQxQ33uoG2WQ/FtSWnk46kHWOstsWql/eVCl63W6q76V/w9tSskPCg5RPsn3BODKDTE+hpLtVFZsZ7UkD80SgiI5/z3WmzRD6Zu6SbHw1I6pol7mNxVDVoWvEI/KHmuZ1UMNY8wGas6sOHQIcmAmEDpFrVxgLuMwTptquSfI9lFOlNxpH+5LTAztaUdyBps/v1zzJdJqBs8sJCy3BXelqTMhTQzALa8uoGWjQ6; 25:J1cCYxfTMSgP8cV5+sUeQD3EXhQUSC+XT7I1WYDq6IKK+Y2TpFk1PtN5TLfURwIQAYEO0vX99jRJTnwB5UKZ6fDBylmZnOp18rJLxZQd05tc2XtCClHJC0YnHCLj7hXLh61tnA8CCcnnH8+YH+vHGjRmF3Gt3/E5deyiFYtKVaCVISgilw4kbtjRdHvynCFpyJrLI/hA8M4N/oahl+Uatwk/Dfb+CFMUFuYSEOagIYQN0rKLAs3vnv7FBJIKaQLwnde+N3eNyF4cxt9wQtpye+5sU2vZszMIC7zxpNb37CnZyCHemUmBxqpIqthQIzeKQKXrECYIZGuwX/Ohmek3Tw==; 31:ari2SZ3auYJZtamSLhGzEEMghDJ48SizEtc/tJJ3WUmil5ykyxi8UnMXVOJRelIAcv71UVGR2szQef58dNgKkPApfdeH3BaMmfRlKu/i2KuimOhFHQX+azWV4q6vFL9gi5ZkRAUG4jFkwbmD1YAKYTflwRCxT7uFGLNiHJRInYUT+Qp7R2AvYqyo/j3iFfRPYaCMK3XS1B71LKWqyRADvq5YFNkJGYyqJ6t1RxXYNsA= X-MS-TrafficTypeDiagnostic: AM6PR0502MB3797: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; AM6PR0502MB3797; 20:x2DNjMFJpXUarPxOGWO51zYhJD1K+ZSqoUakDjuXkyITm+VuYWFq4XHvzxeNYIN9YSrHmZvEFOf1jETRNANxW0lMojIHJm9QR4SG8IMeAPFDSBhGnTn1gYQDOLyxP/jxFgO+s8zFwaftrBP8woYo/lcFAs3Lll+vnqUVmt8kY4UcQ6gdKx15Qh2/P2SB7tSYyeKAOYuKyzNYkPtzHTRy1fR7BI3zTKuUMzNULbB6c/LF9Zf6IwA8jNuBwCY7PqyBgVC3uhBvGC24CykPQI4tBfkZ99DhcfncGle5Zfihr10Z0wKlqhwFIyiYPVCzlg9bE966+K15ltI1S3ZJpv+VturFdgiYi3eKFXcuinc5QroZKVdpmc5TEjGCK6X7M9fqc3TYJFqMZ/z+Kfc2Qgd0ipoDbRqNjXyxKvyKilBrIrRbpEgv3n1HcUkz7RH2HuN2/rOxiwhCgRl+7jBAHU+w1RqCZrsWGyrdpUePL5FalecVi0ESqqrjmIRJFq2zmuqm; 4:x6a9KIPSqm+w/ek9VidKu8YTFCRyGvkHdihOq96/inIAI+Mzlrp+gimIpHVDbixbAQUsDL7mf88vWjmT2c7/8nTkMdpt4YLgbQ4AMAp3QiSY3X3GYJLMiRH3bs+l1DUvWFgAbpuHCVONULYGacdFHNrKu+Ad75zx/N6nR4QNBAVaA7/CNm8XEj9mV7PZnh45ZR3w/9ut4SLXuLsxWC1IXUAeSazdz26VCg/VSEPwBCKev+kgD+VIuJr0kqC3YsuFU08LnTXaVTj0D0FC/VA2Pvch1iBNdHYmkpzomnileZMHEfvPy+L4jR74ZroZ72IIe9OqW7j0/9UhvX3/2zBsk+VR0NX6XYeyiY2DYu7Rsr4= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(244540007438412)(278428928389397); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(10201501046)(3231023)(2400058)(944501161)(3002001)(93006095)(93001095)(6055026)(6041268)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123562045)(20161123560045)(6072148)(201708071742011); SRVR:AM6PR0502MB3797; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:AM6PR0502MB3797; X-Forefront-PRVS: 05568D1FF7 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(39380400002)(396003)(376002)(366004)(39860400002)(189003)(199004)(97736004)(68736007)(36756003)(50226002)(4326008)(86362001)(16526018)(81156014)(81166006)(8936002)(33026002)(55016002)(105586002)(5660300001)(106356001)(69596002)(3846002)(53936002)(66066001)(7736002)(305945005)(47776003)(2906002)(6116002)(76176011)(26005)(59450400001)(386003)(4720700003)(50466002)(52116002)(6666003)(51416003)(6916009)(7696005)(25786009)(21086003)(2950100002)(48376002)(16586007)(8676002)(316002)(478600001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM6PR0502MB3797; H:mellanox.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM6PR0502MB3797; 23:ymjEkXFc8UcYrtgA+0mBfvHkYJF8V2NaLHpA1iY?= =?us-ascii?Q?jOm+epb1wzP8YZnWVdpbV82dn2I/j0GepHk1Hbt33saWjYg0cAOWsHCvpxSP?= =?us-ascii?Q?2+7Wq4IdGsA0TGfhE0YI75a4iW2Og1DxO7JXHTGugAHQ46aE2Bka0XKPbm3P?= =?us-ascii?Q?mX6cfFQY7lXYFOuejdK7zv27E24Et44DYnZ9yDZQbBIu8g/L/wQfjykxE8nB?= =?us-ascii?Q?/i/gv3YuWik93cahj6g7Y0BnyPVZ9UimNdzu77Tzb5r3/9ibOXYVSMz+u7st?= =?us-ascii?Q?oczzhKTjW6CmSxnt1Op3uFjGEykZIMSgJ0+b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=?us-ascii?Q?KQnPDQX3eK/sp3Fw=3D?= X-Microsoft-Exchange-Diagnostics: 1; AM6PR0502MB3797; 6:itvYl6L4nP+HbT4nCOOTkAL6UZVtt7sRm5SI6Ujy1DmNPiJfWgPboh03qdz8X7WyHFif58ld9JXKwhIk9erT+hOzN/ZUHNWUo9UB9hCpxkp6WzfJeaEMjBOgUQW7tYoamG53cSd7IXZJeML34Nn1KHMtNHWSgsv+bCgb1Q9EcFiIK+z1cJH+7xQg+1jSBf4J7RJFjOrleHEV9hwF8cQNxkU3/oTLpl4yzoiBPozorOovWuKSb+SP8dIyODDcMClInbnPERNajb+Cpoqkw9QGrtYRW7BMgEezh3NHtLjoHZUBrAJxIqETpdIoLnJ8a7nDDvJdkD0DMyakAZNTzo+ueD2ymYY89L3ebGNVWxQZWfo=; 5:Tva1R1b3sj5Dx6gjdg8/tiFi0WuipD3rEAWdKLy4+hEkUFkJGs/DkikES4NK1flOE7lftzrTT6bLV3HCWSqe74lKZPkDD4L618hAqSftQJprnRn/3KEMRtRsLgiL2HhYfuJuLNxgZDUQ0ha6U//s06BPsrIZS2pgpEcxthSORxA=; 24:Q9qKBVgu9FY++u0LsKUQMdy500MK686NA1rJVhzVS81bvcRFpVefPNXKrrnoX1olwwFgTlhcOZpb398u63MORCWxhdx9ldJ0Fe4WVY6wihY=; 7:YlREoE3xhSrGEYl2CQ1cFrhASo3wbNUrLDGMUBTX51I+T1A/hGi0B1JdoxeoDFXfHXadMpBXAo8aVygR0Nku2ckL1ft/Hnh3lyV7GybDcNoEiGliAkkbpX+Vy1Ck8RxvRCkhmnNb5L1RNpYq5EAVRTLdyLpOHt5gr0nUmCKxJqhqtA4W0Lphb3qZ7PGqg0cGCoa2pfMtqP1lAYh/viVqRb1c5cXiPEd6XeA6blOolp7jUoGn/DYhB4ApLx8gHkxK SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jan 2018 08:44:04.5860 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a8dd992c-7207-4efc-0fe3-08d55e4fa1c5 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR0502MB3797 Subject: [dpdk-dev] [PATCH v4 0/8] Introduce virtual driver for Hyper-V/Azure platforms X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 08:44:07 -0000 Virtual machines hosted by Hyper-V/Azure platforms are fitted with simplified virtual network devices named NetVSC that are used for fast communication between VM to VM, VM to hypervisor, and the outside. They appear as standard system netdevices to user-land applications, the main difference being they are implemented on top of VMBUS instead of emulated PCI devices. While this reads like a case for a standard DPDK PMD, there is more to it. To accelerate outside communication, NetVSC devices as they appear in a VM can be paired with physical SR-IOV virtual function (VF) devices owned by that same VM. Both netdevices share the same MAC address in that case. When paired, egress and most of the ingress traffic flow through the VF device, while part of it (e.g. multicasts, hypervisor control data) still flows through NetVSC. Moreover VF devices are not retained and disappear during VM migration; from a VM standpoint, they can be hot-plugged anytime with NetVSC acting as a fallback. Running DPDK applications in such a context involves driving VF devices using their dedicated PMDs in a vendor-independent fashion (to benefit from maximum performance without writing dedicated code) while simultaneously listening to NetVSC and handling the related hot-plug events. This new virtual driver (referred to as "vdev_netvsc" from this point on) automatically coordinates the Hyper-V/Azure-specific management part described above by relying on vendor-specific, failsafe and tap PMDs to expose a single consolidated Ethernet device usable directly by existing applications. .------------------. | DPDK application | `--------+---------' | .------+------. | DPDK ethdev | `------+------' Control | | .------------+------------. v .--------------------. | failsafe PMD +---------+ vdev_netvsc driver | `--+-------------------+--' `--------------------' | | | .........|......... | : | : .----+----. : .----+----. : | tap PMD | : | any PMD | : `----+----' : `----+----' : <-- Hot-pluggable | : | : .------+-------. : .-----+-----. : | NetVSC-based | : | SR-IOV VF | : | netdevice | : | device | : `--------------' : `-----------' : :.................: v2 changes(Adrien): - Renamed driver from "hyperv" to "vdev_netvsc". This change covers documentation and symbols prefix. - Driver is now tagged EXPERIMENTAL. - Replaced ether_addr_from_str() with a basic sscanf() call. - Removed debugging code (memset() poisoning). - Fixed hyperv_iface_is_netvsc()'s buffer allocation according to comments. - Removed hyperv_basename(). - Discarded unused variables through __rte_unused. - Added separate but necessary free() bugfix for failsafe PMD. - Added file descriptor input support to failsafe PMD. - Replaced temporary bash execution; failsafe now reads device definitions directly through a pipe without an intermediate bash one-liner. - Expanded DEBUG/INFO/WARN/ERROR() macros as PMD_DRV_LOG(). - Added dynamic log type (pmd.vdev_netvsc). - Modified initialization code to probe devices immediately during startup. - Fixed several snprintf() return value checks ("ret >= sizeof(foo)" is more appropriate than "ret >= sizeof(foo) - 1"). v3 changes(Matan): - Fixed clang compilation in V2. - Removed hotplug remove code from the new driver. - Supported probed sub-devices getting in fail-safe. - Added automatic probing for HyperV VM systems. - Added option to ignore the automatic probing. - Skiped routed NetVSC devices probing. - Adjusted documentation and semantics. - Replaced maintainer. v4 changes(Matan): - Align descriptions of context struct(Stephen suggestion). - Skip non-ethernet devices in netdev loop(Stephen suggestion). - Use different variable names in "add fd parameter"(Gaetan suggestion). - Change name of get port id function in "add automatic probing"(Gaetan suggestion). - Update internal fail-safe devargs in case of probed device(Gaetan suggestion). - use deferent commit title instead of "support probed sub-devices getting"(Gaetan suggestion). Adrien Mazarguil (1): net/failsafe: fix invalid free Matan Azrad (7): net/failsafe: add "fd" parameter net/failsafe: add probed etherdev capture net/vdev_netvsc: introduce Hyper-V platform driver net/vdev_netvsc: implement core functionality net/vdev_netvsc: skip routed netvsc probing net/vdev_netvsc: add "force" parameter net/vdev_netvsc: add automatic probing MAINTAINERS | 6 + config/common_base | 5 + config/common_linuxapp | 1 + doc/guides/nics/fail_safe.rst | 14 + doc/guides/nics/features/vdev_netvsc.ini | 12 + doc/guides/nics/index.rst | 1 + doc/guides/nics/vdev_netvsc.rst | 100 +++ drivers/net/Makefile | 1 + drivers/net/failsafe/failsafe_args.c | 84 ++- drivers/net/failsafe/failsafe_eal.c | 78 ++- drivers/net/failsafe/failsafe_private.h | 5 + drivers/net/vdev_netvsc/Makefile | 31 + .../vdev_netvsc/rte_pmd_vdev_netvsc_version.map | 4 + drivers/net/vdev_netvsc/vdev_netvsc.c | 752 +++++++++++++++++++++ mk/rte.app.mk | 1 + 15 files changed, 1071 insertions(+), 24 deletions(-) create mode 100644 doc/guides/nics/features/vdev_netvsc.ini create mode 100644 doc/guides/nics/vdev_netvsc.rst create mode 100644 drivers/net/vdev_netvsc/Makefile create mode 100644 drivers/net/vdev_netvsc/rte_pmd_vdev_netvsc_version.map create mode 100644 drivers/net/vdev_netvsc/vdev_netvsc.c -- 1.8.3.1