From patchwork Tue Jan 12 09:58:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Durrant X-Patchwork-Id: 8015681 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C9788BEEE5 for ; Tue, 12 Jan 2016 10:08:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CF0CD20394 for ; Tue, 12 Jan 2016 10:08:15 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [50.57.142.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1FD52203A1 for ; Tue, 12 Jan 2016 10:08:11 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aIvpM-0007Ps-3j; Tue, 12 Jan 2016 10:05:24 +0000 Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aIvpK-0007PI-TC for xen-devel@lists.xenproject.org; Tue, 12 Jan 2016 10:05:23 +0000 Received: from [85.158.143.35] by server-1.bemta-4.messagelabs.com id 84/CF-09708-2EFC4965; Tue, 12 Jan 2016 10:05:22 +0000 X-Env-Sender: prvs=81273039b=Paul.Durrant@citrix.com X-Msg-Ref: server-13.tower-21.messagelabs.com!1452593115!7985141!1 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 26433 invoked from network); 12 Jan 2016 10:05:18 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-13.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 12 Jan 2016 10:05:18 -0000 X-IronPort-AV: E=Sophos;i="5.20,556,1444694400"; d="scan'208";a="324394823" From: Paul Durrant To: Date: Tue, 12 Jan 2016 09:58:55 +0000 Message-ID: <1452592736-6463-2-git-send-email-paul.durrant@citrix.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1452592736-6463-1-git-send-email-paul.durrant@citrix.com> References: <1452592736-6463-1-git-send-email-paul.durrant@citrix.com> MIME-Version: 1.0 X-DLP: MIA1 Cc: Keir Fraser , Ian Campbell , Tim Deegan , Ian Jackson , Paul Durrant , Jan Beulich Subject: [Xen-devel] [PATCH v7 1/2] public/io/netif.h: clarifications to wire formats X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP My previous patch 03809ae7 "document transmit and receive wire formats separately" improved documentation of the receive and transmit wire formats but further clarifications were requested. This patch adds those clarifications. Signed-off-by: Paul Durrant Cc: Ian Campbell Cc: Ian Jackson Cc: Jan Beulich Cc: Keir Fraser Cc: Tim Deegan Acked-by: Ian Campbell --- v6: - v4 of the original patch was committed so this is an incremental version of the patch in v5. v5: - Add extra clarifications. --- xen/include/public/io/netif.h | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/xen/include/public/io/netif.h b/xen/include/public/io/netif.h index 1790ea0..0a3272f 100644 --- a/xen/include/public/io/netif.h +++ b/xen/include/public/io/netif.h @@ -154,19 +154,29 @@ * Guest transmit * ============== * - * This is the 'wire' format for packets: + * This is the 'wire' format for transmit (frontend -> backend) packets: + * * Fragment 1: netif_tx_request_t - flags = NETTXF_* * size = total packet size * [Extra 1: netif_extra_info_t] - (only if fragment 1 flags include * NETTXF_extra_info) + * ... * [Extra N: netif_extra_info_t] - (only if extra N-1 flags include * XEN_NETIF_EXTRA_MORE) * ... * Fragment N: netif_tx_request_t - (only if fragment N-1 flags include - * NETTXF_more_data) + * NETTXF_more_data - flags on preceding + * extras are not relevent here) * flags = 0 * size = fragment size * + * NOTE: + * + * This format slightly is different from that used for receive + * (backend -> frontend) packets. Specifically, in a multi-fragment + * packet the actual size of fragment 1 can only be determined by + * subtracting the sizes of fragments 2..N from the total packet size. + * * Ring slot size is 12 octets, however not all request/response * structs use the full size. * @@ -202,19 +212,29 @@ * Guest receive * ============= * - * This is the 'wire' format for packets: + * This is the 'wire' format for receive (backend -> frontend) packets: + * * Fragment 1: netif_rx_request_t - flags = NETRXF_* * size = fragment size * [Extra 1: netif_extra_info_t] - (only if fragment 1 flags include * NETRXF_extra_info) + * ... * [Extra N: netif_extra_info_t] - (only if extra N-1 flags include * XEN_NETIF_EXTRA_MORE) * ... * Fragment N: netif_rx_request_t - (only if fragment N-1 flags include - * NETRXF_more_data) + * NETRXF_more_data - flags on preceding + * extras are not relevent here) * flags = 0 * size = fragment size * + * NOTE: + * + * This format slightly is different from that used for transmit + * (frontend -> backend) packets. Specifically, in a multi-fragment + * packet the size of the packet can only be determined by summing the + * sizes of fragments 1..N. + * * Ring slot size is 8 octets. * * rx request (netif_rx_request_t)