From patchwork Fri Oct 14 02:57:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: liulongfang X-Patchwork-Id: 2466 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp589822wrs; Thu, 13 Oct 2022 20:09:00 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5ADBOLRBh8MF2TahGmwe38URyQqEtdK8juCdpHB/XlNdYd3xbJbO/5Azwv7JDYRSMSNiNu X-Received: by 2002:a65:6041:0:b0:449:8b9c:8d29 with SMTP id a1-20020a656041000000b004498b9c8d29mr2587873pgp.335.1665716940431; Thu, 13 Oct 2022 20:09:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665716940; cv=none; d=google.com; s=arc-20160816; b=W8+f0olw9d9qd/LCGp8UVBSfnP7AAHOGOPvNEhcZEX6uIHibr76QWuhTbgk8803sgu hZrcaXQbwvCZWvRkEQDbbdX4YkQI9GON+12GVUvCQUiZKvJb4cN9aU17PPWsTMgwoHEz /3meS50msvk5bUDV5wxoIoniBBY2lqGdPo1LlQs3znBDw0NRUfY9HvdzNhmqmUTcHYl/ 5HsFVjoTofWJI+Bt95FDKqMNlDR9RICaws8p/biQBqk57zLRO+gbl7JCd4vev+MC4vNe H7f9+OFDWnukCnMuVE4gn0op/IX3cRWFNa9Ajk9Eloj0QhFjPcIK84c4JXmkiN3EOV/D FgKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=FV4ORggo32RWPvg17wHrpk9GX6oKN5OHAcSBEmL1gug=; b=ZcT+k4HAmG+uWYGs+ii6qz8vc613hm0pkqGedSFSx4nA4FofhBkYAK3qK+OnYd2dAM yMgL66Mp5E2H62qhwSwg0103DWd14FKEi693Yid7ltfitR1mVbEwHWZyYfI2iPKQZ54s dGRxd7Ut1Z3aR0ghylmjM0xugqssU9WGT4c6KWaNSAufyLvzXZbUjIQLHd+wStZLqJS2 iZIYj6NuwI1qiww+fScaSZUXL4DL2RWBabvANhRrEWHHkJOtBRGXKMbn0FAPk2e1b2Gn kzPsfnWXqEgbfP4BWEetWcAK/5xZPlDSCams9PTPtC3N2bsI0FCMwYOpJZIneC4sA1Co /Iiw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f13-20020a056a00228d00b005352aeae657si1480072pfe.199.2022.10.13.20.08.47; Thu, 13 Oct 2022 20:09:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229832AbiJNC7B (ORCPT + 99 others); Thu, 13 Oct 2022 22:59:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229507AbiJNC7A (ORCPT ); Thu, 13 Oct 2022 22:59:00 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7783F15F918 for ; Thu, 13 Oct 2022 19:58:58 -0700 (PDT) Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MpWGl5wpTzpVxm; Fri, 14 Oct 2022 10:55:43 +0800 (CST) Received: from kwepemm600005.china.huawei.com (7.193.23.191) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 14 Oct 2022 10:58:56 +0800 Received: from huawei.com (10.67.164.66) by kwepemm600005.china.huawei.com (7.193.23.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 14 Oct 2022 10:58:55 +0800 From: Longfang Liu To: , , CC: , , , Subject: [PATCH 1/2] hisi_acc_vfio_pci: Add debugfs to migration driver Date: Fri, 14 Oct 2022 10:57:56 +0800 Message-ID: <20221014025757.39415-2-liulongfang@huawei.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20221014025757.39415-1-liulongfang@huawei.com> References: <20221014025757.39415-1-liulongfang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.164.66] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemm600005.china.huawei.com (7.193.23.191) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746630806429693121?= X-GMAIL-MSGID: =?utf-8?q?1746630806429693121?= There are multiple devices, software and operational steps involved in the process of live migration. An error occurred on any node may cause the live migration operation to fail. This complex process makes it very difficult to locate and analyze the cause when the function fails. In order to quickly locate the cause of the problem when the live migration fails, I added a set of debugfs to the accelerator live migration driver. +-----------------------------------+ | | | QEMU | | | +---+--^--------------------+--^----+ | | | | | | | | +---v--+----+ +---v--+----+ | | | | | src VF | | dest VF | | | | | +---+--^----+ +---+--^----+ | | | | | | | | +---v--+----+ +---v--+----+ | Debugfs | | Debugfs | +-----+-----+ +-----+-----+ |state|debug| |state|debug| +-----+-----+ +-----+-----+ This set of debugfs will create two files for each VF device: a state file and a debug file. The migration status of the current VF device can be obtained by reading the status file. The live migration function of the current device can be tested by operating the debug file, and the functional status of the equipment and software at each stage can be tested step by step without performing the complete live migration function. And after the live migration is performed, the migration device data of the live migration can be obtained through the debug file. Signed-off-by: Longfang Liu --- .../vfio/pci/hisilicon/hisi_acc_vfio_pci.c | 296 ++++++++++++++++++ .../vfio/pci/hisilicon/hisi_acc_vfio_pci.h | 14 + 2 files changed, 310 insertions(+) diff --git a/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c b/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c index 39eeca18a0f7..bed54e8e3a64 100644 --- a/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c +++ b/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c @@ -3,6 +3,7 @@ * Copyright (c) 2021, HiSilicon Ltd. */ +#include #include #include #include @@ -16,6 +17,9 @@ #include "hisi_acc_vfio_pci.h" +static struct dentry *hisi_acc_debugfs_root; +static atomic_t hisi_acc_root_ref; + /* Return 0 on VM acc device ready, -ETIMEDOUT hardware timeout */ static int qm_wait_dev_not_ready(struct hisi_qm *qm) { @@ -609,6 +613,18 @@ hisi_acc_check_int_state(struct hisi_acc_vf_core_device *hisi_acc_vdev) } } +static void hisi_acc_vf_migf_save(struct hisi_acc_vf_migration_file *src_migf, + struct hisi_acc_vf_migration_file *dst_migf) +{ + if (!dst_migf) + return; + + dst_migf->disabled = false; + dst_migf->total_length = src_migf->total_length; + memcpy(&dst_migf->vf_data, &src_migf->vf_data, + sizeof(struct acc_vf_data)); +} + static void hisi_acc_vf_disable_fd(struct hisi_acc_vf_migration_file *migf) { mutex_lock(&migf->lock); @@ -621,12 +637,16 @@ static void hisi_acc_vf_disable_fd(struct hisi_acc_vf_migration_file *migf) static void hisi_acc_vf_disable_fds(struct hisi_acc_vf_core_device *hisi_acc_vdev) { if (hisi_acc_vdev->resuming_migf) { + hisi_acc_vf_migf_save(hisi_acc_vdev->resuming_migf, + hisi_acc_vdev->debug_migf); hisi_acc_vf_disable_fd(hisi_acc_vdev->resuming_migf); fput(hisi_acc_vdev->resuming_migf->filp); hisi_acc_vdev->resuming_migf = NULL; } if (hisi_acc_vdev->saving_migf) { + hisi_acc_vf_migf_save(hisi_acc_vdev->saving_migf, + hisi_acc_vdev->debug_migf); hisi_acc_vf_disable_fd(hisi_acc_vdev->saving_migf); fput(hisi_acc_vdev->saving_migf->filp); hisi_acc_vdev->saving_migf = NULL; @@ -1176,6 +1196,277 @@ static long hisi_acc_vfio_pci_ioctl(struct vfio_device *core_vdev, unsigned int return vfio_pci_core_ioctl(core_vdev, cmd, arg); } +static int hisi_acc_vf_debug_create(struct hisi_acc_vf_core_device *hisi_acc_vdev) +{ + struct hisi_acc_vf_migration_file *migf; + + migf = kzalloc(sizeof(*migf), GFP_KERNEL); + if (!migf) + return -ENOMEM; + + migf->disabled = false; + hisi_acc_vdev->debug_migf = migf; + mutex_init(&migf->lock); + + return 0; +} + +static void hisi_acc_vf_debug_release(struct hisi_acc_vf_migration_file *migf) +{ + migf->disabled = true; + migf->total_length = 0; + mutex_destroy(&migf->lock); + kfree(migf); +} + +static int hisi_acc_vf_debug_test(struct hisi_acc_vf_core_device *hisi_acc_vdev) +{ + struct device *dev = &hisi_acc_vdev->vf_dev->dev; + struct hisi_qm *vf_qm = &hisi_acc_vdev->vf_qm; + u64 data; + int ret; + + data = readl(vf_qm->io_base + QM_MB_CMD_SEND_BASE); + dev_info(dev, "debug mailbox val: 0x%llx\n", data); + + ret = qm_wait_dev_not_ready(vf_qm); + if (ret) + dev_err(dev, "VF device not ready!\n"); + + return ret; +} + +static ssize_t hisi_acc_vf_debug_read(struct file *filp, char __user *buffer, + size_t count, loff_t *pos) +{ + char buf[VFIO_DEV_DBG_LEN]; + int len; + + len = scnprintf(buf, VFIO_DEV_DBG_LEN, "%s\n", + "echo 0: test vf state save\n" + "echo 1: test vf state resume\n" + "echo 2: test vf send mailbox\n" + "echo 3: dump vf config data\n" + "echo 4: dump vf migration state\n"); + + return simple_read_from_buffer(buffer, count, pos, buf, len); +} + +static void hisi_acc_vf_dev_data_dump(struct hisi_acc_vf_core_device *hisi_acc_vdev) +{ + size_t vf_data_sz = offsetofend(struct acc_vf_data, padding); + struct device *dev = &hisi_acc_vdev->vf_dev->dev; + + if (hisi_acc_vdev->debug_migf && + hisi_acc_vdev->debug_migf->total_length) { + print_hex_dump(KERN_INFO, "dev mig data:", + DUMP_PREFIX_OFFSET, 16, 1, + (u8 *)&hisi_acc_vdev->debug_migf->vf_data, + vf_data_sz, false); + } else { + dev_info(dev, "device not migrated!\n"); + } +} + +static void hisi_acc_vf_dev_attr_show(struct hisi_acc_vf_core_device *hisi_acc_vdev) +{ + struct device *dev = &hisi_acc_vdev->vf_dev->dev; + + if (hisi_acc_vdev->debug_migf && + hisi_acc_vdev->debug_migf->total_length) { + dev_info(dev, "acc device:\n" + "device state: %d\n" + "device ready: %u\n" + "data valid: %d\n" + "data size: %lu\n", + hisi_acc_vdev->mig_state, + hisi_acc_vdev->vf_qm_state, + hisi_acc_vdev->debug_migf->disabled, + hisi_acc_vdev->debug_migf->total_length); + } else { + dev_info(dev, "device not migrated!\n"); + } +} + +static int hisi_acc_vf_debug_resume(struct hisi_acc_vf_core_device *hisi_acc_vdev) +{ + struct hisi_acc_vf_migration_file *migf = hisi_acc_vdev->debug_migf; + struct device *dev = &hisi_acc_vdev->vf_dev->dev; + int ret; + + ret = vf_qm_state_save(hisi_acc_vdev, migf); + if (ret) { + dev_err(dev, "failed to save device data!\n"); + return -EINVAL; + } + + ret = vf_qm_check_match(hisi_acc_vdev, migf); + if (ret) { + dev_err(dev, "failed to match the VF!\n"); + return -EINVAL; + } + + ret = vf_qm_load_data(hisi_acc_vdev, migf); + if (ret) { + dev_err(dev, "failed to recover the VF!\n"); + return -EINVAL; + } + + vf_qm_fun_reset(&hisi_acc_vdev->vf_qm); + dev_info(dev, "successful to resume device data!\n"); + + return 0; +} + +static int hisi_acc_vf_debug_save(struct hisi_acc_vf_core_device *hisi_acc_vdev) +{ + struct hisi_acc_vf_migration_file *migf = hisi_acc_vdev->debug_migf; + struct device *dev = &hisi_acc_vdev->vf_dev->dev; + int ret; + + ret = vf_qm_state_save(hisi_acc_vdev, migf); + if (ret) { + dev_err(dev, "failed to save device data!\n"); + return -EINVAL; + } + dev_info(dev, "successful to save device data!\n"); + + return 0; +} + +static ssize_t hisi_acc_vf_debug_write(struct file *filp, const char __user *buffer, + size_t count, loff_t *pos) +{ + struct hisi_acc_vf_core_device *hisi_acc_vdev = filp->private_data; + char tbuf[VFIO_DEV_DBG_LEN]; + unsigned long val; + int len, ret; + + if (*pos) + return 0; + + if (count >= VFIO_DEV_DBG_LEN) + return -ENOSPC; + + len = simple_write_to_buffer(tbuf, VFIO_DEV_DBG_LEN - 1, + pos, buffer, count); + if (len < 0 || len > VFIO_DEV_DBG_LEN - 1) + return -EINVAL; + tbuf[len] = '\0'; + if (kstrtoul(tbuf, 0, &val)) + return -EFAULT; + + switch (val) { + case STATE_SAVE: + ret = hisi_acc_vf_debug_save(hisi_acc_vdev); + if (ret) + return ret; + break; + case STATE_RESUME: + ret = hisi_acc_vf_debug_resume(hisi_acc_vdev); + if (ret) + return ret; + break; + case MB_TEST: + ret = hisi_acc_vf_debug_test(hisi_acc_vdev); + if (ret) + return -EINVAL; + break; + case MIG_DATA_DUMP: + hisi_acc_vf_dev_data_dump(hisi_acc_vdev); + break; + case MIG_DEV_SHOW: + hisi_acc_vf_dev_attr_show(hisi_acc_vdev); + break; + default: + return -EINVAL; + } + + return count; +} + +static const struct file_operations hisi_acc_vf_debug_fops = { + .owner = THIS_MODULE, + .open = simple_open, + .read = hisi_acc_vf_debug_read, + .write = hisi_acc_vf_debug_write, +}; + +static ssize_t hisi_acc_vf_state_read(struct file *filp, char __user *buffer, + size_t count, loff_t *pos) +{ + struct hisi_acc_vf_core_device *hisi_acc_vdev = filp->private_data; + char buf[VFIO_DEV_DBG_LEN]; + u32 state; + int len; + + state = hisi_acc_vdev->mig_state; + switch (state) { + case VFIO_DEVICE_STATE_RUNNING: + len = scnprintf(buf, VFIO_DEV_DBG_LEN, "%s\n", + "RUNNING\n"); + break; + case VFIO_DEVICE_STATE_STOP_COPY: + len = scnprintf(buf, VFIO_DEV_DBG_LEN, "%s\n", + "STOP and COPYING\n"); + break; + case VFIO_DEVICE_STATE_STOP: + len = scnprintf(buf, VFIO_DEV_DBG_LEN, "%s\n", + "STOP\n"); + break; + case VFIO_DEVICE_STATE_RESUMING: + len = scnprintf(buf, VFIO_DEV_DBG_LEN, "%s\n", + "RESUMING\n"); + break; + default: + len = scnprintf(buf, VFIO_DEV_DBG_LEN, "%s\n", + "Error\n"); + } + + return simple_read_from_buffer(buffer, count, pos, buf, len); +} + +static const struct file_operations hisi_acc_vf_state_fops = { + .owner = THIS_MODULE, + .open = simple_open, + .read = hisi_acc_vf_state_read, +}; + +static void hisi_acc_vf_debugfs_init(struct hisi_acc_vf_core_device *hisi_acc_vdev) +{ + struct pci_dev *vf_pdev = hisi_acc_vdev->vf_dev; + struct device *dev = &vf_pdev->dev; + int ret; + + if (!atomic_read(&hisi_acc_root_ref)) + hisi_acc_debugfs_root = debugfs_create_dir("hisi_vfio_acc", NULL); + atomic_inc(&hisi_acc_root_ref); + + hisi_acc_vdev->debug_root = debugfs_create_dir(dev_name(dev), hisi_acc_debugfs_root); + debugfs_create_file("state", 0444, hisi_acc_vdev->debug_root, + hisi_acc_vdev, &hisi_acc_vf_state_fops); + + ret = hisi_acc_vf_debug_create(hisi_acc_vdev); + if (ret) { + dev_err(dev, "failed to alloc migration debug node\n"); + return; + } + debugfs_create_file("debug", 0644, hisi_acc_vdev->debug_root, + hisi_acc_vdev, &hisi_acc_vf_debug_fops); +} + +static void hisi_acc_vf_debugfs_exit(struct hisi_acc_vf_core_device *hisi_acc_vdev) +{ + if (hisi_acc_vdev->debug_migf) + hisi_acc_vf_debug_release(hisi_acc_vdev->debug_migf); + + debugfs_remove_recursive(hisi_acc_vdev->debug_root); + + atomic_dec(&hisi_acc_root_ref); + if (!atomic_read(&hisi_acc_root_ref)) + debugfs_remove_recursive(hisi_acc_debugfs_root); +} + static int hisi_acc_vfio_pci_open_device(struct vfio_device *core_vdev) { struct hisi_acc_vf_core_device *hisi_acc_vdev = container_of(core_vdev, @@ -1194,6 +1485,8 @@ static int hisi_acc_vfio_pci_open_device(struct vfio_device *core_vdev) return ret; } hisi_acc_vdev->mig_state = VFIO_DEVICE_STATE_RUNNING; + + hisi_acc_vf_debugfs_init(hisi_acc_vdev); } vfio_pci_core_finish_enable(vdev); @@ -1206,6 +1499,9 @@ static void hisi_acc_vfio_pci_close_device(struct vfio_device *core_vdev) struct hisi_acc_vf_core_device, core_device.vdev); struct hisi_qm *vf_qm = &hisi_acc_vdev->vf_qm; + if (core_vdev->mig_ops) + hisi_acc_vf_debugfs_exit(hisi_acc_vdev); + iounmap(vf_qm->io_base); vfio_pci_core_close_device(core_vdev); } diff --git a/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.h b/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.h index 67343325b320..ae2a686c2e4d 100644 --- a/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.h +++ b/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.h @@ -4,8 +4,11 @@ #ifndef HISI_ACC_VFIO_PCI_H #define HISI_ACC_VFIO_PCI_H +#include #include +#define VFIO_DEV_DBG_LEN 256 + #define MB_POLL_PERIOD_US 10 #define MB_POLL_TIMEOUT_US 1000 #define QM_CACHE_WB_START 0x204 @@ -49,6 +52,14 @@ #define QM_EQC_DW0 0X8000 #define QM_AEQC_DW0 0X8020 +enum mig_debug_cmd { + STATE_SAVE, + STATE_RESUME, + MB_TEST, + MIG_DATA_DUMP, + MIG_DEV_SHOW, +}; + struct acc_vf_data { #define QM_MATCH_SIZE offsetofend(struct acc_vf_data, qm_rsv_state) /* QM match information */ @@ -111,5 +122,8 @@ struct hisi_acc_vf_core_device { spinlock_t reset_lock; struct hisi_acc_vf_migration_file *resuming_migf; struct hisi_acc_vf_migration_file *saving_migf; + /* For debugfs */ + struct dentry *debug_root; + struct hisi_acc_vf_migration_file *debug_migf; }; #endif /* HISI_ACC_VFIO_PCI_H */ From patchwork Fri Oct 14 02:57:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: liulongfang X-Patchwork-Id: 2467 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp589842wrs; Thu, 13 Oct 2022 20:09:05 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4U9WycbpUZMyPkP5Xf/m/TCcum6IG5lyWlnlwnFmTVqk6qRvNWAZr1nQjkqueCZOWhq/6X X-Received: by 2002:a17:902:6bc5:b0:183:4bef:1b20 with SMTP id m5-20020a1709026bc500b001834bef1b20mr2945802plt.158.1665716945532; Thu, 13 Oct 2022 20:09:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665716945; cv=none; d=google.com; s=arc-20160816; b=O/P4xiWm9MzGJlUwVv9jDVnzaFCFhElvu+E/i0AHhDd1vomHksIHxbEMHnxO9m0IS8 GiqtphZel0QFVH/aFh83ITLi7noUk0TOQSMrT5UDTCtxbsxcj2gtAo6nkJT9p5ami0aH a8Hzvmf03gCDA+ILWtHYzKJd0pfqsZEgmTOTqnb7t5qeB1UQTkcQHle1HVjJwOmhmscZ ZFUF/DEFaIo9kIGFlyUYr9OoDuPjhOcV/s3jnGe843F2aligB7CAcLZlWuzIegv1A5UN Ozn1GoMtgKr7AqwRBu1RpMUBOQvcWuzXV1ykSQNDEQVkcBlgekvyjQ8ua3J2rd7mbaRs uKwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=2POO1j2v/FWv3KNpD3HeAL6g+GIZOVeFUVEiyQID1JM=; b=W2YvvcvW6MFj1nXxQDjgKsAqbNrS4C0gYWiQBnXh0S1/h7gZ+3LOe8U0t3QMf4cYOB o708mPzcGAjkvGoZIDys4iNf2KJ1TGWgVfFTAf1Q6eTT+uSlUtwACjuFEApy+J7QkpBG eeDgS5OCG5XEgV0ijzxwlwuLLyDx0YbVqtLqjXqI5bC0MCcAwMy6gGHd+QQtKZvzTF8B VwLBzDq0Nqw3QOZ81MT+F9hGaX5JN36vGrrKgge+Kp8XaCtyXNRnfn/7f6n3U/B6IqVx 6AUSX5yaYJEr89MfEGMa6e8+jb/QZszbh06Ixl+TkrpDU8j+PlKX4PJ3kHjmx8xG47xL MoIQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 38-20020a631466000000b0045af77fa685si1401449pgu.235.2022.10.13.20.08.51; Thu, 13 Oct 2022 20:09:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229708AbiJNC7b (ORCPT + 99 others); Thu, 13 Oct 2022 22:59:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229507AbiJNC73 (ORCPT ); Thu, 13 Oct 2022 22:59:29 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E062B15F939 for ; Thu, 13 Oct 2022 19:59:28 -0700 (PDT) Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.53]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4MpWFk3Rqbz1P7Pc; Fri, 14 Oct 2022 10:54:50 +0800 (CST) Received: from kwepemm600005.china.huawei.com (7.193.23.191) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 14 Oct 2022 10:59:27 +0800 Received: from huawei.com (10.67.164.66) by kwepemm600005.china.huawei.com (7.193.23.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 14 Oct 2022 10:59:26 +0800 From: Longfang Liu To: , , CC: , , , Subject: [PATCH 2/2] Documentation: Add debugfs for hisi_acc_vfio_pci Date: Fri, 14 Oct 2022 10:57:57 +0800 Message-ID: <20221014025757.39415-3-liulongfang@huawei.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20221014025757.39415-1-liulongfang@huawei.com> References: <20221014025757.39415-1-liulongfang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.164.66] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemm600005.china.huawei.com (7.193.23.191) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746630812020708728?= X-GMAIL-MSGID: =?utf-8?q?1746630812020708728?= Add a debugfs document description file to help users understand how to use the accelerator live migration driver's debugfs. Signed-off-by: Longfang Liu --- Documentation/ABI/testing/debugfs-hisi-migration | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Documentation/ABI/testing/debugfs-hisi-migration diff --git a/Documentation/ABI/testing/debugfs-hisi-migration b/Documentation/ABI/testing/debugfs-hisi-migration new file mode 100644 index 000000000000..36f0882c3a52 --- /dev/null +++ b/Documentation/ABI/testing/debugfs-hisi-migration @@ -0,0 +1,16 @@ +What: /sys/kernel/debug/hisi_vfio_acc//state +Date: Sep 2022 +Contact: linux-kernel@vger.kernel.org +Description: Cat the status of the live migration of the current VF device. + The status of these live migrations includes: + Error, RUNNING, STOP, STOP and COPYING, RESUMING. + +What: /sys/kernel/debug/hisi_vfio_acc//debug +Date: Sep 2022 +Contact: linux-kernel@vger.kernel.org +Description: This debug file supports "cat" read operations and "echo" + write operations. The read debug file operation will return the + command description of the write operation. By writing different + commands, different test functions can be performed. + The specific operation method can be obtained through the + "cat debug" command.