From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7EADAA09FF; Wed, 30 Dec 2020 02:05:08 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 84DFC2B91; Wed, 30 Dec 2020 02:05:06 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 53C412B8E for ; Wed, 30 Dec 2020 02:05:04 +0100 (CET) IronPort-SDR: tZa3ugcBo9RD07JaTHdW8pRjFC/rr0+ZdbGQO5xH3Uj1ptxw/EOkaceDUzrurdBYC+9ygYkKSR 1YiSKa5U1Gug== X-IronPort-AV: E=McAfee;i="6000,8403,9849"; a="164266726" X-IronPort-AV: E=Sophos;i="5.78,459,1599548400"; d="scan'208";a="164266726" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Dec 2020 17:05:01 -0800 IronPort-SDR: j3Ku/LYj9k0wFKiPyJNAe/h3FRR5NoVmDTx0AhyG1PubtSOweBXE1Mo58vkcUdcpEaYQLbRyIT yUwV/ECphVAA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,459,1599548400"; d="scan'208";a="359068164" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orsmga002.jf.intel.com with ESMTP; 29 Dec 2020 17:05:01 -0800 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 29 Dec 2020 17:05:01 -0800 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx607.amr.corp.intel.com (10.18.126.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 29 Dec 2020 17:05:00 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Tue, 29 Dec 2020 17:05:00 -0800 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.173) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Tue, 29 Dec 2020 17:05:00 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aBanPGvYcA4VFJMgFCdeztXyCwnA+uX0tQs0mKchk6iJwguvt67ENet7wVKRhI3cyP4oepJE+60D3P58iu14D1jYuz0vsB1Cu8pTOOMexBqrYWNyaiI5aTMtF6PSW3pEgTrirLQUIbIc8TNO37rVrgfR9cCsjeGqlcb59OiLe4wfuQmpgbmL9Wd1QYJyrcryhw3SQkyt007/rhH7v6EsMCVvfOr+j45QKLvuSQc7bvLBASEjegB9khQjeHZ4O8joIdom1HFUNltpYakzO/0rVmS3KQBBTMz6KzCa3jyIw3wExn3d6vqqyvTCoYmHJkUvss3xMIgbaOkcB2h2lde//A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vqN9wDu5nXlZUBFX6HjUaNiREd9E1C7tvrMfmRwVaSU=; b=FcgsDWDoEk2Ift/aJrV01lRtu10g+iAJInDtrUhCxfikVGYic9XIDxWyn661cRHLJbCzEQ/ubZlhvF2u3T6atzF/F4tl9Fg7nmBMLxD4BqOtmyR63dpav4xsPuceIMWdWsgS9mhJG1xd6kzBFBzLU6FC8MBcJtNb3rBokdJcedhv00C9WLi1xM1Q60ouVYKR1OY3D9DfnBy8rAGjta1U6raBBNmCBNbCVqEarmhpwrjxB5uK0MJFzicMPeeQX++GZBdRKvcSceo05IE6uW+uhjJxLC/O/OY+Bgrxo2vko7F38DGHXgRF+Vf6VJtIU9l+dsA+aTz45oyUutbPEJwj6Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vqN9wDu5nXlZUBFX6HjUaNiREd9E1C7tvrMfmRwVaSU=; b=Bugu6wKWoFa23XRhR2nlxULJ46lOePIIlcNAE44sZE4VPkpHanFPa9G0Z1Qb2254U3OarAnTOms7SLcZKtM7vtHA1QzAWhpDt51NddLYy7uYrm6wYkVvsJ2/beVSQuwUczMFjo5Xq+qktn27o3U/AUspBxk0FLUUsmdTRzwG8TQ= Received: from BN6PR11MB4052.namprd11.prod.outlook.com (2603:10b6:405:7a::37) by BN6PR1101MB2241.namprd11.prod.outlook.com (2603:10b6:405:51::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3700.27; Wed, 30 Dec 2020 01:04:59 +0000 Received: from BN6PR11MB4052.namprd11.prod.outlook.com ([fe80::5cba:8ba9:1710:dd4]) by BN6PR11MB4052.namprd11.prod.outlook.com ([fe80::5cba:8ba9:1710:dd4%7]) with mapi id 15.20.3700.031; Wed, 30 Dec 2020 01:04:59 +0000 From: "Wu, Jingjing" To: "Xia, Chenbo" , "dev@dpdk.org" , "thomas@monjalon.net" , "david.marchand@redhat.com" CC: "stephen@networkplumber.org" , "Liang, Cunming" , "Lu, Xiuchun" , "Li, Miao" Thread-Topic: [PATCH 5/9] vfio_user: implement interrupt related APIs Thread-Index: AQHW1RMGPFzPe51nSk++KUuJPT+B5KoO5JXA Date: Wed, 30 Dec 2020 01:04:59 +0000 Message-ID: References: <20201218073851.93609-1-chenbo.xia@intel.com> <20201218073851.93609-6-chenbo.xia@intel.com> In-Reply-To: <20201218073851.93609-6-chenbo.xia@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-originating-ip: [192.102.204.37] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 9699e9d0-0c6e-42e3-94d6-08d8ac5eee08 x-ms-traffictypediagnostic: BN6PR1101MB2241: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3276; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: l/KzbpG6/XqJ7BCdhggO53rtOwZYjbiXJLmzj7tbI+6tW4dLN/0S3B9oswpkkXqTgbvfcgeTjoSHjfZxDYJSwpowQCj8aynUvlD7Xwc+zbM3b0YEXVyi3NDa4FtoHbHzugHGFZ0Z6UAIGNMUYhpPw0SAx4NApZ41sgrnbwRLLwsfsGPgPRXU8sKgw5PQ5uOemoUWpC/Vcj7hKgVZ1yHu2IGoSJMPwLMuKQ+l3TZjnxO2kgVXsjXnKZJhCWCzrSmTSv5rog5+G2p9j3dIIGjr6EYcoAHhV0X0W/R3wPd26E2b3xdKzoWw+inI7TZWwFoJRKoDkaH9yGaXsYhhAaZqck5w6frQB498vq/qD4Kr2ngVEOe+BTgdodTFUrNJrJYk3XPBr2UsFQha0cNsXTvnTA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN6PR11MB4052.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(346002)(39860400002)(366004)(376002)(396003)(4326008)(9686003)(86362001)(316002)(71200400001)(6506007)(66556008)(5660300002)(186003)(83380400001)(107886003)(64756008)(478600001)(26005)(76116006)(52536014)(110136005)(66446008)(33656002)(8936002)(55016002)(66476007)(7696005)(54906003)(8676002)(66946007)(2906002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?Y5e5cXmozZCtad5F5Lh476aMuVFN+P6UPMGsI/xscYujBzAgpzw96mYr1MQI?= =?us-ascii?Q?ZJRnfKKOzQttrBbD/0SrQHt5guC2ZufGkeDlGfaxrqJjZKW38M1xzlxLz0wV?= =?us-ascii?Q?fShcqRyxYq47pF5IF5oM8342dav4n1iaVIqBy4PIYJXjsj02FpJy5sGVbpCt?= =?us-ascii?Q?SMf7ZtuC2vUB+U7BR4xCudRWq3yt7sIm2U9bx4xhH5otfH65OnlA2Ga60l15?= =?us-ascii?Q?QBuUS9fip9ykHe6b+lcGiXEPGgO20oS1upE0gDuz5e+GPkjQALHayqXeQaQD?= =?us-ascii?Q?1KEVDW+Wol3wOGnsE550sfw2QWqufFhudlZ9uScZQB8SOlgpbeZVLnfYuTFb?= =?us-ascii?Q?r5zM2gRlRhGwr4itI2VM2mVOpcxKiPQGjwf43qGbRBsedycI24Mvq1Dpb5rL?= =?us-ascii?Q?mpBEw5ZnC1kGXmPhSjm3bpsm1JQSGOlDjODL3yBrl4ZLK8ceX7YXxqe24+u6?= =?us-ascii?Q?aPpwy568UbhZ8A3mcWvTwwQAJjYbe1lsimvo/kMmMZD2PvM7zcT/FkRajIdu?= =?us-ascii?Q?Fj/DZ1VtH6u3GD38hFQfqRqvrnJfL1AKPCZnhZtfyiNjPx77CuSkGyojbKgy?= =?us-ascii?Q?t4DrY0cYP7iVQq+fxrJiMtAnTYTGt55iCVKFiUSXjf00/zMofSzy7r3K6vni?= =?us-ascii?Q?LbWclTtNhRIj5+ziluSGdOlLSBPrZdAFfUouBAn+QvHgEe8uKyygn3q7Llvz?= =?us-ascii?Q?IPVS/kRRcXc4DBy7vQ35jtRJllDE1Y3Y3VlmEDsqYAFZD4h5z0NSrB+Xiz87?= =?us-ascii?Q?7yINBqdQemFkMMNa9HxYDcI6rNUEvLT2DXbZoXOYkj1MycqG51y3hvzQFsMd?= =?us-ascii?Q?BQOrfLSBbyChN3S8l9z6cv8s7PUmmP/FPqEnhfD0RQE0Oc9BT6s260hCPGPl?= =?us-ascii?Q?y34TPztSeyIqEG4PaL+347Zlae20ORaJ3nIODiEGe8QJQBqBCqI5CPLcc197?= =?us-ascii?Q?8wMX7HVv83Nglx0Qds6gGahn0bdNH795URKX5yP6U3k=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN6PR11MB4052.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9699e9d0-0c6e-42e3-94d6-08d8ac5eee08 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Dec 2020 01:04:59.1289 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: CCqHO/nJfq4h1MIOZuF6l2z75v8oEabimr9wktQ968d8nHiG0RUyGUrXSfwAPbZG/+/6SKXdszzQ9j92SXcDVQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR1101MB2241 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH 5/9] vfio_user: implement interrupt related APIs X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > if ((cmd =3D=3D VFIO_USER_DMA_MAP || cmd =3D=3D VFIO_USER_DMA_UNMAP > || > + cmd =3D=3D VFIO_USER_DEVICE_SET_IRQS || > cmd =3D=3D VFIO_USER_DEVICE_RESET) > && dev->ops->lock_dp) { > dev->ops->lock_dp(dev_id, 1); About cmd "VFIO_USER_REGION_WRITE", irq setting would cause update_status t= o iavfbe device. Where will the lock be? > @@ -871,7 +1056,8 @@ static int vfio_user_message_handler(int dev_id, int= fd) > if (vfio_user_is_ready(dev) && dev->ops->new_device) > dev->ops->new_device(dev_id); > } else { > - if ((cmd =3D=3D VFIO_USER_DMA_MAP || cmd =3D=3D > VFIO_USER_DMA_UNMAP) > + if ((cmd =3D=3D VFIO_USER_DMA_MAP || cmd =3D=3D > VFIO_USER_DMA_UNMAP > + || cmd =3D=3D VFIO_USER_DEVICE_SET_IRQS) > && dev->ops->update_status) > dev->ops->update_status(dev_id); > } > @@ -898,6 +1084,7 @@ static int vfio_user_sock_read(int fd, void *data) > if (dev) { > dev->ops->destroy_device(dev_id); > vfio_user_destroy_mem_entries(dev->mem); > + vfio_user_clean_irqfd(dev); > dev->is_ready =3D 0; > dev->msg_id =3D 0; > } > @@ -995,9 +1182,9 @@ vfio_user_start_server(struct vfio_user_server_socke= t > *sk) > } >=20 > /* All the info must be set before start */ > - if (!dev->dev_info || !dev->reg) { > + if (!dev->dev_info || !dev->reg || !dev->irqs.info) { > VFIO_USER_LOG(ERR, "Failed to start, " > - "dev/reg info must be set before start\n"); > + "dev/reg/irq info must be set before start\n"); > return -1; > } >=20