Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1348260ybh; Thu, 12 Mar 2020 23:04:10 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuiSDKq1naJfBDLoU12VLYfIUeDamAcrT/pkwJmIsZv4gCZ8Z0Xe2F6WMkLRXrEEdW/McDS X-Received: by 2002:aca:2413:: with SMTP id n19mr5894689oic.126.1584079450646; Thu, 12 Mar 2020 23:04:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1584079450; cv=pass; d=google.com; s=arc-20160816; b=OZRZww5SWkMG+r+7gL19W2JwWBVSH8O53n9ZNYazv94heGGcdZxV4DSoPwy2lotVmc 7eUiV+SlKpjjCDEVqmZndgNPV7Ju9hsUSWRBwlaJJuzcjqFCOcoGr3p/FzQqAfzhZzGB ViXhPWtJAaYviowC0YieN8r9BICDHKkdSzXnYws7uJ7vmf/ftupiGy7iNjNk3f9T7bkW EM6HWARUFE3o80gJONyUf52uF94a2Ozn+YGOXwMFtwPdtNb8tC4u9/lL94QRViMKeShm kAEcKwfOPdWY6+HJ04iag1+GsMmzsZcXyiN/yiK4pdKMDU9fbvDPwPDaBqsyX0QNk+3r K6CQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=uqQlhfowoCOaY8NHTrkaoA+vgQjUfgJkkH2+fA8CtIg=; b=UbXDDQo90az+fsXKomq/cfoygPGUTJvwgKjCi8KBaA6MSVmrp01WyWnYYjBFwOXKBJ vYpMvPCaTAadrbiCTIWePYHjbuV0wDYdWR1CR52NkBY9IOD+0LAzI6su3VRaH5Zv07JK q4xgm4rGB7bM38/2yKodXYeh9aHtxJj8dOdaCxKRMeNrwqGciPd4c7qBFgnssF7PVuBX qcJY/dIV7v+yMpENopPVu0dGoiUCtfcz9muXmiM4awrSh2RKEnqaY0MyQ4UeMkYEIUkj cTM5sPy9ZNV4yzz1DBomkTeoAcEdv+YKjnP20YiKa1aumQWRK1klSUE4wWuumsS1wxII F/yQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=nAK84bEx; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z14si4021939otq.257.2020.03.12.23.03.55; Thu, 12 Mar 2020 23:04:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=nAK84bEx; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726395AbgCMGDP (ORCPT + 99 others); Fri, 13 Mar 2020 02:03:15 -0400 Received: from mail-eopbgr140055.outbound.protection.outlook.com ([40.107.14.55]:28672 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725860AbgCMGDP (ORCPT ); Fri, 13 Mar 2020 02:03:15 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=m61jnuvFbuCNMOG1TjskbMy4LSvgNrNeLpU5xarYa5extK4ugJrRgKiDzJW4SUM9IMhQz7q5EU31JoqeIXcvwzVMH9ol3JkhzksRbRMe1cpAnJtPU8Nlw9HeaR2ztpb2kFJ1JxIatOCdrYNnwDPKjlnllez8swJKSuAfXdv8PeofPZFOMZrSJmNnUhrTncMZNQMx5XBdO3I/f/vdzrkXwfhqTE00nb4tHDBs5oQbV2qgpoALAZIysfD+s/oAp2+tXIbNfI3huN0up9T0fwRfy540nVrdXiudX97BQWCchREzsVl8Qs5Piwpchgl8lsRElKflIRtqZM5hu8zRogM8Gw== 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=uqQlhfowoCOaY8NHTrkaoA+vgQjUfgJkkH2+fA8CtIg=; b=ViZzFonqCYfq8ukHSFNMX/3N1/t35mr6a+7Nxo0yDxgrvSeDFpyO1Z9fx/RB1WWpTHcViFgvNg5YHEqPqUqP1Kb/UW+mySAM8X2/qhD+VetcM7Thoqa3okhb3NXRHu2kGK2gvOhVE4m0yLfbi01XhRWMXEdnFiJXaMsxIeqfqzUGh5TDMSsZnTfV5ms8lmQF30TJ5avGYoZ83yqbqYX2ztviaU6R0awKEM77Nawlgp3XWbbYvAfP1I8PImQmDSwbfw+UsmnUlMNxyBMAEPSo5+DVM/uED5FCB/lRKfMM4+jOIkca8pdcREw7CvHzW6u7Umk5mROZvggtv2wLBzPzfQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uqQlhfowoCOaY8NHTrkaoA+vgQjUfgJkkH2+fA8CtIg=; b=nAK84bExhVp7GAosPB8NuvDSoqoSpx57K1C+54CxlqQUhG4iq46iISt8hr61Q0mCexzOnjSkOeHNNCa2iuaaL7/9RiQAtLStP4JqF84Y9fUK9c0I+r/F3Wjelfw1Lu/+ZfXNwQqDXSmgVMq3dkQ2x3QwqE1WTou+cn8aLQopQWk= Received: from VE1PR04MB6496.eurprd04.prod.outlook.com (20.179.232.221) by VE1PR04MB6751.eurprd04.prod.outlook.com (20.179.235.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.17; Fri, 13 Mar 2020 05:59:31 +0000 Received: from VE1PR04MB6496.eurprd04.prod.outlook.com ([fe80::8cb8:5c41:d843:b66d]) by VE1PR04MB6496.eurprd04.prod.outlook.com ([fe80::8cb8:5c41:d843:b66d%5]) with mapi id 15.20.2814.018; Fri, 13 Mar 2020 05:59:31 +0000 From: Po Liu To: Vinicius Costa Gomes , "davem@davemloft.net" , "linux-kernel@vger.kernel.org" , "netdev@vger.kernel.org" CC: Claudiu Manoil , Vladimir Oltean , Alexandru Marginean , Xiaoliang Yang , Roy Zang , Mingkai Hu , Jerry Huang , Leo Li , "michael.chan@broadcom.com" , "vishal@chelsio.com" , "saeedm@mellanox.com" , "leon@kernel.org" , "jiri@mellanox.com" , "idosch@mellanox.com" , "alexandre.belloni@bootlin.com" , "UNGLinuxDriver@microchip.com" , "kuba@kernel.org" , "jhs@mojatatu.com" , "xiyou.wangcong@gmail.com" , "simon.horman@netronome.com" , "pablo@netfilter.org" , "moshe@mellanox.com" , "m-karicheri2@ti.com" , "andre.guedes@linux.intel.com" Subject: RE: [EXT] Re: [RFC,net-next 5/9] net: enetc: add tc flower psfp offload driver Thread-Topic: [EXT] Re: [RFC,net-next 5/9] net: enetc: add tc flower psfp offload driver Thread-Index: AQHV87lKpznc1rUAI0eb5Z2yXsBQiahFj7IAgABmaPA= Date: Fri, 13 Mar 2020 05:59:31 +0000 Message-ID: References: <20200306125608.11717-1-Po.Liu@nxp.com> <20200306125608.11717-6-Po.Liu@nxp.com> <87y2s5gr0l.fsf@linux.intel.com> In-Reply-To: <87y2s5gr0l.fsf@linux.intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=po.liu@nxp.com; x-originating-ip: [119.31.174.68] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 1d15b42e-0336-4c0e-7d0b-08d7c713b317 x-ms-traffictypediagnostic: VE1PR04MB6751:|VE1PR04MB6751: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; x-forefront-prvs: 034119E4F6 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(4636009)(396003)(346002)(136003)(376002)(39860400002)(366004)(199004)(478600001)(4326008)(66476007)(81166006)(8676002)(52536014)(2906002)(86362001)(66946007)(7416002)(66556008)(64756008)(81156014)(66446008)(8936002)(76116006)(316002)(71200400001)(54906003)(110136005)(55016002)(33656002)(5660300002)(9686003)(26005)(44832011)(6506007)(7696005)(186003)(30864003)(142933001)(579004)(559001);DIR:OUT;SFP:1101;SCL:1;SRVR:VE1PR04MB6751;H:VE1PR04MB6496.eurprd04.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: jsMmXATO33ZQ5q+uylZx1IbLn12Fp8zS7BzXHcaFWZ+20RDKzWUGWjGwsiE43sRNT3xA1/vEBWZ/2wtcjwmHvSo/EdQTGnszXAlYQmyh5AnZmN/GehUISPDcYAIYrqqBfBk150ex2S9YsT+lPjZrfn44ywyQkeJuhBCMgMX+Co9WNK1Yya3t+Y261kDdwVc290e51kPwVdhdpkXF3KWhHGgMeSywPg4kA8MyNrHOJHBgebBtsEA9S1KA2gidLGFM58oUJUQmSOyzjXFs8Ne7YEN+cOE8BhaAraFRZrOeBX83zuzzI0q8nMF00bYoFIw2in3tLgxvMXf5Yj336OWE4PUuFaSvc9taAn7/Lc1pT1b5mv93FJolPFzbI23XOfxbXZF/P7LutnOwd1tPLdhH1qKvgvot1NNOAogJs8XMIn7t+LOOuLz+nwCV8GLqIyfQAdOVc9wRCvewEObW/YFXXM44WNWAaVx3nmXhDxk3OCLn4UUhMVJgFH24+f0pUsto x-ms-exchange-antispam-messagedata: SFMK0DMvOWe8L+fNsmYnrmN3mueHCk00Dda1nseapbkOTMJxIvm+Hp0KkNr7/cB9tHK/3HZedJQ9V8viRCnfCFyHxqhEobyoHijsiXJ46adyobEL3/6WGCoIhgGOaJQwWqmEXFpvKiU8rONvktbjyw== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1d15b42e-0336-4c0e-7d0b-08d7c713b317 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Mar 2020 05:59:31.6573 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: pZE/n6VAbV1f0xiL2H/lCQUKj9xJ2M5bTuxdHYgXzVdyMW3Xr88KNxPAJpKZ7xZb X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB6751 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org SGkgVmluaWNpdXMNCg0KPiAtLS0tLU9yaWdpbmFsIE1lc3NhZ2UtLS0tLQ0KPiBGcm9tOiBWaW5p Y2l1cyBDb3N0YSBHb21lcyA8dmluaWNpdXMuZ29tZXNAaW50ZWwuY29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o+ID4gKyAgICAgaWYgKGVycikNCj4gPiArICAgICAgICAgICAg IGdvdG8gZXhpdDsNCj4gPiArDQo+ID4gKyAgICAgY250LT5tYXRjaGluZ19mcmFtZXNfY291bnQg PQ0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAoKHU2NClsZTMyX3RvX2NwdShkYXRhX2J1Zi0+ bWF0Y2hoKSA8PCAzMikNCj4gPiArICAgICAgICAgICAgICAgICAgICAgKyBkYXRhX2J1Zi0+bWF0 Y2hsOw0KPiA+ICsNCj4gPiArICAgICBjbnQtPm5vdF9wYXNzaW5nX3NkdV9jb3VudCA9DQo+ID4g KyAgICAgICAgICAgICAgICAgICAgICgodTY0KWxlMzJfdG9fY3B1KGRhdGFfYnVmLT5tc2R1X2Ry b3BoKSA8PCAzMikNCj4gPiArICAgICAgICAgICAgICAgICAgICAgKyBkYXRhX2J1Zi0+bXNkdV9k cm9wbDsNCj4gPiArDQo+ID4gKyAgICAgY250LT5wYXNzaW5nX3NkdV9jb3VudCA9IGNudC0+bWF0 Y2hpbmdfZnJhbWVzX2NvdW50DQo+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBj bnQtPm5vdF9wYXNzaW5nX3NkdV9jb3VudDsNCj4gPiArDQo+ID4gKyAgICAgY250LT5ub3RfcGFz c2luZ19mcmFtZXNfY291bnQgPQ0KPiA+ICsgICAgICAgICAgICAgKCh1NjQpbGUzMl90b19jcHUo ZGF0YV9idWYtPnN0cmVhbV9nYXRlX2Ryb3BoKSA8PCAzMikNCj4gPiArICAgICAgICAgICAgICsg bGUzMl90b19jcHUoZGF0YV9idWYtPnN0cmVhbV9nYXRlX2Ryb3BsKTsNCj4gPiArDQo+ID4gKyAg ICAgY250LT5wYXNzaW5nX2ZyYW1lc19jb3VudCA9IGNudC0+bWF0Y2hpbmdfZnJhbWVzX2NvdW50 DQo+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLSBjbnQtPm5vdF9wYXNzaW5nX3Nk dV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fVkxB TikpIHsNCj4gPiArICAgICAgICAgICAgIHN0cnVjdCBmbG93X21hdGNoX3ZsYW4gbWF0Y2g7DQo+ ID4gKw0KPiA+ICsgICAgICAgICAgICAgZmxvd19ydWxlX21hdGNoX3ZsYW4ocnVsZSwgJm1hdGNo KTsNCj4gPiArICAgICAgICAgICAgIGlmIChtYXRjaC5tYXNrLT52bGFuX3ByaW9yaXR5KSB7DQo+ ID4gKyAgICAgICAgICAgICAgICAgICAgIGlmIChtYXRjaC5tYXNrLT52bGFuX3ByaW9yaXR5ICE9 DQo+ID4gKyAgICAgICAgICAgICAgICAgICAgICAgICAoVkxBTl9QUklPX01BU0sgPj4gVkxBTl9Q UklPX1NISUZUKSkgew0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5MX1NFVF9F UlJfTVNHX01PRChleHRhY2ssICJPbmx5IGZ1bGwgbWFzayBpcw0KPiBzdXBwb3J0ZWQgZm9yIFZM QU4gcHJpb3JpdHkiKTsNCj4gPiArICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlcnIgPSAt RUlOVkFMOw0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdvdG8gZnJlZV9maWx0 ZXI7DQo+ID4gKyAgICAgICAgICAgICAgICAgICAgIH0NCj4gPiArICAgICAgICAgICAgIH0NCj4g PiArDQo+ID4gKyAgICAgICAgICAgICBpZiAobWF0Y2gubWFzay0+dmxhbl90cGlkKSB7DQo+ID4g KyAgICAgICAgICAgICAgICAgICAgIGlmIChtYXRjaC5tYXNrLT52bGFuX3RwaWQgIT0gVkxBTl9W SURfTUFTSykgew0KPiA+ICsgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5MX1NFVF9FUlJf TVNHX01PRChleHRhY2ssICJPbmx5IGZ1bGwgbWFzayBpcw0KPiBzdXBwb3J0ZWQgZm9yIFZMQU4g aWQiKTsNCj4gPiArICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlcnIgPSAtRUlOVkFMOw0K PiA+ICsgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdvdG8gZnJlZV9maWx0ZXI7DQo+ID4g KyAgICAgICAgICAgICAgICAgICAgIH0NCj4gPiArDQo+ID4gKyAgICAgICAgICAgICAgICAgICAg IGZpbHRlci0+c2lkLnZpZCA9IG1hdGNoLmtleS0+dmxhbl90cGlkOw0KPiA+ICsgICAgICAgICAg ICAgICAgICAgICBpZiAoIWZpbHRlci0+c2lkLnZpZCkNCj4gPiArICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBmaWx0ZXItPnNpZC50YWdnZWQgPSBTVFJFQU1JRF9WTEFOX1VOVEFHR0VEOw0K PiA+ICsgICAgICAgICAgICAgICAgICAgICBlbHNlDQo+ID4gKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgZmlsdGVyLT5zaWQudGFnZ2VkID0gU1RSRUFNSURfVkxBTl9UQUdHRUQ7DQo+ID4g KyAgICAgICAgICAgICB9DQo+ID4gKyAgICAgfSBlbHNlIHsNCj4gPiArICAgICAgICAgICAgIGZp bHRlci0+c2lkLnRhZ2dlZCA9IFNUUkVBTUlEX1ZMQU5fQUxMOw0KPiA+ICsgICAgIH0NCj4gPiAr DQo+ID4gKyAgICAgLyogcGFyc2luZyBnYXRlIGFjdGlvbiAqLw0KPiA+ICsgICAgIGlmIChlbnRy eS0+Z2F0ZS5pbmRleCA+PSBwcml2LT5wc2ZwX2NhcC5tYXhfcHNmcF9nYXRlKSB7DQo+ID4gKyAg ICAgICAgICAgICBOTF9TRVRfRVJSX01TR19NT0QoZXh0YWNrLCAiTm8gU3RyZWFtIEdhdGUgcmVz b3VyY2UhIik7DQo+ID4gKyAgICAgICAgICAgICBlcnIgPSAtRU5PU1BDOw0KPiA+ICsgICAgICAg ICAgICAgZ290byBmcmVlX2ZpbHRlcjsNCj4gPiArICAgICB9DQo+ID4gKw0KPiA+ICsgICAgIGlm IChlbnRyeS0+Z2F0ZS5udW1fZW50cmllcyA+PSBwcml2LT5wc2Z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TkVUQ19QU0ZQX1dJTERDQVJEOw0KPiA+ICsNCj4gPiArICAgICBvbGRfc2ZpID0gZW5l dGNfcHNmcF9jaGVja19zZmkoc2ZpKTsNCj4gPiArICAgICBpZiAoIW9sZF9zZmkpIHsNCj4gPiAr ICAgICAgICAgICAgIGludCBpbmRleDsNCj4gPiArDQo+ID4gKyAgICAgICAgICAgICBpbmRleCA9 IGVuZXRjX2dldF9mcmVlX2luZGV4KHByaXYpOw0KPiA+ICsgICAgICAgICAgICAgaWYgKHNmaS0+ aGFuZGxlIDwgMCkgew0KPiA+ICsgICAgICAgICAgICAgICAgICAgICBOTF9TRVRfRVJSX01TR19N T0QoZXh0YWNrLCAiTm8gU3RyZWFtIEZpbHRlciByZXNvdXJjZSEiKTsNCj4gPiArICAgICAgICAg ICAgICAgICAgICAgZXJyID0gLUVOT1NQQzsNCj4gPiArICAgICAgICAgICAgICAgICAgICAgZ290 byBmcmVlX3NmaTsNCj4gPiArICAgICAgICAgICAgIH0NCj4gPiArDQo+ID4gKyAgICAgICAgICAg ICBzZmktPmluZGV4ID0gaW5kZXg7DQo+ID4gKyAgICAgICAgICAgICBzZmktPmhhbmRsZSA9IGlu ZGV4ICsgSEFORExFX09GRlNFVDsNCj4gPiArICAgICAgICAgICAgIC8qIFVwZGF0ZSB0aGUgc3Ry ZWFtIGZpbHRlciBoYW5kbGUgYWxzbyAqLw0KPiA+ICsgICAgICAgICAgICAgZmlsdGVyLT5zaWQu aGFuZGxlID0gc2ZpLT5oYW5kbGU7DQo+ID4gKyAgICAgICAgICAgICBmaWx0ZXItPnNmaV9pbmRl eCA9IHNmaS0+aW5kZXg7DQo+ID4gKyAgICAgICAgICAgICBzZmlfb3ZlcndyaXRlID0gMDsNCj4g PiArICAgICB9IGVsc2Ugew0KPiA+ICsgICAgICAgICAgICAgZmlsdGVyLT5zZmlfaW5kZXggPSBv bGRfc2ZpLT5pbmRleDsNCj4gPiArICAgICAgICAgICAgIGZpbHRlci0+c2lkLmhhbmRsZ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ml2LCBjbHNfZmxvd2VyKTsNCj4gPiArICAgICAgICAgICAgIGlmIChlcnIpIHsN Cj4gPiArICAgICAgICAgICAgICAgICAgICAgTkxfU0VUX0VSUl9NU0dfTU9EKGV4dGFjaywgIklu dmFsaWQgUFNGUCBpbnB1dHMiKTsNCj4gPiArICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGVy cjsNCj4gPiArICAgICAgICAgICAgIH0NCj4gPiArICAgICB9IGVsc2Ugew0KPiA+ICsgICAgICAg ICAgICAgTkxfU0VUX0VSUl9NU0dfTU9EKGV4dGFjaywgIlVuc3VwcG9ydGVkIGFjdGlvbnMiKTsN Cj4gPiArICAgICAgICAgICAgIHJldHVybiAtRU9QTk9UU1VQUDsNCj4gPiArICAgICB9DQo+ID4g Kw0KPiA+ICsgICAgIHJldHVybiAwOw0KPiA+ICt9DQo+ID4gKw0KPiA+ICtzdGF0aWMgaW50IGVu ZXRjX3BzZnBfZGVzdHJveV9jbHNmbG93ZXIoc3RydWN0IGVuZXRjX25kZXZfcHJpdiAqcHJpdiwN Cj4gPiArICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBmbG93X2Ns c19vZmZsb2FkICpmKQ0KPiA+ICt7DQo+ID4gKyAgICAgc3RydWN0IGVuZXRjX3N0cmVhbV9maWx0 ZXIgKmZpbHRlcjsNCj4gPiArICAgICBzdHJ1Y3QgbmV0bGlua19leHRfYWNrICpleHRhY2sgPSBm LT5jb21tb24uZXh0YWNrOw0KPiA+ICsgICAgIGludCBlcnI7DQo+ID4gKw0KPiA+ICsgICAgIGlm IChmLT5jb21tb24uY2hhaW5faW5kZXggPj0gcHJpdi0+cHNmcF9jYXAubWF4X3N0cmVhbWlkKSB7 DQo+ID4gKyAgICAgICAgICAgICBOTF9TRVRfRVJSX01TR19NT0QoZXh0YWNrLCAiTm8gU3RyZWFt IGlkZW50aWZ5IHJlc291cmNlISIpOw0KPiA+ICsgICAgICAgICAgICAgcmV0dXJuIC1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XNlIEZMT1dfQkxPQ0tfVU5CSU5EOg0K PiA+ICsgICAgICAgICAgICAgY2xlYXJfYml0KGVuZXRjX2dldF9wb3J0KHByaXYpLCAmZXBzZnAu ZGV2X2JpdG1hcCk7DQo+ID4gKyAgICAgICAgICAgICBpZiAoIWVwc2ZwLmRldl9iaXRtYXApDQo+ ID4gKyAgICAgICAgICAgICAgICAgICAgIGNsZWFuX3BzZnBfYWxsKCk7DQo+ID4gKyAgICAgICAg ICAgICBicmVhazsNCj4gPiArICAgICB9DQo+ID4gKw0KPiA+ICsgICAgIHJldHVybiAwOw0KPiA+ ICt9DQo+ID4gLS0NCj4gPiAyLjE3LjENCj4gPg0KPiANCj4gLS0NCj4gVmluaWNpdXMNCg0KQnIs DQpQbyBMaXUNCg0K