Message ID | 1666137032-28192-1-git-send-email-si-wei.liu@oracle.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp61434wrs; Tue, 18 Oct 2022 17:58:58 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7Sv+4A1P1bGGKCI44FLQ/NUwNH6eAzNu3eJ9AZ6Y2DYWwCxQ4o9UZSp9sq+UP6h+YA4lL4 X-Received: by 2002:a17:906:fd82:b0:770:7e61:3707 with SMTP id xa2-20020a170906fd8200b007707e613707mr4421826ejb.143.1666141138641; Tue, 18 Oct 2022 17:58:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666141138; cv=none; d=google.com; s=arc-20160816; b=QD0x82wajlTHP7OWl+hNg7qVaRnuNSltmigXm8m7FFLNqxwVVlNsp1pEWBUPR++j7U t8OKWr/mOBqDjKP0QWnBoVn0etKVJNr+H/DcWtkdpe5fGS1/eXFPeT3FASRqtMCzOlk8 VL5RJmsjsKGUzJDTEiBykM/DstnXGjaoqdmF94PVzeaCnoa6sr+B8qv/VqjAOgNb/BiN tV6IL9hmbjsBK6Gs6iZw5SbDOP6sxgWz9qXGQDiVj9hJ5Jfw/q2jaCflJyeJ4hs1GRy4 F3VyPdcxXssAEsSV8lIsiglmjS1KFYvn4bIQz6XQjr9wz7nq1zK3hcwb3pfS4y+Hj+lp ZJ7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=xseYydpUfLuBneMMsSa+Z0sYvhToqtWp3Es7rP3ZOkY=; b=e06IraX7b/dANTpK8pcS5bXcqg5b6M78xg4SnePrv/uFyUk3ETPDVzx6t6FJXtHg1a ZW6qGwGnBAmER/rZIgeV5ZsY1Q9KZWAZnk3Dz8TCtzPkab2YSs+dQNHP8Mdr46d+h6ET ujtf3wqSlBIWbJVIsXYArBjkB5RjDGaqcgpoMjQN1HpTEavzu5MiItkNAAj4+AgblGgg gBvaHKmqHAV+gml03lPAsASCOCj4GeK3LPQdtUdXzrGlZ4w0gdn1P5JZabgt9RCjKaj0 s6trBF8Fbd1QNvVKkFc3UzUFL1+ES05n9ZpLCap8lNgg/Fgd4DSnTf2AfeB9CffJE5ns BJew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b="Ns4P/hni"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a21-20020a1709066d5500b007835897050asi10481738ejt.83.2022.10.18.17.58.33; Tue, 18 Oct 2022 17:58:58 -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; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b="Ns4P/hni"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229893AbiJSA43 (ORCPT <rfc822;samuel.l.nystrom@gmail.com> + 99 others); Tue, 18 Oct 2022 20:56:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229635AbiJSA4R (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 18 Oct 2022 20:56:17 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73F69CA8B2 for <linux-kernel@vger.kernel.org>; Tue, 18 Oct 2022 17:56:16 -0700 (PDT) Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 29INiKMe015121; Wed, 19 Oct 2022 00:56:12 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id; s=corp-2022-7-12; bh=xseYydpUfLuBneMMsSa+Z0sYvhToqtWp3Es7rP3ZOkY=; b=Ns4P/hniUWMcqJSLSbePGUzEHhveRZLxf/c9DFLyMNrK2RGstwtBi9tFMWNS8Kh8I0WH iVClBhowfy6Tl9tYTWZvu4l57QXm8kIhWrx77DBDya8Q7BbjQSMtSsOpL1m23OF+r/AU x1nRMvZAT5IzfHKGrrvIWDeU/7P5T+Id+DmJNw/gtUf5Pmy1t53HkZvE4hANAM/KZHof Uit6DFfvSPrudr45oWJJQ+9CA8Ytli39dIaMuJWp01ASkL3KOz5r7WaDtCaWU/TlJTZ6 7S/Un6VsizuRTVMsxzNOcSg9hSZlSMplnR2XTjr59nb44xX3DCoBHDnUk8uzJvXmow8R 0g== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3k9b7skyyk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 19 Oct 2022 00:56:12 +0000 Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 29ILnUhG016678; Wed, 19 Oct 2022 00:56:11 GMT Received: from ban25x6uut24.us.oracle.com (ban25x6uut24.us.oracle.com [10.153.73.24]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 3k8htgrhfm-1; Wed, 19 Oct 2022 00:56:11 +0000 From: Si-Wei Liu <si-wei.liu@oracle.com> To: mst@redhat.com, jasowang@redhat.com Cc: virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 0/4] vDPA: dev config export via "vdpa dev show" command Date: Tue, 18 Oct 2022 16:50:28 -0700 Message-Id: <1666137032-28192-1-git-send-email-si-wei.liu@oracle.com> X-Mailer: git-send-email 1.8.3.1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-18_10,2022-10-18_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=993 phishscore=0 suspectscore=0 spamscore=0 adultscore=0 mlxscore=0 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210190003 X-Proofpoint-GUID: wa8ifZsHyz8Au8A6iFTXwGt6vEsYk02T X-Proofpoint-ORIG-GUID: wa8ifZsHyz8Au8A6iFTXwGt6vEsYk02T X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747075610719739479?= X-GMAIL-MSGID: =?utf-8?q?1747075610719739479?= |
Series |
vDPA: dev config export via "vdpa dev show" command
|
|
Message
Si-Wei Liu
Oct. 18, 2022, 11:50 p.m. UTC
Live migration of vdpa would typically require re-instate vdpa device with an idential set of configs on the destination node, same way as how source node created the device in the first place. In order to allow live migration orchestration software to export the initial set of vdpa attributes with which the device was created, it will be useful if the vdpa tool can report the config on demand with simple query. This will ease the orchestration software implementation so that it doesn't have to keep track of vdpa config change, or have to persist vdpa attributes across failure and recovery, in fear of being killed due to accidental software error. In this series, the initial device config for vdpa creation will be exported via the "vdpa dev show" command. This is unlike the "vdpa dev config show" command that usually goes with the live value in the device config space, which is not reliable subject to the dynamics of feature negotiation and possible change in device config space. Examples: 1) Create vDPA by default without any config attribute $ vdpa dev add mgmtdev pci/0000:41:04.2 name vdpa0 $ vdpa dev show vdpa0 vdpa0: type network mgmtdev pci/0000:41:04.2 vendor_id 5555 max_vqs 9 max_vq_size 256 $ vdpa dev -jp show vdpa0 { "dev": { "vdpa0": { "type": "network", "mgmtdev": "pci/0000:41:04.2", "vendor_id": 5555, "max_vqs": 9, "max_vq_size": 256, } } } 2) Create vDPA with config attribute(s) specified $ vdpa dev add mgmtdev pci/0000:41:04.2 name vdpa0 \ mac e4:11:c6:d3:45:f0 max_vq_pairs 4 $ vdpa dev show vdpa0: type network mgmtdev pci/0000:41:04.2 vendor_id 5555 max_vqs 9 max_vq_size 256 virtio_config: mac e4:11:c6:d3:45:f0 max_vq_pairs 4 $ vdpa dev -jp show { "dev": { "vdpa0": { "type": "network", "mgmtdev": "pci/0000:41:04.2", "vendor_id": 5555, "max_vqs": 9, "max_vq_size": 256, "virtio_config": { "mac": "e4:11:c6:d3:45:f0", "max_vq_pairs": 4 } } } } --- v1 -> v2: - Revised example output to export all config attributes under a json object --- Si-Wei Liu (4): vdpa: save vdpa_dev_set_config in struct vdpa_device vdpa: pass initial config to _vdpa_register_device() vdpa: show dev config as-is in "vdpa dev show" output vdpa: fix improper error message when adding vdpa dev drivers/vdpa/ifcvf/ifcvf_main.c | 2 +- drivers/vdpa/mlx5/net/mlx5_vnet.c | 2 +- drivers/vdpa/vdpa.c | 63 +++++++++++++++++++++++++++++++++--- drivers/vdpa/vdpa_sim/vdpa_sim_blk.c | 2 +- drivers/vdpa/vdpa_sim/vdpa_sim_net.c | 2 +- drivers/vdpa/vdpa_user/vduse_dev.c | 2 +- drivers/vdpa/virtio_pci/vp_vdpa.c | 3 +- include/linux/vdpa.h | 26 ++++++++------- 8 files changed, 80 insertions(+), 22 deletions(-)