Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1410065rwi; Fri, 14 Oct 2022 18:45:33 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7QakO65zxpd8a50v2ert4IGOn39eNGWfmaAWUS3nRiD2TzttetyXwfXolz7NWL4+d/yr/D X-Received: by 2002:a17:906:4795:b0:787:434f:d761 with SMTP id cw21-20020a170906479500b00787434fd761mr529133ejc.597.1665798332789; Fri, 14 Oct 2022 18:45:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665798332; cv=none; d=google.com; s=arc-20160816; b=Z/QBWe2GvsVskXsNTNcV+i/oe5MYwLWaAAscPzgdF6meukq08rq0xcMDqIs8wQOas7 5wxF7GdLNg4hfpB2dF4CnC/8yKwYpfVpXPFtNg9rXW1uSs6K2+N2oNXzPq+rSXB64pzJ i7CFrtEySVMDiBN8mmeqdNCJNOL1ARR8M9jJUtqeChxTvbQAP/whUAZkObDbFszst417 EatNe2JZoNiYfM2kHR5npM54UvQJKPoX3bq5yPX6NJ/SsSuT8uOnzJicopXSc4fj00zL t6qlsCMxQWAlyonlqwF+m1aMOzXPTlYTbHHSNEuUKcexKc0ofVs789AcZ6rvuK9zgR7f BJHQ== 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=vOlMpke++4HaarffVuvB9eDntnkJMsC3YKO9uDP3n5M=; b=kJl/79j4RJ3iDNxTJDUkW5f8JuRk/naDpx9wOh+abdEFdXSUkEbhQZo5JQt2tOf2RD jdAQB243qFYx3RYZaQ9JyHn/6+cnJ8yO5gsri2mpO9p3LaPJg+8ZGWAph/LbR1fz4SOX 96udrsbumLLDAsaqIOpheb1PJsKwaWwb8M/1oUbEwqB2j7S9jbKeUcWizFvzVv3x9syj GxNzKxkPRjS7QUxoT9gRwgqnLd0da2elCtiiiokiVPdJD8yfuGRyd2HNDctQ22CuYT7Q 3r/RzulKfiptzTT8ZjzRRUFLQKlLAS3csPgZsQpZK+9AQa2FkB0wSN3GnioPAjiJLJ39 caeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=qC1trwwU; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j24-20020a508a98000000b0045c02b5b651si3091303edj.545.2022.10.14.18.45.03; Fri, 14 Oct 2022 18:45:32 -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=qC1trwwU; 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 S229539AbiJOBdz (ORCPT + 99 others); Fri, 14 Oct 2022 21:33:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229485AbiJOBdx (ORCPT ); Fri, 14 Oct 2022 21:33:53 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 688326C945 for ; Fri, 14 Oct 2022 18:33:52 -0700 (PDT) Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 29F0u44G027651; Sat, 15 Oct 2022 01:33:48 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=vOlMpke++4HaarffVuvB9eDntnkJMsC3YKO9uDP3n5M=; b=qC1trwwUuMN/SXSDnqqSRS2GOdeB0onnfl8IZO8rtYIGw4wzZjvmF6ZPOlCw5SYraZnI 9cTCXgG1X7zwhlzP7gCR78jFdJDy4vQ51ClnDRJBWGtOTzq76kisy+VYaZVpmI7jTT6l sIjBKKewQdwImQZclOzmcQucL8mOxahnakThe4lgy5JPgVAz8B57h4p/z4/5gEkadX13 JBuHWJ2J7b/+OMODwYBcKzxz9fvcVIaxJngkOAbX59g3omdGZ2/wjIIKFPs81uYgGFzz fHMFJ4qgJvkC7o+MRGwZ9wC1UscwBVhP3ePmCBMIPikoKmglbohTWRdRElqCX0+WgryK Tg== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3k7acvh0yg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 15 Oct 2022 01:33:48 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 29F1X476008564; Sat, 15 Oct 2022 01:33:47 GMT Received: from ban25x6uut24.us.oracle.com (ban25x6uut24.us.oracle.com [10.153.73.24]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTP id 3k7ka180am-1; Sat, 15 Oct 2022 01:33:47 +0000 From: Si-Wei Liu To: mst@redhat.com, jasowang@redhat.com Cc: virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/4] vDPA: dev config export via "vdpa dev show" command Date: Fri, 14 Oct 2022 17:28:06 -0700 Message-Id: <1665793690-28120-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-14_13,2022-10-14_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 suspectscore=0 adultscore=0 mlxscore=0 malwarescore=0 bulkscore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210150007 X-Proofpoint-GUID: iEyrSUJukol4q0K70kZ5zIxNTIl28BYJ X-Proofpoint-ORIG-GUID: iEyrSUJukol4q0K70kZ5zIxNTIl28BYJ 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: X-Mailing-List: linux-kernel@vger.kernel.org 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 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, "mac": "e4:11:c6:d3:45:f0", "max_vq_pairs": 4 } } } --- 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(-) -- 1.8.3.1