From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0054.outbound.protection.outlook.com [104.47.38.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 27D4821D492EE for ; Thu, 14 Sep 2017 14:20:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=rZk46ixxaQfI64vJR8UjSrncAeRMpBbS9b5s+2A55Jk=; b=HmyrRUc4S6TYyMZruNazt0rPoE/wMGM4iqEiE2OJU7E1lxAbaevSHnlp1RyQjxcGu6Lb3J9zi9WT9fV6w7Z49RMQl08kPOiODiinazoEBx21PP8iN+6YzsNiSSK4bSD8pu9ePLXA1z69dW27VM2DtpyNeBZz0px/V/OtmPustoA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=brijesh.singh@amd.com; Received: from ubuntu-010236106000.amd.com (165.204.78.1) by DM2PR12MB0155.namprd12.prod.outlook.com (2a01:111:e400:50ce::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.35.12; Thu, 14 Sep 2017 21:22:58 +0000 From: Brijesh Singh To: edk2-devel@lists.01.org Cc: Brijesh Singh , Ard Biesheuvel , Jordan Justen , Tom Lendacky , Laszlo Ersek Date: Thu, 14 Sep 2017 16:22:44 -0500 Message-Id: <20170914212247.124937-6-brijesh.singh@amd.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20170914212247.124937-1-brijesh.singh@amd.com> References: <20170914212247.124937-1-brijesh.singh@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: DM5PR20CA0014.namprd20.prod.outlook.com (2603:10b6:3:93::24) To DM2PR12MB0155.namprd12.prod.outlook.com (2a01:111:e400:50ce::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2f7cbd0f-d202-40fa-8474-08d4fbb6c606 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(48565401081)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:DM2PR12MB0155; X-Microsoft-Exchange-Diagnostics: 1; DM2PR12MB0155; 3:yP7QAY80LojXkNLemICdLAUK+epVCTwkpXdXJCuTUK7+MJUPw2Q1ILtir5rvqPL8IOlhRQbcR4Iji613Gi+cnI8Ro5S5CO5qsKvxq90S+MdGzS0QxYlaU7BXjcPLcUxgnt2cOyuhO7lnxlqbNMbUn13w16j0TIVjR8LefyuyPiJ6IN1hEL6CPfDQqprzoU0AXISFDwIqOLjkJ+DX7aC8zV8IEbN+YOtwX19G6D0KtXdqpATaSSFLQaQGpq31hkhq; 25:mdonMyBIve4TGq3ojr2iD9yIAfARukwD5kULnUSVx/SLX/6kgRWNSMPNR5l+LvG8UpSQbqtTgIEYjk0W0SA229NiQX7iCReiEfQTh/3lUF1Wi9CQ2EvQtsidyAu+4rIpzQZY0my7zVEqACN5pSQlpWVXAdvBlo7+Nvms/vhBwDpDqJqpJWcrPEAuOIRUhlqgEOe2KY9yUUM0atUuvSSbeMvd+Xu/2vNnNLPnSmnvP+l5Mm8haIYD8Qo0Z1vPSS/SkJlIDrD+83ROyAvQNywe0I/peicKWa/uzhognnNY/tXkM1hOn3+FLY+MWOMOu5h2bvZP+RpeXyXkCCoXAFbcPw==; 31:BnvoFzmH3NCf3Fii87F0xFZbt6+tnqcDnlkIsqObWtwxP2872QYzZo+HStC6RU4NHfi4Y/MXosF21COH5qteO5IJZuCSfI71dcCMzB1FXOnevr3g28l0gv/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test: UriScan:(20558992708506)(767451399110)(228905959029699); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(6055026)(6041248)(20161123555025)(20161123562025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM2PR12MB0155; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM2PR12MB0155; X-Forefront-PRVS: 0430FA5CB7 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(39860400002)(346002)(376002)(199003)(189002)(53936002)(4326008)(110136004)(50466002)(47776003)(50226002)(81156014)(81166006)(68736007)(54906002)(8676002)(2361001)(66066001)(2950100002)(6916009)(33646002)(2351001)(36756003)(106356001)(105586002)(53416004)(101416001)(48376002)(8936002)(25786009)(6486002)(97736004)(15650500001)(305945005)(7736002)(5660300001)(16526017)(16586007)(2906002)(5003940100001)(1076002)(6116002)(3846002)(316002)(50986999)(6666003)(76176999)(86362001)(478600001)(189998001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR12MB0155; H:ubuntu-010236106000.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR12MB0155; 23:2uQsE86xvs/AJaM/zBMbSyjbGKuXN/lmMG8IelXuI?= =?us-ascii?Q?XkctCcgxWll9FaQ+KjpUEbyJUrcVZO2v+oz7vw2/ST4s99lNfu+yCye5QKa4?= =?us-ascii?Q?h3PnBmtMg0o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mJC/lEvkVhN+DN6IDMLNSEJju9of2nONeCsouZvQS1ApqQ9hm8nUP0EgD+6yBeWLq8PZ1zggsMxypeL49INMHG6Vu9n7OTTUK4TWHSu9sFVMKmYHsYk0ouk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM2PR12MB0155; 20:23UBRnf7mpwe/l+9mrHN55+VnIl4Gk014BnylZCeHMjaOJPqSUnU+twfdpR43YuaHbbjFjsqCwcvZY5r16sCqbcz3bAxDdHrwm8Njv7k9fpwZuTGWWFiRCOYfirl5ycScWqJtVgpzmWfBOPEXUkyGE6lLxh6ZJKBxqktyignYpiYxJvxUYwoBB/ML+NkeH6JUYb/8R0SsW9dqY8sMb76kqjYERM3KtrJjMXI2pvYC5x6zeNEsTlqvd/q/l4Rz3DI X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Sep 2017 21:22:58.8830 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR12MB0155 Subject: [PATCH v4 5/8] OvmfPkg/VirtioNetDxe: update TechNotes 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: Thu, 14 Sep 2017 21:20:01 -0000 Content-Type: text/plain In next patches we will update Virtio transmit to use the device-mapped address of the caller-supplied packet. The patch documents the new model. Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Tom Lendacky Cc: Laszlo Ersek Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Brijesh Singh Reviewed-by: Laszlo Ersek --- OvmfPkg/VirtioNetDxe/TechNotes.txt | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/OvmfPkg/VirtioNetDxe/TechNotes.txt b/OvmfPkg/VirtioNetDxe/TechNotes.txt index fedbaee07ec7..40a22f66dc22 100644 --- a/OvmfPkg/VirtioNetDxe/TechNotes.txt +++ b/OvmfPkg/VirtioNetDxe/TechNotes.txt @@ -312,10 +312,14 @@ in the following: that is shared by all of the head descriptors. This virtio-net request header is never modified by the host. -- Each tail descriptor is re-pointed to the caller-supplied packet buffer - whenever VirtioNetTransmit places the corresponding head descriptor on the - Available Ring. The caller is responsible to hang on to the unmodified buffer - until it is reported transmitted by VirtioNetGetStatus. +- Each tail descriptor is re-pointed to the device-mapped address of the + caller-supplied packet buffer whenever VirtioNetTransmit places the + corresponding head descriptor on the Available Ring. A reverse mapping, from + the device-mapped address to the caller-supplied packet address, is saved in + an associative data structure that belongs to the driver instance. + +- Per spec, the caller is responsible to hang on to the unmodified packet + buffer until it is reported transmitted by VirtioNetGetStatus. Steps of packet transmission: @@ -338,9 +342,11 @@ Steps of packet transmission: - Client code calls VirtioNetGetStatus. In case the Used Ring is empty, the function reports no Tx completion. Otherwise, a head descriptor's index is consumed from the Used Ring and recycled to the private stack. The client - code's original packet buffer address is fetched from the tail descriptor - (where it has been stored at VirtioNetTransmit time) and returned to the - caller. + code's original packet buffer address is calculated by fetching the + device-mapped address from the tail descriptor (where it has been stored at + VirtioNetTransmit time), and by looking up the device-mapped address in the + associative data structure. The reverse-mapped packet buffer address is + returned to the caller. - The Len field of the Used Ring Element is not checked. The host is assumed to have transmitted the entire packet -- VirtioNetTransmit had forced it below -- 2.9.5