Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1768473ybl; Wed, 28 Aug 2019 21:26:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqwC57pY0px6Hc0HhtEhPjqY9b4xJsKmxnupTBK2F47J4aEmg3MdrLNdqBod4+atI0Y/gfBj X-Received: by 2002:a17:902:3064:: with SMTP id u91mr7836451plb.85.1567052776081; Wed, 28 Aug 2019 21:26:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567052776; cv=none; d=google.com; s=arc-20160816; b=ZtsQzLYzpKiEv/cDUyPZddF152GJIxQZW4lXdvVJoUcLXeFJSliUB8qemBs76KcOh3 IsmzQiBQ1K344SUiklgPrQ1roD0elstb6ugIKHaBLdN4GaRD+59++TXl37EUBs6Ipb/F u0frr5Y8JJgwIenrWeRM+zelRoK4UyJXrTdOvz4ljI93VapjhAO3V8M1bxQTwRMJB6Vs SSe1gT0cnTKq7BfgNek1P4Rc4IzER3ATI80N13OIGiptyNZ/P3yI9hf6n7OHx4aLV4Q8 S91t44bW7toOETt6dDT0gLbL2DmMznzwD/hx8n1e0m1zoNV4E9cT8h2K5jrspL2UOeEI L5WQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature; bh=pOB1i3mTdd6xhVveEaHICqtJMaVyedUAsiHTGFqKc/s=; b=hvg8f3FCndFZzF7/ZJCABtFlTcFEcWBGrH4jvEC69RlbnbFiUoEuRzS2NkwyTOUPUA CFT8FZNgEV96WdL/CdBdjo40+ovPkB3/bE6i1TprFU6onpE0Kdli4vNUREa15j53fWv5 Z3DsLecFZXgOGQtnSDZ3XHFdbIWKQsjHjnnwHJpCZIGH9yqv+jjUvP/TnjpbqXNEk2Zh ava3NLO6JKnYNHQLHdhw694YSVDW1ipvgoO61jkLjmLHuWt3r9rl+m3n6RnKJdrnutrS fiMM9LtQTgX8hi8cAI8Q9ba/Fxy6pSgHrXprimuOdrzZEwD6VP+PeNXk+rJK4K4HrlrG R8IA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BYq1yuUz; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r145si898715pgr.553.2019.08.28.21.26.01; Wed, 28 Aug 2019 21:26:16 -0700 (PDT) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BYq1yuUz; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725848AbfH2EYB (ORCPT + 99 others); Thu, 29 Aug 2019 00:24:01 -0400 Received: from mail-io1-f66.google.com ([209.85.166.66]:33256 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725730AbfH2EYA (ORCPT ); Thu, 29 Aug 2019 00:24:00 -0400 Received: by mail-io1-f66.google.com with SMTP id z3so4267233iog.0; Wed, 28 Aug 2019 21:24:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=pOB1i3mTdd6xhVveEaHICqtJMaVyedUAsiHTGFqKc/s=; b=BYq1yuUzBGIMCIWADSktNNvBtohGrzAzG+8hj1WZ+K+lM/LEhJ1vSNPfPW9QEFxUR/ iwtXECQDfK9IhszV9UilfiY/D4gH1vMXHfdNeB7f+CNtfhIaSqmWcNYAbP/7d73IDRBU v8aZUMQPZ/Y8Bm+tVDFspHN5XceEzaMcwu8ER9zXfx03f2DfDnArvOPDpxsR1hrFtBF3 WmJFDRtWrwJkCo/2NfQ2j69BRUR0uUHzykzpifxEdiT6k10c+XMkkY+tXA1xqcpBlEVz cNhgl3ldrBvKx7hm6VtFoKtP6gzsmsU0AFbcdUmPOjx/J2QBRUmw40qnOO2BAAvl+KKM ayPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=pOB1i3mTdd6xhVveEaHICqtJMaVyedUAsiHTGFqKc/s=; b=bGFfNZ2bM0EsZ3TuOVfWfklbxhQFP8PX67DV78FNyKyGO3u2xWEAs4jOntXrDGOeAb n6+GjMawV1hwixbPfwZXF3TyXyWQeht8RenKe/JDoZjd3YWj+woNm5iw8DZ2IOOzBufa ZX9z7XA+rFHD7nqu1TO5/MIDPA3TvaFzFHQiuBmthLDQC1js+pje2plibyzQmkivjlY/ KjG/IPZvnVscsQjyrCx7h8vOZA+/R1l+Rkwm3gY59CrFqFnIzFMWlV8ny/a8xf8S1rpU IybTlVmja4wqEeuoahfuZr8hAHIfi3pC1n3RrYWamCABI30UBKmGqB7aGz3RmkB1g3TJ MdgQ== X-Gm-Message-State: APjAAAUPLNeJ8s5ir9B9CH+MbJitdXTSk7+UyGXlp6xhOSEQ8+r+2SFn DuUwaWIOa9/QvoQfv9I0cQ== X-Received: by 2002:a6b:5a12:: with SMTP id o18mr8578161iob.159.1567052639788; Wed, 28 Aug 2019 21:23:59 -0700 (PDT) Received: from Test-Virtual-Machine (d24-141-106-246.home.cgocable.net. [24.141.106.246]) by smtp.gmail.com with ESMTPSA id a9sm903916iod.76.2019.08.28.21.23.56 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 28 Aug 2019 21:23:58 -0700 (PDT) Date: Thu, 29 Aug 2019 00:23:54 -0400 From: Branden Bonaby To: kys@microsoft.com, haiyangz@microsoft.com, sthemmin@microsoft.com, sashal@kernel.org Cc: Branden Bonaby , linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 0/2] hv: vmbus: add fuzz testing to hv device Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patchset introduces a testing framework for Hyper-V drivers. This framework allows us to introduce delays in the packet receive path on a per-device basis. While the current code only supports introducing arbitrary delays in the host/guest communication path, we intend to expand this to support error injection in the future. changes in v4: patch 1: Combined previous v3 patches 1 and 2, into a single patch which is now patch 1. This was done so that calls to the new debugfs functions are in the same patch as the definitions for these functions. Moved debugfs code from "vmbus_drv.c" that was in previous v3 patch 2, into a new file "debugfs.c" in drivers/hv. Updated the Makefile to compile "debugfs.c" if CONFIG_HYPERV_TESTING is enabled As per Michael's comments, added empty implementations of the new functions, so the compiler will not generate code when CONFIG_HYPERV_TESTING is not enabled. patch 2 (was previously v3 patch 3): Based on Harrys comments, made the tool more user friendly and added more error checking. changes in v3: patch 2: change call to IS_ERR_OR_NULL, to IS_ERR. patch 3: Align python tool to match Linux coding style. Changes in v2: Patch 1: As per Vitaly's suggestion, wrapped the test code under an #ifdef and updated the Kconfig file, so that the test code will only be used when the config option is set to true. (default is false). Updated hyperv_vmbus header to contain new #ifdef with new new functions for the test code. Patch 2: Moved code from under sysfs to debugfs and wrapped it under the new ifdef. Updated MAINTAINERS file with new debugfs-hyperv file under the section for hyperv. Patch 3: Updated testing tool with new debugfs location. Branden Bonaby (2): drivers: hv: vmbus: Introduce latency testing tools: hv: add vmbus testing tool Documentation/ABI/testing/debugfs-hyperv | 23 ++ MAINTAINERS | 1 + drivers/hv/Kconfig | 7 + drivers/hv/Makefile | 1 + drivers/hv/connection.c | 1 + drivers/hv/hv_debugfs.c | 187 +++++++++++ drivers/hv/hyperv_vmbus.h | 31 ++ drivers/hv/ring_buffer.c | 2 + drivers/hv/vmbus_drv.c | 6 + include/linux/hyperv.h | 19 ++ tools/hv/vmbus_testing | 376 +++++++++++++++++++++++ 11 files changed, 654 insertions(+) create mode 100644 Documentation/ABI/testing/debugfs-hyperv create mode 100644 drivers/hv/hv_debugfs.c create mode 100644 tools/hv/vmbus_testing -- 2.17.1