From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5A53A427DE; Mon, 20 Mar 2023 07:52:13 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DC09E40A7F; Mon, 20 Mar 2023 07:52:12 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id D6C94406BC; Mon, 20 Mar 2023 07:52:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1679295130; x=1710831130; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=7nCWz9F9RDJDa7hKmmUZ8OqviPtKhq1EafeVg9TIvJo=; b=YU1oiUNiTE2Q9u9MxvQwMEU0T8uqagcVIIw7WF4U/+7w+VcnmcuAkWAv PhQjK5hNpbhOoxpMmU+6werFHQS+FP7d5lbzVXNdKTZFM5adrRXNxyVWR Wms2vsN1yYqEA+7tn2O07zlam8RQoQjdg25IOu+iU6MYM7+L4UPtu9YXh gM4NsKmq7N59tS8K6aCZ2damPzX8xwhw6WjWpBLR1SbWsZXLfuel9Fuzz 5PAMRjDQDe4naBwBiMCr2DD3ARSOg5+QnhEjloE1mYv/BRj5l5wnBq+aV yDclaNHtWYAU8ajhLa51+uvJvU6qLZ9jcgQo3MYDaFw/ylFU3fuivjZz7 w==; X-IronPort-AV: E=McAfee;i="6600,9927,10654"; a="403459379" X-IronPort-AV: E=Sophos;i="5.98,274,1673942400"; d="scan'208";a="403459379" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Mar 2023 23:52:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10654"; a="749957296" X-IronPort-AV: E=Sophos;i="5.98,274,1673942400"; d="scan'208";a="749957296" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by fmsmga004.fm.intel.com with ESMTP; 19 Mar 2023 23:52:06 -0700 Received: from fmsmsx601.amr.corp.intel.com (10.18.126.81) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Sun, 19 Mar 2023 23:52:03 -0700 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.2507.21 via Frontend Transport; Sun, 19 Mar 2023 23:52:03 -0700 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.172) 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.2507.21; Sun, 19 Mar 2023 23:52:02 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dknbVHsP7Uy9BBjW+SJdWBDcvb4oBs0ja9Un0uWd/VlKr75FzZ7yRdOf82VdpDQeVO4B/x5IK0Di160pNmEgMuWFtSmPO4joClmfgAcIdGHLVXTBARUYgkg5RgNVHDddLJjgpZVQWwYcl/D16aLEY87QVdhgF+ziD4aNm9k8snsbQ+XAjYfcgJNSRTGFi0X0yrRhU2RrNrCNVCgJmhSi0tcVZAuPvzUSqiR39hL7ov57kAoPjY/tRRvW/KxOMDTWdKpuO06NHDrsjkFW13FuUhOBjjZ14rNk1LuT2H3HmACg/f8XPZGh9jD+3gT8axKp3zItg/DGyF0XNT94IpLwCw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=9fD2pV1Ip0mgrXcKYYz4YyXTV7S/8R7taD+Wmw6o4EM=; b=ViPRAsy42DWx2JRDoosB7MNXs5h96vHOVvI4kECmOciZYX0LgChepdecMfyAg79ZliRoLfOn+e4+BtJ52gd47dy1+PGR0+KXvy7OEA9/HI25cVkNbjDz2M1LiRnP6hSKwDGPJyJnGRrBl7O8x7CyS5BRXLOiXEv9Z1jluDaUSNEt6eYL0xl1VgsmFI6E5TFLFazbC9XSc0U4a77Db1XN+54VVPgGGP6E1Fv4PCtKZFYz7jQCSw6VclHDLUO9rGiY8jqg9KugeXsTA1FD3YF8roNlG7wEEHGW/iD/Bo3zvh0UELRBVD1Fr0gjThnqW4szO39qZ6dMfx7ilm4nV5tPtg== 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 Received: from DM6PR11MB4252.namprd11.prod.outlook.com (2603:10b6:5:201::26) by BL3PR11MB6436.namprd11.prod.outlook.com (2603:10b6:208:3bc::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.27; Mon, 20 Mar 2023 06:51:52 +0000 Received: from DM6PR11MB4252.namprd11.prod.outlook.com ([fe80::5735:cfcd:8b34:761e]) by DM6PR11MB4252.namprd11.prod.outlook.com ([fe80::5735:cfcd:8b34:761e%7]) with mapi id 15.20.6178.037; Mon, 20 Mar 2023 06:51:55 +0000 From: "Xu, Rosen" To: "Huang, Wei" , "dev@dpdk.org" , "thomas@monjalon.net" , "david.marchand@redhat.com" CC: "stable@dpdk.org" , "Zhang, Tianfei" , "Zhang, Qi Z" Subject: RE: [PATCH v1] raw/ifpga: remove virtual device unplug operation Thread-Topic: [PATCH v1] raw/ifpga: remove virtual device unplug operation Thread-Index: AQHZWHHvTpjQRIR/MU6q3HrgjJBrz68DP95A Date: Mon, 20 Mar 2023 06:51:55 +0000 Message-ID: References: <20230316204445.360330-1-wei.huang@intel.com> In-Reply-To: <20230316204445.360330-1-wei.huang@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: DM6PR11MB4252:EE_|BL3PR11MB6436:EE_ x-ms-office365-filtering-correlation-id: 4166956f-ed81-4ea1-23af-08db290f9823 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: lgBW0T9K756W85Y/5bSCX1nFNCfurTxEkr6S3E11CWSXbuqbEDnTTtLkGuvAdow/Xyu2BG6f+T6jcvXHQQrN+ONgW2kCDDBRfpga6oltJFs4YDBNKlCAcUwxsGHw27NuNtEM6fa5PSZQeYIvfog95ncg0I758SXC5LQYjnwW8ILr1iGo3kRUsK8HtrDmPJ3IJmc78hbltkFVhLh5U+UplV+VAqU10FxT3QG21KD8jTtUE6FhHTLPoFe+CNvnshljl/tPEoIpMO5GDaXD1UJ4IhKH0AftpwSoG94KHYq4vlbbhAudEzwzKFuznVKqBaWwT60tA5RZDNwSGA332Crz9jsB3aSZ8rQ+nGdaQUaBrdFbUftqKOz3BJ/X1cHmlguHHypa18Th86K3MVHDAMdUmhz7Q6c5bOMPD8WiVomiJKLx8C9r4gMcHDfa4KPtfzyWDgN3iwT2z7QoDroG8RAeLt8JzO1w+wUa2rueIs6CflY94kToLtMPrvGUX0dEhT5btl18POpdYJqnAXwWTpnUpFUmzyDbSzA1gaBHoriJ3esIXdN3RSsf0qiszViU2duGuNzt3DithBKM8aX9VXM/rZ8DOng/NDkrgevyyDXNAZOQpFkW3MwjJ5J/aU5uVZtYKbH3RflcZZeiYXVXZLug6KAN2PKO/DOlHWnFZLbjDqlg5Y3dhMaHGM7VCbfkCkYJXIInzCiQ+hK/tsmhQwkO9A== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB4252.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(376002)(396003)(346002)(366004)(39860400002)(136003)(451199018)(5660300002)(8936002)(66476007)(2906002)(8676002)(66556008)(66446008)(76116006)(4326008)(52536014)(66946007)(316002)(110136005)(54906003)(64756008)(478600001)(7696005)(71200400001)(107886003)(26005)(6506007)(41300700001)(53546011)(33656002)(186003)(83380400001)(86362001)(55016003)(38070700005)(82960400001)(122000001)(9686003)(38100700002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?mJai3AYsvenBMubwZSYF4pPScq7BI6fK74PGgRXy3wS0KRQX2OEBoXirV3Oz?= =?us-ascii?Q?N/vPvf0LymKooLs/mk7Py9u4AbdDWN3p8BhoEXCs6Q83ytL70p9Zgxi0Syhu?= =?us-ascii?Q?uKgxnrl+VM5qORv/DXvytMeIXJTvsK1Vses8uwJE6taTJSaHzulaJm07akIk?= =?us-ascii?Q?HGXiReuV2D3+um8elSuK4nDMStfwWlgyZldumuZmYYsmoIURdp2uhX16zYWW?= =?us-ascii?Q?5EPYSvIRCXG3ZvCarFOtgYeV0C0rtCO21NUAnpE3AeSUhjS07FGxepwokrR3?= =?us-ascii?Q?WYH6OJUsy4nyKbctChaSRMjqF8RB0sYNW7+z8KJQqXZP7h+sNanij9/1NOB6?= =?us-ascii?Q?tVrWWwv/flsVMErJbgxAARtli1K7i3fsa2+Kbje2uqSw1Heyarp+ZQc0+vmG?= =?us-ascii?Q?srhIqltERjMpGWT+HWpGkpkBLJXqArVcCxFgCaXDgoXmrfdgQ8x2RRvJDUXB?= =?us-ascii?Q?aUjgyOq68JjoKm6c0ZNSkTi20YQfsmLmDozdJNOKUgx99Fa1CXny+NiU55NF?= =?us-ascii?Q?OKARkXYtp0gk9M44TT9CO4jztW9we7ossQMZh4mKJ5wGADAL3fLyHV9nmICY?= =?us-ascii?Q?LCY2wclB5pA7gF10kOcS43EakvpDpVrhE/AMuYRMibc5FHmDjJhbpZqVoRZa?= =?us-ascii?Q?P7pJc/NZyM7d5fyAMvYOdcZWEFiPm7MOisvzNhTBU6MTyjLgcl9M9oKi1oCr?= =?us-ascii?Q?lL2r5G9wURmvEJqEetAAc5/aMWXhMAAvqhOe/wuSCAEvM4YZ9NW2p5XhENP6?= =?us-ascii?Q?klbDqaeYu3onnt9xFmqG96H//v2wxi/NDdwl9XMiQlA2CA3xY+Jx2jkqekHL?= =?us-ascii?Q?xWL2DV+kuYtW411RxFy5vW3kgnoLcClLce4LAZsedDbcCk9yOx1N/gsAr5nL?= =?us-ascii?Q?zlKykJRM8trR6o7o6BOKJa0cA3CaVxbiIZ81SiB1E7t66YowV4R3ZArqzLps?= =?us-ascii?Q?qMsKRq4Au6cbEPlU2EigWdH45DUwMfaZ1kvg+86Icc+bsFR3Uj8W4kbS/Qvp?= =?us-ascii?Q?o5aF2z5vxHI1xpTBK0/E00BC5B39gUE2QtYltwtArBG67SNfaFthBW9eBugy?= =?us-ascii?Q?pj/ZhngUHCt1bijwhMqSdGSP/uacfWX6hCIPXIV9BCI2JERdbGlS9EkATeHe?= =?us-ascii?Q?SdArMLj+nKyAHaiQnjKY6kFGNPuriJUAgYd6sdZxrIBkLXE8iUBUzpPEc7Ms?= =?us-ascii?Q?BDxXQLpYQ6BVU7J8Bh6z2JPERE6KchiuKZAIJ3I80yI5x6QO1oFdiCFvbi8H?= =?us-ascii?Q?JUyoXXkv8nzqySzloh/zsvQ+NA/EhnLjrUpnG2fm1lZc+KyQsCkXzqcGXcgM?= =?us-ascii?Q?GZX3kAFz8kjHw/HdT2KXoC7b/lVqD8JwKP869csJToRDMCmDIfPPtHS+HGmS?= =?us-ascii?Q?On/YRJKLyeW/pMQuxpnzvN7qw+wJEsi0zXlXz7XwfHmsiiRcTdrxBXLKpYDK?= =?us-ascii?Q?QBE+j7xqMXZM6zmzkM9i5RC/KcLnkLv7X3rYaqVvBUP1Y1LjPCDDHTNGraLa?= =?us-ascii?Q?7nEPJNC6XiazpNrHbTWSsoqz0Ypfhzk9vSSdAbetvJTxz+IVM7UAdzl0kNYH?= =?us-ascii?Q?RlE5bU4s2ejgCbg2ZSI7oUHsbCS+Xlf+CPHHWJm/?= 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: DM6PR11MB4252.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4166956f-ed81-4ea1-23af-08db290f9823 X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Mar 2023 06:51:55.6120 (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: vHS8Op7wVBXb81l8X0ZsThE7jWMBWSPzS6PMo4s2w5bJzX27SPQMmrYoTHidn0GrofasWQR4/BUmD2zfmzOqRA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL3PR11MB6436 X-OriginatorOrg: intel.com 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 Hi, > -----Original Message----- > From: Huang, Wei > Sent: Friday, March 17, 2023 4:45 AM > To: dev@dpdk.org; thomas@monjalon.net; david.marchand@redhat.com > Cc: stable@dpdk.org; Xu, Rosen ; Zhang, Tianfei > ; Zhang, Qi Z ; Huang, Wei > > Subject: [PATCH v1] raw/ifpga: remove virtual device unplug operation >=20 > VDEV bus has implemented cleanup() function to perform cleanup for > devices on the bus during eal_cleanup(), so there is no need for ifpga dr= iver > to record virtual devices and unplug them. >=20 > Signed-off-by: Wei Huang > --- > drivers/raw/ifpga/ifpga_rawdev.c | 99 ++++------------------------------= ------ > drivers/raw/ifpga/ifpga_rawdev.h | 2 - > 2 files changed, 9 insertions(+), 92 deletions(-) >=20 > diff --git a/drivers/raw/ifpga/ifpga_rawdev.c > b/drivers/raw/ifpga/ifpga_rawdev.c > index 1020adc..8e6e70f 100644 > --- a/drivers/raw/ifpga/ifpga_rawdev.c > +++ b/drivers/raw/ifpga/ifpga_rawdev.c > @@ -140,8 +140,6 @@ struct ifpga_rawdev * > for (i =3D 0; i < IFPGA_MAX_IRQ; i++) > dev->intr_handle[i] =3D NULL; > dev->poll_enabled =3D 0; > - for (i =3D 0; i < IFPGA_MAX_VDEV; i++) > - dev->vdev_name[i] =3D NULL; >=20 > return dev; > } > @@ -749,17 +747,11 @@ static int set_surprise_link_check_aer( > struct ifpga_rawdev *ifpga_rdev =3D NULL; > struct opae_adapter *adapter; > struct opae_manager *mgr; > - char *vdev_name =3D NULL; > - int i, ret =3D 0; > + int ret =3D 0; >=20 > if (dev) { > ifpga_rdev =3D ifpga_rawdev_get(dev); > if (ifpga_rdev) { > - for (i =3D 0; i < IFPGA_MAX_VDEV; i++) { > - vdev_name =3D ifpga_rdev->vdev_name[i]; > - if (vdev_name) > - rte_vdev_uninit(vdev_name); > - } > ifpga_monitor_stop_func(ifpga_rdev); > ifpga_rdev->rawdev =3D NULL; > } > @@ -1778,104 +1770,31 @@ static int ifpga_rawdev_get_string_arg(const > char *key __rte_unused, static int ifpga_cfg_probe(struct rte_vdev_devi= ce > *vdev) { > - struct rte_rawdev *rawdev =3D NULL; > - struct ifpga_rawdev *ifpga_dev; > struct ifpga_vdev_args args; > char dev_name[RTE_RAWDEV_NAME_MAX_LEN]; > - const char *vdev_name =3D NULL; > - int i, n, ret =3D 0; > - > - vdev_name =3D rte_vdev_device_name(vdev); > - if (!vdev_name) > - return -EINVAL; > + int ret =3D 0; >=20 > - IFPGA_RAWDEV_PMD_INFO("probe ifpga virtual device %s", > vdev_name); > + IFPGA_RAWDEV_PMD_INFO("probe ifpga virtual device %s", > + rte_vdev_device_name(vdev)); >=20 > ret =3D ifpga_vdev_parse_devargs(vdev->device.devargs, &args); > if (ret) > return ret; >=20 > memset(dev_name, 0, sizeof(dev_name)); > - snprintf(dev_name, RTE_RAWDEV_NAME_MAX_LEN, "IFPGA:%s", > args.bdf); > - rawdev =3D rte_rawdev_pmd_get_named_dev(dev_name); > - if (!rawdev) > - return -ENODEV; > - ifpga_dev =3D ifpga_rawdev_get(rawdev); > - if (!ifpga_dev) > - return -ENODEV; > - > - for (i =3D 0; i < IFPGA_MAX_VDEV; i++) { > - if (ifpga_dev->vdev_name[i] =3D=3D NULL) { > - n =3D strlen(vdev_name) + 1; > - ifpga_dev->vdev_name[i] =3D rte_malloc(NULL, n, 0); > - if (ifpga_dev->vdev_name[i] =3D=3D NULL) > - return -ENOMEM; > - strlcpy(ifpga_dev->vdev_name[i], vdev_name, n); > - break; > - } > - } > - > - if (i >=3D IFPGA_MAX_VDEV) { > - IFPGA_RAWDEV_PMD_ERR("Can't create more virtual > device!"); > - return -ENOENT; > - } > - > snprintf(dev_name, RTE_RAWDEV_NAME_MAX_LEN, "%d|%s", > args.port, args.bdf); > - ret =3D rte_eal_hotplug_add(RTE_STR(IFPGA_BUS_NAME), > - dev_name, vdev->device.devargs->args); > - if (ret) { > - rte_free(ifpga_dev->vdev_name[i]); > - ifpga_dev->vdev_name[i] =3D NULL; > - } > - > - return ret; > + return rte_eal_hotplug_add(RTE_STR(IFPGA_BUS_NAME), > dev_name, > + vdev->device.devargs->args); > } >=20 > static int > ifpga_cfg_remove(struct rte_vdev_device *vdev) { > - struct rte_rawdev *rawdev =3D NULL; > - struct ifpga_rawdev *ifpga_dev; > - struct ifpga_vdev_args args; > - char dev_name[RTE_RAWDEV_NAME_MAX_LEN]; > - const char *vdev_name =3D NULL; > - char *tmp_vdev =3D NULL; > - int i, ret =3D 0; > - > - vdev_name =3D rte_vdev_device_name(vdev); > - if (!vdev_name) > - return -EINVAL; > + IFPGA_RAWDEV_PMD_INFO("remove ifpga virtual device %s", > + rte_vdev_device_name(vdev)); >=20 > - IFPGA_RAWDEV_PMD_INFO("remove ifpga virtual device %s", > vdev_name); > - > - ret =3D ifpga_vdev_parse_devargs(vdev->device.devargs, &args); > - if (ret) > - return ret; > - > - memset(dev_name, 0, sizeof(dev_name)); > - snprintf(dev_name, RTE_RAWDEV_NAME_MAX_LEN, "IFPGA:%s", > args.bdf); > - rawdev =3D rte_rawdev_pmd_get_named_dev(dev_name); > - if (!rawdev) > - return -ENODEV; > - ifpga_dev =3D ifpga_rawdev_get(rawdev); > - if (!ifpga_dev) > - return -ENODEV; > - > - snprintf(dev_name, RTE_RAWDEV_NAME_MAX_LEN, "%d|%s", > - args.port, args.bdf); > - ret =3D rte_eal_hotplug_remove(RTE_STR(IFPGA_BUS_NAME), > dev_name); > - > - for (i =3D 0; i < IFPGA_MAX_VDEV; i++) { > - tmp_vdev =3D ifpga_dev->vdev_name[i]; > - if (tmp_vdev && !strcmp(tmp_vdev, vdev_name)) { > - free(tmp_vdev); > - ifpga_dev->vdev_name[i] =3D NULL; > - break; > - } > - } > - > - return ret; > + return 0; > } >=20 > static struct rte_vdev_driver ifpga_cfg_driver =3D { diff --git > a/drivers/raw/ifpga/ifpga_rawdev.h b/drivers/raw/ifpga/ifpga_rawdev.h > index 0fb66cb..1c128c7 100644 > --- a/drivers/raw/ifpga/ifpga_rawdev.h > +++ b/drivers/raw/ifpga/ifpga_rawdev.h > @@ -65,8 +65,6 @@ struct ifpga_rawdev { > void *intr_handle[IFPGA_MAX_IRQ]; > /* enable monitor thread poll device's sensors or not */ > int poll_enabled; > - /* name of virtual devices created on raw device */ > - char *vdev_name[IFPGA_MAX_VDEV]; > }; >=20 > struct ifpga_vdev_args { > -- > 1.8.3.1 Acked-by: Rosen Xu