Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp15778ybp; Thu, 3 Oct 2019 14:05:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqwI2Et5cXJxNxLvW/0VG8u2KrcfLeU9JvjNAz4pbEMbIEkGEEDPnZ4AtXCxX2FwWO2vDP39 X-Received: by 2002:a50:9e0a:: with SMTP id z10mr11902900ede.202.1570136717478; Thu, 03 Oct 2019 14:05:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570136717; cv=none; d=google.com; s=arc-20160816; b=x1lhTW3y2h6oXoUaobEGc1wmcpbaPXcOrMPa2bT4sSCS5uch/OYnARzvGF/ga/UGaY gKwMeCqbILVj6VsJ8EsjS3hkwb1wDyP/lAoNab/EQDj2tSla9MES7zIs8Ar9JNZUWfm0 PyA6v75kNfsbyqZlodg/xZzmjZEECGJbuO1qrMjK/CNmg9zl7XtcH3Toll31tXOqln04 efQxdPGhT0UymlLWU7+XvzsT/Oc+swP0wQJ9TNJhP2FqOL7FvuaAaJ+iE3Ku+8I2b2RP W/NBsffGCF6FjpAuSuJEmCGSJDA1mYkpZroAOwANRqv9H4zIIz/Xm8eZMAp2H1EdumZQ +E/w== 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=E5SAchAqbt5StPb+s2j3ybaKfrX09uCoGQITz/dDUpk=; b=nxXL/1bnqpw/+lb7P4DywXvrRLz34hxXPxmo4GYyUEXZPanaGlrI4mkuActv2Zw86f p1v+zIWWZRrZ7B+aql/T07teRNEQzkwJFeumGFs/D4L7ljpNw8yz+OYfJVGmgLFe74xM dhQxEPcAXvfQP1Ni8x+eHpPviPd0jT5L0+1YoT7XmnhlM4h5bE8VogSBo2mW6UYpBko0 bFJPkDfIgBDIvGWthz4/7qVExVb+jyzbbp9LuwMJ+/fjxKIo5btKQOkMInXK8/6mITFv fu8DIr3jR9xF9NOHPfhxJpD9a8q50qpb+TfKhLb9ahAapE8qfntPQHjGMLuyR8dLpBSK JjJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pBKhH56p; 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 z2si2302122edd.390.2019.10.03.14.04.52; Thu, 03 Oct 2019 14:05:17 -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=pBKhH56p; 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 S1728766AbfJCVBk (ORCPT + 99 others); Thu, 3 Oct 2019 17:01:40 -0400 Received: from mail-io1-f67.google.com ([209.85.166.67]:44975 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728869AbfJCVBk (ORCPT ); Thu, 3 Oct 2019 17:01:40 -0400 Received: by mail-io1-f67.google.com with SMTP id w12so8756307iol.11; Thu, 03 Oct 2019 14:01:39 -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=E5SAchAqbt5StPb+s2j3ybaKfrX09uCoGQITz/dDUpk=; b=pBKhH56piWOqZZ0XAvUgyFpneZ68ZJgWSbjmYs7zpwuFJcntG55dfrSzXUAw6IecO+ ikJqW+BIkiX1v9tG7uHt+Gg1uWoHMu35Xop7k/QqeZPZ4/h2kyeGEXR/naL6KyWBXjZS obQHSjNMXIWpmcDfawPAb+39E2V0ID8zyLEflWc+d+fnetgEG4WXU7Eit0uut0je+Pk9 FGznii1X0SB+UsbxwedrsCsJUqiDrBwUygvdIs6Q7brXYadz3xJv5uirNvNZ66aMLHng GhG8/2Pf6qAJePHKnQtDkKklXjZ8tVldoKbFQehBE+YYC6EIwrrP7abeKEXMSKpGrRiX rVpw== 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=E5SAchAqbt5StPb+s2j3ybaKfrX09uCoGQITz/dDUpk=; b=VuodHcbgHz2WXd5wf/gJ99Uv0m6XxBn1xHXt79aqAwQi5gXNusWry3g2RLFgYU6Wc0 spoou6bu4yeP+e7MjGw4gkM0PcQMfSYVXTHjd8BSpaBWXOPXpzynRku7+deqHtN2Bbz3 +XTIZsrv9xqzS5DOSWB3tCQ/b9y7ab8WElJQR6my+23dmxU3Zb7VOOyWwPaUFkOxPdRO HgJV3DWB8I6hPXvG74NweKoLD5fYYaisX9AyiUv9jQV3cj55RwmUSD0WgJrV11E2AaHm rB0y61o8QpLwINWjj4YMN6NK70BPwS89rN+1Mi3L9Yi6ZIHZDu/p7fnfeA+v81nwb2Cp WM8Q== X-Gm-Message-State: APjAAAVGUM95dhkupWEvH/FkGrPZNwF9UT8rXZskn1wu8kcpAuKEgEg3 1m6Chig76/q6vEWruElhdT46s4bRd02h X-Received: by 2002:a92:3851:: with SMTP id f78mr11603006ila.179.1570136499208; Thu, 03 Oct 2019 14:01:39 -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 c17sm1900489ild.31.2019.10.03.14.01.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 Oct 2019 14:01:38 -0700 (PDT) Date: Thu, 3 Oct 2019 17:01:36 -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 v6 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 v6: patch 1: changed kernel version in Documentation/ABI/testing/debugfs-hyperv to 5.5 removed less than 0 if statement when dealing with u64 datatype, as suggested by michael. changes in v5: patch 1: As per Stephen's suggestion, Moved CONFIG_HYPERV_TESTING to lib/Kconfig.debug. Fixed build issue reported by Kbuild, with Michael's suggestion to make hv_debugfs part of the hv_vmbus module. 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/Makefile | 1 + drivers/hv/connection.c | 1 + drivers/hv/hv_debugfs.c | 178 +++++++++++ drivers/hv/hyperv_vmbus.h | 31 ++ drivers/hv/ring_buffer.c | 2 + drivers/hv/vmbus_drv.c | 6 + include/linux/hyperv.h | 19 ++ lib/Kconfig.debug | 7 + tools/hv/vmbus_testing | 376 +++++++++++++++++++++++ 11 files changed, 645 insertions(+) create mode 100644 Documentation/ABI/testing/debugfs-hyperv create mode 100644 drivers/hv/hv_debugfs.c create mode 100755 tools/hv/vmbus_testing -- 2.17.1