From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=104.47.2.43; helo=eur01-db5-obe.outbound.protection.outlook.com; envelope-from=vabhav.sharma@nxp.com; receiver=edk2-devel@lists.01.org Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0043.outbound.protection.outlook.com [104.47.2.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 5122F21F3C186 for ; Mon, 9 Oct 2017 10:09:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=dOKxRYpDlbHFADFb495FQcMFrgW0HsAsWQtW2UEW9xA=; b=d/umczLUJR6yf4hF5mYKfZIXkuQ84YoIQteq6lp56H4ybOtxFKyzK1XfjWxAuKao1XthWb7bryoSAGERuwhHDc9eSKhpb15biosrynh63Pk+bhLb4YOn62esAVqLgS9RZFh7630wt4OcPZhRWgKNYzfAriubIw2yt/WOHTTrIjM= Received: from DB4PR04MB299.eurprd04.prod.outlook.com (10.141.239.21) by DB4PR04MB298.eurprd04.prod.outlook.com (10.141.239.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Mon, 9 Oct 2017 17:12:49 +0000 Received: from DB4PR04MB299.eurprd04.prod.outlook.com ([fe80::e4b0:da81:40ba:c125]) by DB4PR04MB299.eurprd04.prod.outlook.com ([fe80::e4b0:da81:40ba:c125%18]) with mapi id 15.20.0077.020; Mon, 9 Oct 2017 17:12:49 +0000 From: Vabhav Sharma To: "siyuan.fu@intel.com" CC: "edk2-devel@lists.01.org" Thread-Topic: MTFTP file transfer timeout error Thread-Index: AdMziPrTGH6+Na2GSdiTFpRwROFIcwA0L1PgAPyz/iABa4zI4ACpChdgABoBtwA= Date: Mon, 9 Oct 2017 17:12:49 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [203.122.1.67] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB4PR04MB298; 6:NmwFx0GcKJyaxKCqd5d1ExxtkKMYBh85UC9xpJ8kVCCSUCPerzuuO3MQMWd1Xt0pjWC7dLhbKANX9EglF10wpV7j4VFYKpIfV06wYRqdri3FNyE7CGarK4Fyu0rZ3WfPcMEhEZ8wQtGk3qv/E+8WeoffqvjIRVxS0L3aAlPPZGs1f/4h0vcf1/6CSzoFyhB7EDRxktWV8kcEe274Xdn+HoQKojUdrBASqCxIq/DASQexf110/jsudq1aViPFXcWDQkdXJoAkJ6eAlWytyqYiFSc1Ve+F97Cgj9fJLu+MBvlMinQsfCYs1O7gghcUG073gmh9I+zHHttQXeNbIdaIoA==; 5:CAZ+swesJ+DBnAOvpyYfEnwUmHuw9eEW7V3BghOP56EUx7PCoDkVUcFkgh9uoozVO0gGEYntzygnrqTyoWU1EBg+upgUYHW3ClvBFzvWgf8iSjoxXCmHN7yoz/PwDrtpBNmhGHeWGif+88W05E6ilQ==; 24:2XBD+PALisjkwVn1sqky96UU4gPOcwvwz2S5erM+xz4q8OEae7c3tKuNuepiAbObLfVzn7hUqs5PIiFTIaD5kOohn0KEX41z8PKBPn1igcA=; 7:eOBgUj6yr0h8hAobrJ31GxU/uXRM7NIkIRI7Rj5fV8MpChQs1PbBHY2ZU1MC4GcmmxXc6z2K/NC6InL9em1+AMGoQ0hq0asGi10ottKD1z0vMZjwivH6/TGTz4dxtTKVsi8L/jcoUaZaaFsZApBv/SLIO3HAvg5S4h7bzS/zLBIdAhbeiI3+cWEj5xtvDWsSKypThJjJbILl7iXhgJPODELl8agIYG8SLNzAgB/PoPA= x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: dd018562-b4c5-45b8-365a-08d50f38f7d8 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(48565401081)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:DB4PR04MB298; x-ms-traffictypediagnostic: DB4PR04MB298: x-exchange-antispam-report-test: UriScan:(158342451672863)(185117386973197)(162533806227266)(228905959029699); x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(100000703101)(100105400095)(6055026)(6041248)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123560025)(20161123558100)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DB4PR04MB298; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DB4PR04MB298; x-forefront-prvs: 045584D28C x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(346002)(376002)(39860400002)(13464003)(189002)(53754006)(377454003)(199003)(53474002)(5660300001)(3660700001)(86362001)(229853002)(33656002)(76176999)(54356999)(6436002)(50986999)(6506006)(106356001)(6916009)(2950100002)(2351001)(105586002)(2900100001)(53546010)(68736007)(345774005)(217423001)(53936002)(55016002)(99286003)(6306002)(9686003)(966005)(101416001)(7696004)(6246003)(478600001)(25786009)(53376002)(53366004)(66066001)(14454004)(3280700002)(8936002)(8676002)(4326008)(316002)(97736004)(81166006)(81156014)(93886005)(5640700003)(74316002)(7736002)(3846002)(6116002)(102836003)(189998001)(305945005)(2906002)(5890100001)(2501003)(5250100002)(10090945008)(19627235001); DIR:OUT; SFP:1101; SCL:1; SRVR:DB4PR04MB298; H:DB4PR04MB299.eurprd04.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=vabhav.sharma@nxp.com; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Oct 2017 17:12:49.2114 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB4PR04MB298 Subject: Re: MTFTP file transfer timeout error X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2017 17:09:25 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Fu Siyuan, Thank you for explanation and hope you enjoyed vacation. I am using 32K block size for file transfer. IP layer divides the 32K block size into 23 number of fragments(with last f= ragment of less size indicating no more fragments) Using tcpdump and debug code the flow is: NIC interface receives 23 fragments and pass it to upper layer. Mtftp4 Client receives the data block 'x' with expected block number 'x+1' Mtftp4 Client Sends ACK for received data block 'x' After receiving approximate 900x block, NIC interface receive 22 fragments = instead of 23(One packet drop),At this point function MnpReceivePacket() di= dn't receive more packets with status as 'EFI_NOT_READY' with <>TFTP Server keeps on sending data(23 fragments) block 'x+1'(900) expectin= g ACK for data block 'x+1'(900),Whereas <>Mtftp4 Client retransmit acknowledgement six times for data block 'x'(899= ) before going to timeout expecting next data block 'x+1'(900). Added debug logs in the below code and Mtft4 client didn't receive data onc= e MnpReceivePacket() status is set to 'EFI_NOT_READY' causing timeout. Is this expected if one frame is dropped at Ethernet Layer than whole packe= t will be discarded at IP layer? Regards, Vabhav -----Original Message----- From: Fu, Siyuan [mailto:siyuan.fu@intel.com]=20 Sent: Monday, October 09, 2017 7:28 AM To: Vabhav Sharma ; edk2-devel@lists.01.org Subject: RE: MTFTP file transfer timeout error Hi, Vabhav Sorry for the late response, I just came back from the vacation. The default retry count for tftp shell command is 6, which means the ACK pa= cket will be retransmitted 6 times before the code goes to the Mtftp4CleanO= peration() you marked below. The MTFTP driver always saves the last transmi= tted packet in Instance->LastPacket, and the Mtftp4Retransmit() will try to= retransmit it if not reach the max retry count. As you mentioned 1K block size is always success, I guess it's may because = the IP fragment. A MTFTP(UDP) packet which is larger than 1.5K (the default= MTU) will be fragmented to several IP frame. During the transmit, the whol= e UDP packet will be discarded by the IP layer if any of the IP fragment is= lost in the network. As a result, using large MTFTP block size will increa= se the possibility of timeout in bad network connection. I suggest you add some debug in Mtftp4RrqInput() in below lines to confirm = if the EFI client can receive the MTFTP packet correctly, also you could us= e Wireshark in your server to check whether it receives the ACK from client= . switch (Opcode) { case EFI_MTFTP4_OPCODE_DATA: if ((Len > (UINT32) (MTFTP4_DATA_HEAD_LEN + Instance->BlkSize)) || (Len < (UINT32) MTFTP4_DATA_HEAD_LEN)) { goto ON_EXIT; } Status =3D Mtftp4RrqHandleData (Instance, Packet, Len, Multicast, &Com= pleted); break; BestRegards Fu Siyuan -----Original Message----- From: Vabhav Sharma [mailto:vabhav.sharma@nxp.com] Sent: Friday, October 6, 2017 1:26 AM To: Fu, Siyuan ; edk2-devel@lists.01.org Subject: RE: MTFTP file transfer timeout error Dear Experts, I traced that timeout error for different block size during file transfer u= sing tftp(rrq opcode) is returned from function Mtftp4OnTimerTick() TFTP = layer in UEFI network stack. Mtftp4OnTimerTick() // // Retransmit the packet if haven't reach the maxmium retry count, // otherwise exit the transfer. // if (++Instance->CurRetry < Instance->MaxRetry) { Mtftp4Retransmit (Instance); Mtftp4SetTimeout (Instance); } else { Mtftp4CleanOperation (Instance, EFI_TIMEOUT); //Timeout is= set continue; } Once this is set, It gets populated to downloadfile() function in tftp shel= lpkg library. There seems to be issue(corruption) with tfp client state machine -Not send= ing ACK for received data blocks -Sending duplicate ACK If server don't receive ACK, It stops sending data packets and timeout occu= rs after maximum retry. Please suggest if this is new or known issue to be fixed? Regards, Vabhav -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Vabh= av Sharma Sent: Thursday, September 28, 2017 5:04 PM To: siyuan.fu@intel.com Cc: edk2-devel@lists.01.org; edk2-devel Subject: Re: [edk2] MTFTP file transfer timeout error [This sender failed our fraud detection checks and may not be who they appe= ar to be. Learn about spoofing at http://aka.ms/LearnAboutSpoofing] Hello Fu Siyuan, I see that blocksize option with tftp command is introduced with commit 2be= 45bfe2779043bc3566e879e7ec279412012dc. Could you please help me clarify with the timeout error behavior observed i= n previous mail Please note the behavior varies for different file type(Attached sheet) Reg= ards, Vabhav -----Original Message----- From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of Vabh= av Sharma Sent: Saturday, September 23, 2017 4:21 PM To: edk2-devel@lists.01.org; edk2-devel Subject: [edk2] MTFTP file transfer timeout error [This sender failed our fraud detection checks and may not be who they appe= ar to be. Learn about spoofing at http://aka.ms/LearnAboutSpoofing] Hi All, I am facing timeout error with file transfer using tftp on UEFI shell with = ARM based SoCs Command used: tftp -s -i = File transfer with file size greater 50 or 60 MB is returning timeout(Also = depends on type of file like data file, ASCII file, boot sector) I verified by playing around with blocksize from 32K to 42K for different f= ile size(100MB,200MB,500MB) and identify that increasing the block size for= large file size helps with successful transfer. File transfer is always successful with 1K blocksize but file transfer time= is increased. Please suggest if there is any link between block size with file size or an= yone faced such issue? I assume expectation is to use any blocksize from 51= 2(default) to 64K. Regards, Vabhav _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel