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 AAFEFA0A01; Mon, 4 Jan 2021 07:45:15 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3036F1606D0; Mon, 4 Jan 2021 07:45:15 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 6233F1606CF for ; Mon, 4 Jan 2021 07:45:13 +0100 (CET) IronPort-SDR: gjEGy0ennj6lf7/1J7SuYvf7xRdhQvooWbtLA820QcTILKz4hMbtipEPK294tCKV2UB2p9VBmB vbafVmQ3nKDg== X-IronPort-AV: E=McAfee;i="6000,8403,9853"; a="156705840" X-IronPort-AV: E=Sophos;i="5.78,473,1599548400"; d="scan'208";a="156705840" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jan 2021 22:45:11 -0800 IronPort-SDR: D8RR3Dd4r2IkznUQmfygrOOmK9YwXbA4n0pbr2P1hfuu/dpBtrIC1q70T9wH59NOQDe0KPnwdo Y9ontHOroRAw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.78,473,1599548400"; d="scan'208";a="421252275" Received: from orsmsx606.amr.corp.intel.com ([10.22.229.19]) by orsmga001.jf.intel.com with ESMTP; 03 Jan 2021 22:45:11 -0800 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Sun, 3 Jan 2021 22:45:11 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5 via Frontend Transport; Sun, 3 Jan 2021 22:45:11 -0800 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.173) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.1713.5; Sun, 3 Jan 2021 22:45:09 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=da2sPKZafC5G+8eIX2vRWqi6awlnBCoHmM8XzVp8EKWEra1bzM6T9pTNpJTH2CaVcqEvqsCRL2BDN1dTqtF7sxofGbf78hy+2bOZyOMAaEIYcA1NXVRjQtc/C7B/2tt7Q38mwWrgaRJqzFKoBiGm7kOER1ro6yRyS06086DwkFf5NVPXpvCS6F4WiK9GGYl9hIXeQE8dP2W2+IH6JOkBYd2NjFz8FREfUSTXcy4sWpmkPuk0DM8n9/276mxUrSzdl40kBRz3DBLF3fJyHC8+uU+R+o65iOIhSJvMZw0Tw1mj7aoPOlS8pD4qtggL3B2JuvMD31DPABGCjl8OgBPKgg== 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=RzM5BhJI3T5wEnrObqO6qCRfQ1YQ+msRJ4n3o8aNtTs=; b=Mv9xabUeWeKF1CQAuPwbdht6ntrGrN3F+79zLKu6qmOK0HGgdcmGEFwA6e8hIeBWVp9yyrWHOjQJHaJEwgEQziJsZXSk138QUWiYqcA5RWZoZYd3t3NssU5lwA064rsPPZgDlMquf9oiz0HDC7UYQBaQXs5v0RSBDUde94VCU1CIYx/ipAJuN4uVJTasm305o+ixLOGmuCWL2nqCD4lRH98lpXuQod5JNUpB8qE5+8XzXGk5utzPTXp1rtYrlbJ/WcmHA6RoZnDIVZdCNI5HyBgRpryThajnAPOLCgZ1EOcBwd+RtYisli6RS5L/ACOl3lS2vmAwDoL0b61ODB0i7A== 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=RzM5BhJI3T5wEnrObqO6qCRfQ1YQ+msRJ4n3o8aNtTs=; b=OeP+SzTwxMvNPouMWxHL1DXXZXuvXSwwZAEY6PDHMzGcKrrUBPLmoPFdpG63EP5JwrW63iqmX54m8MtmhSHXAeqJUD7m3dQJNaYWHFZz3EM8pgOmPQjcx63H5w8hBZ+DLaN+hcxZS9xLvusGtaeGYOzWvNrd08ekQqHfPcbI6kw= Received: from MW3PR11MB4587.namprd11.prod.outlook.com (2603:10b6:303:58::7) by MWHPR11MB0032.namprd11.prod.outlook.com (2603:10b6:301:63::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3721.23; Mon, 4 Jan 2021 06:45:07 +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; Mon, 4 Jan 2021 06:45:07 +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: AQHW1dJWZX5Mm0GRC0mJbGQHuBds66oXHieA Date: Mon, 4 Jan 2021 06:45:07 +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: 11ed1f6a-32a8-498b-3a6d-08d8b07c468f x-ms-traffictypediagnostic: MWHPR11MB0032: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3383; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: FNxD9d75K+6ZhHk6QTRzmLi+PeJi5AvpDNTrpJqMV/Rk8jMEjrqebhBKlU8Y1wPiPrCDAaAT68jUW6ds/Vq4saYs+qbhl9YIJWnOjRwD0p+3+iW+PYewCl1m1jM+Qm3u2DPd6g4i6pkbXgU1VdnYsxVUSvL+3HSvCmQa1qbql62bkf8U8boR2BRjMqmwPcdd7tD7lYlvZ3VwVBmgXZNBu9QUJNe7H3a0xLImOYaiTwNglXJIZqGHDPCdPmg8DtrRjSGZO7txKw7lwDXLvApfy2b+j7s+rLcpKqlb4rCwIateQscx/QTKK5xbOXQKoB2zDMbQsA6aHFWOMw8eHC/u5K+dHIX2sohQooMEdDLL8WXOZCWtGBG4knIZrc8VTbfFt7QrJ9rf7lUvhbgW+bWv2A== 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)(376002)(396003)(136003)(366004)(346002)(39860400002)(52536014)(7696005)(2906002)(478600001)(86362001)(4326008)(26005)(107886003)(9686003)(83380400001)(5660300002)(54906003)(6506007)(64756008)(66556008)(66446008)(66476007)(33656002)(8676002)(71200400001)(66946007)(110136005)(4744005)(186003)(76116006)(55016002)(316002)(8936002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?P9C7qMyoLHKL4bC6BI0S4vZzpN7hxXeJI2A9bX/EphKQG2BOuWwjWe8fP090?= =?us-ascii?Q?QE0QfK+dniX/w6u6Gt8vruouYiry0LGUX+/3TGrN8PbZBpQaY1WSYva6f7nt?= =?us-ascii?Q?3Cv1hcl6fKoOovzZjUVmYN8gy6DrQJN7kQhWkrM8WU8ODrRxEBcpsOIn2vsl?= =?us-ascii?Q?z99URbtse0GbEDr2QMrdNPjQGWDv1byhL2WklsQ72RkLqEF4M80oHihXWYZ+?= =?us-ascii?Q?f65feERfIAHpNGBGoNzt7cFucJucfmROtaPxjJBSXEdhkf9F3hTTZT8spwJr?= =?us-ascii?Q?MCcB2SJ0tsDRpuQiLhPm+rJ9zDjtt528zpBTLeJ3TiOMabW1X0AvU2viwsKv?= =?us-ascii?Q?ymPwLD/Pn8cU+krb4BtXmxGw2v3O6Y5tatsaEo8oqxdpR4t9acu0NyjUQ6M/?= =?us-ascii?Q?Sfm+/mMj6+eShxTNrWagLT+oxICZzBy8oTKoH/CfoDGtODoyuVhicmc5aQdR?= =?us-ascii?Q?ihKraGXY3QcXz624lf4WDR1ioAwN2isjsEP8bywskF85jelBcfcGoLiNheWp?= =?us-ascii?Q?17UDujJDeJSQUKNH0/FnMZphPYXFWZ1zwsiiZURQiXOOu9tCzmAxqPX8JrCE?= =?us-ascii?Q?kzMw9PJNM00cfYl1+U9e+5UnY9aDijLmtMXKHyB+yq6UAFpgyyNFwir11j2F?= =?us-ascii?Q?cKZOPMf3A1+n4R82dNn9B5Gp8IWdppZ4PPea57C/NQfW3aFE5WQ2iwhiEeeD?= =?us-ascii?Q?qjMfM7bpUAvOgJEtEUig+/aC8sNw4U4hL+oBV+Wo33+maO2aB1e/GbhAzezS?= =?us-ascii?Q?fsEqZZXLp8vF2fx/1hSxnES9VATDq5Gz0AeSPyhSKg3RF/5+OPVUBOrjfCFS?= =?us-ascii?Q?tHXrKYlglYfbIQANZ2o7ENjdo8sYqTruTqUQeeks++hELY6Nt5JeKaCwSN0Y?= =?us-ascii?Q?6EmK8bO3vSjkBfNPMIyRQKrXwQmtGg1eSODhPu+OH4A3cNmOyqc5KgJPjm9C?= =?us-ascii?Q?fP+vlKScUJseV2MFhKL/nffqvjJjoPIAoxaS0QmYVa0=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: 11ed1f6a-32a8-498b-3a6d-08d8b07c468f X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Jan 2021 06:45:07.8313 (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: WGA2buhZ8PxSxbi+unhqnIPBI4i5T1pJ3yirnSUFV0GbJKlsGDCU7yXFOSySBHPBd1pnCLObcAKQCgxBwSmtEQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB0032 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 inline struct iavf_emu_sock_list * iavf_emu_find_sock_list(char > +*sock_addr) { > + struct iavf_emu_sock_list *list; > + struct iavf_emudev *dev; > + int list_exist; Initialize list_exist to 0? > + > + if (!sock_addr) > + return NULL; > + > + pthread_mutex_lock(&sock_list_lock); > + > + TAILQ_FOREACH(list, &sock_list, next) { > + dev =3D (struct iavf_emudev *)list->emu_dev->priv_data; > + > + if (!strcmp(dev->sock_addr, sock_addr)) { > + list_exist =3D 1; > + break; > + } > + break; This "break" need to be removed. > + } > + > + pthread_mutex_unlock(&sock_list_lock); > + > + if (!list_exist) > + return NULL; > + > + return list; > +} > +