From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (xvm-189-124.dc0.ghst.net [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id ABBD6A09FF; Tue, 5 Jan 2021 14:42:04 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 41E0216083F; Tue, 5 Jan 2021 14:42:04 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 4315B160834 for ; Tue, 5 Jan 2021 14:42:02 +0100 (CET) IronPort-SDR: +LaOSTx7rkvGusWjgvUecXiK9pfjrMlUGk+qHZ0zpsV0T8z4xiQ/mRUZF560Ild7KlHlzriYY1 vMxcAKZXyX3Q== X-IronPort-AV: E=McAfee;i="6000,8403,9854"; a="241188348" X-IronPort-AV: E=Sophos;i="5.78,477,1599548400"; d="scan'208";a="241188348" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jan 2021 05:42:00 -0800 IronPort-SDR: fLboWVS/g9zdioe1+6qeBY+a1mL7HhA000WNFD6Smnx/6JOXJoYJeEDGTEaGmfOLEX2nSMesUt bDksEal9tWqw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,477,1599548400"; d="scan'208";a="462301266" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmsmga001.fm.intel.com with ESMTP; 05 Jan 2021 05:42:00 -0800 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 5 Jan 2021 05:42:00 -0800 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Tue, 5 Jan 2021 05:41:59 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx607.amr.corp.intel.com (10.22.229.20) 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, 5 Jan 2021 05:41:59 -0800 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.106) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Tue, 5 Jan 2021 05:41:59 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ap+i4sjWzldE+b94Yx7YkGhMcV7FA200XNVjpBkg/eMUf9rJdX0ZYbnN4anrnFAP+w27nqE9GMP0x9TCJFP65k8KZcvQP8dpDHVE75vK6PKqjEnDuQYhTKwsT02Xo1grQmD/5l76OZrKMkpsGBEZMEJ15uPpXq8kqmS3yjUYlIWNGMeH2w8uwl3nWszHW89VKYO12TRR1vggY17ycg+G6frbCqDq6bYRzWPFk8Barz1g7GdvGsB9znjTv8J5/edLTu8EfcVVoGc/trlzkZUCPjt8Rr62ZDxvysxyvi4Rw9Im5/cKNTnQkgZPhFnORfKC5N6ffntPuJBYHSnGZu/AGA== 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=EPEl+10F/KQD5L8O3ioPL0G7zQGpt3OdpsYOu1gEneM=; b=DKST8ptTIZ7VRjctKwFUUGKXj0jYIqSR6A4VGzHkrA2IFafK7HWP6ZybyYfnJnYXrJxZmB6ME3gXW/4V/0I1PUVOnEkSXb0ZQ+AL6yFaC/F9IjAIoZuelc2CpIQBwsnb3FnrwYFLXpvNufn2ZQkjqe858wu42vRNmdCIYnFH0lf4Ui17BLRYYwrKJ7zoUX0w7AzrAu2mg/3PMfc85sgeVhh8saTgsUdHt0TE/3XTvgJm6RD6E+yL+aI7YZ6Jn97FZeGrA+KQgCnzbqYobp6ACvbxyNox5o3Ot27xXSnTLYtmvuLeUPB+Si+1lD9XA+lR27krTMCyWc92ZdbLnCThuw== 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=EPEl+10F/KQD5L8O3ioPL0G7zQGpt3OdpsYOu1gEneM=; b=kp7xb+q73epoPNaEaqzGLAKkmOUN03zC3orVI8W3/NaCOCkKOOVq7MMEMjLmKrxOd0W1qHTxPEfJov8D8pOR7E7kYdGcMhg+DEh2kEMOILc0O0if0+rogDrpXBG5wGdUnNumQlGZlaSyeH+zlsinHt3l5r3X0YSks40yLPrsRbw= Received: from MW3PR11MB4587.namprd11.prod.outlook.com (2603:10b6:303:58::7) by MWHPR1101MB2173.namprd11.prod.outlook.com (2603:10b6:301:5a::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3742.6; Tue, 5 Jan 2021 13:41:58 +0000 Received: from MW3PR11MB4587.namprd11.prod.outlook.com ([fe80::58a3:c2e5:a891:2881]) by MW3PR11MB4587.namprd11.prod.outlook.com ([fe80::58a3:c2e5:a891:2881%7]) with mapi id 15.20.3721.024; Tue, 5 Jan 2021 13:41:58 +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 v2 4/8] emu/iavf: add vfio-user device register and unregister Thread-Index: AQHW1dJWZX5Mm0GRC0mJbGQHuBds66oZJMTg Date: Tue, 5 Jan 2021 13:41:58 +0000 Message-ID: References: <20201218074736.93999-1-chenbo.xia@intel.com> <20201219062806.56477-1-chenbo.xia@intel.com> <20201219062806.56477-5-chenbo.xia@intel.com> In-Reply-To: <20201219062806.56477-5-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.55.46.46] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 7a67fe7c-2b69-440d-376a-08d8b17faca2 x-ms-traffictypediagnostic: MWHPR1101MB2173: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: EoeBoIlAoT464/OA2pG0mYSi/tXRBXcQZPK247a2Xe3cNM0RWzwU6lkCd5EHZ8eMAekkwqVknrXSlCKcbM7QGJ8SfVCo1hAMWB2vMsX+G9T6TAYQY5lPEmj8gDNmq2M5J0aU8Qx0qF1i0rTWz4Ld0MaTyfq+b89oLzETk3edXv85EYwkHHM1v2Z24dT+7KwLBQX/nKm6mCu/6nwUc3/SFDERpqlsKHxIYNq+4KVYzWJz619jFJlxw4enGlkA8OWLnHadoTQNeCcAUQoO+5bcBQdwbzGvsZszscOcp9tYqfn2g4abKT6/2RltZfIGVGp70gUpRF8xImfiKllCySyepezUDfohvtehylKqRIBtuHM8KBRi6dxAU8z/wzH21GPHWAbttveQEsr99jiAYYkv3g== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW3PR11MB4587.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39850400004)(396003)(136003)(346002)(376002)(366004)(110136005)(54906003)(64756008)(66476007)(6506007)(8676002)(316002)(66556008)(66446008)(478600001)(66946007)(5660300002)(33656002)(76116006)(8936002)(4744005)(83380400001)(71200400001)(52536014)(2906002)(4326008)(186003)(55016002)(107886003)(7696005)(9686003)(86362001)(26005); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?N68bAboAPCh3+xjFha0DO9UXDIrbUBAORnm654veuH+xg7ENzF8IthT1AtaB?= =?us-ascii?Q?EhwPFO/TqBRfhAsZWHJ78UWDtzm7SgKX9Y37r/DzJI1x3i2wOiIX09mwuE2t?= =?us-ascii?Q?r7vKo1H2hVv7+RDPxxb7eelSCiIoH/GDFzVuPWVjJF8x697S/aXqJmBSTahv?= =?us-ascii?Q?yXx0XnAMoyyU5I3+KyFegjSXxC+cpGJwvAdfare7bF+BciCOFGi2ifrvulip?= =?us-ascii?Q?+uNnUJiZYyRbSR5r2l1e8X/kgTq3bmMK4UFseChVB1Tyv4wrRlLhyNHm/ha7?= =?us-ascii?Q?N4ee3+6gyPxniGXZJxmMczEcbO8grqVhubrIXo8pmRKE5C/78La19ujN/YVl?= =?us-ascii?Q?KN/6WZ0375HceYE5UIdBJL3cSqk0XE25Hy+h3bcE6Fh8TR20IWuBqawlADtc?= =?us-ascii?Q?dQsKxdcC/lCnvr5rz8wLciarbBcJNC1JInemMaHAvDb2hrUE1bjDQd9GlHbq?= =?us-ascii?Q?M+v2ozky179IPMNUwh/VT+5pJw6JnNOI4vaMWkgJ/HYLQ5ZpMjrNOTfe0uO1?= =?us-ascii?Q?M+LgYWd53MHv4DoWkWSfSdBIV8HHAvJJSX6R5gmXQUTaYQf41wsi1hp2Ec1f?= =?us-ascii?Q?9NqkGPa+GW4VnSaw5+Bz83w4zcN7dSlhujJOKgBPjtxsQb10gfQML86kawz/?= =?us-ascii?Q?vV0xInryOBhLqXbnFbusk538JRrHm4qgQDuuh1asnp4bMwgSnjn6bP+/uMEk?= =?us-ascii?Q?ZpK8wOX1jGGx7OLC+5Ni+x+NdmN7wevFQzBd8POV8Qf3d+dnLBwfMhpIxnGq?= =?us-ascii?Q?cq+3apArPesW8Ejkgm+Un5XgWEUZb+7MaxImn3QF7XI8ze+JepW5vPScTrGf?= =?us-ascii?Q?NV38YdYSoS17iOtXtnSQaEi1XmWdyXpHR/itfCKWmZaCEVmt0/j4aS2/EyyL?= =?us-ascii?Q?MTWAmt1kOIBZ+lxPRhtvK/78zST41FeTb6N45BPy86voGTDjdw+0bqnBY2bd?= =?us-ascii?Q?kITxArejnOkT4DMEpzRA8YX1wGGupEGX7BCMhWsXCF0=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: MW3PR11MB4587.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7a67fe7c-2b69-440d-376a-08d8b17faca2 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Jan 2021 13:41:58.7473 (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: wtUa6gItyyjojosjhhd2yueyEKEADCDuJVanl74mZK9AEfuOBsx6yurHRwWNhnh74piHoS5S8gVp/l2nNwNZ1A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1101MB2173 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v2 4/8] emu/iavf: add vfio-user device register and unregister X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" > +static int iavf_emu_update_status(int vfio_dev_id) { > + struct iavf_emudev *dev; > + int ret; > + > + dev =3D find_iavf_with_dev_id(vfio_dev_id); > + if (!dev) > + return -1; > + > + ret =3D iavf_emu_setup_mem_table(dev); > + if (ret) { > + EMU_IAVF_LOG(ERR, "Failed to set up memtable for " > + "device %d", dev->vfio->dev_id); > + return ret; > + } > + > + ret =3D iavf_emu_setup_irq(dev); In update callback, irq fds will be reinitialized here. Think about if the = update happening during mailbox communication, the eventfd of mailbox will = be cleared without notify. > + if (ret) { > + EMU_IAVF_LOG(ERR, "Failed to set up irq for " > + "device %d", dev->vfio->dev_id); > + return ret; > + } > + > + dev->ops->update_status(dev->edev); > + > + return 0; > +}