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 75DFFA09FF; Tue, 5 Jan 2021 09:34:40 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 034A716077E; Tue, 5 Jan 2021 09:34:40 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id C59C516076C for ; Tue, 5 Jan 2021 09:34:37 +0100 (CET) IronPort-SDR: ldavO1VpCl2jgf4m7K/y6+HVTfMzhc0k7zTFYpz5xs9yW9UYwXSUdAqLZmesJZiZVKlPRuiTZI rdmyPBLiIQGA== X-IronPort-AV: E=McAfee;i="6000,8403,9854"; a="164146215" X-IronPort-AV: E=Sophos;i="5.78,476,1599548400"; d="scan'208";a="164146215" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jan 2021 00:34:36 -0800 IronPort-SDR: uPeYFbWDKi+wsm30REb8QK0Q/Euaxdw1ODLmUtDxe70oGnNAt+enRTynwnFZ/YuQvVfT/46gB0 IDyoteQdkGPg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,476,1599548400"; d="scan'208";a="343074966" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga007.fm.intel.com with ESMTP; 05 Jan 2021 00:34:36 -0800 Received: from fmsmsx601.amr.corp.intel.com (10.18.126.81) by fmsmsx601.amr.corp.intel.com (10.18.126.81) 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 00:34:35 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx601.amr.corp.intel.com (10.18.126.81) 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 00:34:35 -0800 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.168) by edgegateway.intel.com (192.55.55.70) 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 00:34:35 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iqJGLKe0WxGendyWwGoFjE1McDh4zmR3HLZTm6IZn7gLf3McNqx1vMnrx4P1p9YXKkQaCkqTVlhNK7VhAAPwWXOWaOfSRviiTRMNq4fdaqMcNZ7C+k+VbF/paK0HnIL2X2rdibiL5fYAFcuLCiqVuAoDY3QVuHLt603THNHXw//eWe+2VQukvcG1uY24fXefSTtIMnTXIFs1kErPZubAPr7UDYFLX73i+EP+1N3U8DCHkeT/HMAaRYVNedHlBRiDwhFabzyTCCEOj1L9pV61v74I18kdKrHvtoyuIqdz2Oeo/OvebZjVMcMzCy9gTVqOT0eZSN4rJI5AuKFzh6v06A== 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=eGPW4FvLHDXrGqNVsrduag2G6bJA1TrxwkN/6JD1wHg=; b=PKxO/tyz3/Zdp+C94DbPhQH1dqnwhLcfuXLfFrBO3/bgcX871SSorqES2jrA1rNOh+ZisGqspv80tbrSB0V4WIibb5ckndnasgQPzyauVT+iQ4i6J/C7jMCVwtw4frAWisBGZdWXt2vFV73vq3G/xolV1W+OQIBbtaQ9fYFM/8+jSnuOeiyWMIdIbwDw6A9z/1jB1WynpspREqLTSEyeNdBqLC7Y2jiXQkD6ao2PlXXvsou4QrIe+PHbZXe14FUyiqcpsuGfwIZB1YTHMIkgm6UMvi6qOTUu4iqTCQraIUyW/r/G2NPT0yAIN3gSVTGgY9YSVvPWlPsHW1dr0Dw0bA== 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=eGPW4FvLHDXrGqNVsrduag2G6bJA1TrxwkN/6JD1wHg=; b=Pc5Sf1xRGddbgOtueTbKISOsBKMbWiteLZnZMgTF7wSq+X652pTXT/+7mDuoeM38ykvW5RTGX56tfli2kH/2m1QjXpX7V85/EAO2ms7o4Z7kmUzRnScWiosQHN0H3jLwttcG/nWfGHuvgg4ylFigAwNgu96M35PXK9IbYVcMgp8= Received: from MN2PR11MB3807.namprd11.prod.outlook.com (2603:10b6:208:f0::24) by MN2PR11MB3584.namprd11.prod.outlook.com (2603:10b6:208:ef::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3721.20; Tue, 5 Jan 2021 08:34:34 +0000 Received: from MN2PR11MB3807.namprd11.prod.outlook.com ([fe80::4d7f:d51:79bc:e596]) by MN2PR11MB3807.namprd11.prod.outlook.com ([fe80::4d7f:d51:79bc:e596%4]) with mapi id 15.20.3721.024; Tue, 5 Jan 2021 08:34:34 +0000 From: "Xing, Beilei" To: "Xia, Chenbo" , "dev@dpdk.org" , "thomas@monjalon.net" , "david.marchand@redhat.com" CC: "stephen@networkplumber.org" , "Liang, Cunming" , "Lu, Xiuchun" , "Li, Miao" , "Wu, Jingjing" Thread-Topic: [dpdk-dev] [PATCH 2/9] vfio_user: implement lifecycle related APIs Thread-Index: AQHW1RMrGYqrQEl8gEaRNAwo73nP6qoYz5ng Date: Tue, 5 Jan 2021 08:34:34 +0000 Message-ID: References: <20201218073851.93609-1-chenbo.xia@intel.com> <20201218073851.93609-3-chenbo.xia@intel.com> In-Reply-To: <20201218073851.93609-3-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.36] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a1f46c79-71e0-461a-95c1-08d8b154bae0 x-ms-traffictypediagnostic: MN2PR11MB3584: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:486; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: VdCtkZRTVaq/PMtQ1+Ijinn5ZZRWV0spl2iAHBwdZuA4Wp2Ck7mvHtIOBDzcPnlduy7N2SE1BsNiF3gjuF279Y7TgS4wGAeQP4HDYSTsQm4NCW9jci1SU+tPwnYpBLNnYb4viXKkL7Il82O2srbL69amZXYM6wOAAV89F8x8hmVkZ/JPiNEUlM28VD2xrsPxMW9Z3fTMbinU9rAAVTzwAvv9O0zPDSAua30hCYJU2mK0HW7ghWqmqWuXH4bn9yHJgCC61AXYE2zUzYAHWDXkPCFwaT/PmvuXTO6t65JY+QFTdH8sXc8yk8i5cv0d5JFGiDgakILRwi2obwrnpTBVVPHphrK/E86vwKM5t6no3Ibxmf83qZu2LmUiH0S3D/HQxwhsBvr8IbTOjOZtqORuBw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB3807.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(396003)(346002)(376002)(39860400002)(136003)(64756008)(66446008)(66556008)(33656002)(76116006)(66946007)(186003)(2906002)(478600001)(52536014)(5660300002)(71200400001)(66476007)(8676002)(107886003)(7696005)(86362001)(53546011)(54906003)(316002)(4326008)(55016002)(110136005)(9686003)(26005)(8936002)(6506007)(83380400001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?3u6MH2YOpodxSytQ39RwZ9ouqZhdfBBLo7l4X7bNyhTmGw5dOSwo5lobXEaD?= =?us-ascii?Q?tREdL3ZF+2Lkhe1APQJU+zkJ6HQzIpE9QuNH6i96kuYsCQCgTAUTbDiuviPi?= =?us-ascii?Q?l0on3SHy6XStXSmF4oZU7eWknWfogr/Njso+kX8envHD+zDSERAoC7/Mp31r?= =?us-ascii?Q?iDYM75IJ+2dr5KefF2oNv3Mu//FghRdS5bQEFxsJS1Sgx59iU7X7yfMMY5AZ?= =?us-ascii?Q?VhFb84sIDBiYs5HKieEX3I3nQa/PXAUyHu18B/zdcd/okPYBqOmcjFU8Tw/b?= =?us-ascii?Q?Qiy8KqYEApmdY9OsX3uF47ZMhWG+DqfVlpDiIowys8qBSCoAsD17ZWZP1L04?= =?us-ascii?Q?4ustl2/8cNmPcUvT7sSTOb3rc+0JZFjV00mpEInbtaUJKtQ/xLjwra1q1HVq?= =?us-ascii?Q?/iu7t10228VitxWTxiEUntI5UH5IipwA1zlSCqpU6k6iEDpqI8n8oBcCyeWy?= =?us-ascii?Q?UdzcKgkEjea+Lfp5HbTol3ZSE45dZH2GNq7CLO3Ba0pHvzNnw0Td6xX5QBOE?= =?us-ascii?Q?CSq9PIEWEJ3qzLyagjchNps/zrXi1yPola33CoZh25YNj8CquVhXHVo7HlcL?= =?us-ascii?Q?geuMp9GJR4W4tgATRD54H98hx0aAC07by2REYayshbvIJ0YxVEFAkjpZI2X/?= =?us-ascii?Q?Pr6YCvIN1YckbMP4dk3MdEluSIj8Y643z/9r5s9xlQl0iSnEqsbGeFSqmVWu?= =?us-ascii?Q?O3HvxQLFdpbDd5XI9OZPlXVPocXPIbaJLPYzTR8Ob3CHy+yj7YkBG0Ia7wfp?= =?us-ascii?Q?msXpxj5Z/0TeVQkg748GFKXABVqMVdrcI9bOqxV8NvfeFYZW72j9g4mu916I?= =?us-ascii?Q?/gzYNCf7ubd481X3E5VW0l0l8aovCREIHJ+3Rij4UQ3FRFaZVqQ6lbfkOuOB?= =?us-ascii?Q?/f7w9P63SzHYgrwFDkf76KBwxtbNFfTZhpTRxjV3YLo7a4stgbxVRW8TRegd?= =?us-ascii?Q?vzf+Fpf8lu/3UOKf/4uPo5gidlc50pJnkc2s1I3mwp4=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: MN2PR11MB3807.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a1f46c79-71e0-461a-95c1-08d8b154bae0 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Jan 2021 08:34:34.1855 (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: HE1qKDBj9UuUITfmDRX0JW+Je+lIX3S5YFo8Hm2Z8H7o1tGAy7NwWQMlZjn+iOXa4alQAIbV5eRsbvcAOfHshQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3584 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH 2/9] vfio_user: implement lifecycle related APIs 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" > -----Original Message----- > From: dev On Behalf Of Chenbo Xia > Sent: Friday, December 18, 2020 3:39 PM > To: dev@dpdk.org; thomas@monjalon.net; david.marchand@redhat.com > Cc: stephen@networkplumber.org; Liang, Cunming > ; Lu, Xiuchun ; Li, Miao > ; Wu, Jingjing > Subject: [dpdk-dev] [PATCH 2/9] vfio_user: implement lifecycle related AP= Is >=20 > This patch implements three lifecycle related APIs for vfio-user server, = which > are rte_vfio_user_register(), rte_vfio_user_unregister() and > rte_vfio_user_start(). Socket an device management is implemented along > with the API introduction. >=20 > Signed-off-by: Chenbo Xia > Signed-off-by: Xiuchun Lu > --- > lib/librte_vfio_user/meson.build | 3 +- > lib/librte_vfio_user/rte_vfio_user.h | 51 ++ > lib/librte_vfio_user/version.map | 6 + > lib/librte_vfio_user/vfio_user_base.h | 4 + > lib/librte_vfio_user/vfio_user_server.c | 690 ++++++++++++++++++++++++ > lib/librte_vfio_user/vfio_user_server.h | 55 ++ > 6 files changed, 808 insertions(+), 1 deletion(-) create mode 100644 > lib/librte_vfio_user/rte_vfio_user.h > create mode 100644 lib/librte_vfio_user/vfio_user_server.c > create mode 100644 lib/librte_vfio_user/vfio_user_server.h >=20 <...> > +static struct vfio_user_server_socket * find_vfio_user_socket(const 1. How about vfio_user_find_socket which is consistent with other function = name? 2. According to the coding style, I think it's better to use such format: static struct vfio_user_server_socket * vfio_user_find_socket() { } And please also check all other functions.=20 > +char *sock_addr) { > + uint32_t i; > + > + if (sock_addr =3D=3D NULL) > + return NULL; > + > + for (i =3D 0; i < vfio_ep_sock.sock_num; i++) { > + struct vfio_user_server_socket *s =3D vfio_ep_sock.sock[i]; > + > + if (!strcmp(s->sock.sock_addr, sock_addr)) > + return s; > + } > + > + return NULL; > +} > + <...> > -- > 2.17.1