From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-db5eur03on0616.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0a::616]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 7C45C81CF5 for ; Tue, 8 Nov 2016 23:13:35 -0800 (PST) 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=l8sDvBBve6Ks2QiqgEBtEoLIGXRte887pOoUIPNHREc=; b=nOV8/YHAyEzjwyLj4/AK3pInCbFEwm9TNW63O7FfBoN8RrZO4Bj5iuvfaFsE5qq3w5wz8OYrkNAl2YQiXgt4DpNxOl4rDQTJx5VczUUxtIaFTY4uubitlBlPeI+6+ZS/uIEdz7bId5pBiUhZom/FL5MbRW/mMe3mY5PlwIFBr18= Received: from DB5PR04MB0998.eurprd04.prod.outlook.com (10.161.199.12) by DB5PR04MB0997.eurprd04.prod.outlook.com (10.161.199.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.693.12; Wed, 9 Nov 2016 07:13:34 +0000 Received: from DB5PR04MB0998.eurprd04.prod.outlook.com ([10.161.199.12]) by DB5PR04MB0998.eurprd04.prod.outlook.com ([10.161.199.12]) with mapi id 15.01.0693.021; Wed, 9 Nov 2016 07:13:34 +0000 From: Meenakshi Aggarwal To: "edk2-devel@lists.01.org" Thread-Topic: SNP Receive callback Thread-Index: AdI6WFFu6JnkkhihRfqcglJuMVqzrg== Date: Wed, 9 Nov 2016 07:13:34 +0000 Message-ID: Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=meenakshi.aggarwal@nxp.com; x-originating-ip: [192.88.169.1] x-ms-office365-filtering-correlation-id: c53c0fdc-00cc-4cf6-cabf-08d4086feb35 x-microsoft-exchange-diagnostics: 1; DB5PR04MB0997; 7:vKS4lOPqs0JvS9uv/vHbxGC+ZOSWJYcAWera5N639rr/dYhMF4OeC3v1ufD4LYEvnvwQXJn4MdOys9z9QRx0i9GhlRo2I+Y/xS+f46z6dfN5y1Q/yMbdtDbTT+sDYc4DWVogorS+0wT9p0bApPTUYIwhw9P54LsMdt8xdIcDV+HTofIZjwDfdkDQ4MaULgg1Wt/HnfamEYQ+0Wt7tOhCPCFurkcygQA6I+W/R2fhKSbauWoKm20GR5TmiU8259GAulqhEpmlY7MW+i0E4MltYoumfZweawiDDR9HqGzGXN63GIOR6E87YLRZ48sfXlSM01k5MbflxDchqd8IK1W4PMN6rd26pS6ZgHEHBQXbYPI= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DB5PR04MB0997; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(21748063052155); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040176)(6060229)(6045074)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6055026)(6046074)(6072074); SRVR:DB5PR04MB0997; BCL:0; PCL:0; RULEID:; SRVR:DB5PR04MB0997; x-forefront-prvs: 0121F24F22 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(7916002)(189002)(199003)(53474002)(7116003)(101416001)(122556002)(66066001)(3660700001)(8676002)(54356999)(107886002)(97736004)(9686002)(9326002)(3280700002)(105586002)(50986999)(586003)(8936002)(2906002)(790700001)(81166006)(68736007)(81156014)(6116002)(3846002)(87936001)(102836003)(6916009)(7736002)(7846002)(86362001)(229853001)(7696004)(3480700004)(2351001)(450100001)(106356001)(77096005)(110136003)(189998001)(2501003)(5660300001)(74316002)(2900100001)(33656002)(76576001)(92566002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB5PR04MB0997; H:DB5PR04MB0998.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) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Nov 2016 07:13:34.4093 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR04MB0997 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 Subject: SNP Receive callback X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2016 07:13:36 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi, I am implementing network driver for my arm based Soc which installs SNP pr= otocol. As per explanation of EFI_SIMPLE_NETWORK.Receive() in UEFI spec 2.6, typedef EFI_STATUS (EFIAPI *EFI_SIMPLE_NETWORK_RECEIVE) ( IN EFI_SIMPLE_NETWORK_PROTOCOL *This OUT UINTN *HeaderSize OPTIONAL, IN OUT UINTN *BufferSize, OUT VOID *Buffer, OUT EFI_MAC_ADDRESS *SrcAddr OPTIONAL, OUT EFI_MAC_ADDRESS *DestAddr OPTIONAL, OUT UINT16 *Protocol OPTIONAL ); If there is a packet on the receive queue, and the size of the packet is sm= aller than BufferSize, then the contents of the packet will be placed in Bu= ffer, and BufferSize will be updated with the actual size of the packet. If BufferSize is smaller than the received packet, then the size of the rec= eive packet will be placed in BufferSize and EFI_BUFFER_TOO_SMALL will be r= eturned. In my case I am receiving- first packet of size 311 (buffersize is 2048), so I updated buffersize to 3= 11. Second packet of size 316 (buffersize is 311), so I updated buffersize to 3= 16 and returned EFI_BUFFER_TOO_SMALL. Now if I try to assign IP to my interface using dhcp then it doesn't work. If I assign IP statically and try to ping then too it doesn't work. But if I comment out "return EFI_BUFFER_TOO_SMALL" from my SNP receive call= back, then everything starts working. Please help me in understanding what am I missing in my network driver. Why= it is not working if I follow UEFI spec for SNP receive callback. Thanks & Regards, Meenakshi