From patchwork Wed Jan 6 13:11:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Durrant X-Patchwork-Id: 7968181 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 7D830BEEE5 for ; Wed, 6 Jan 2016 13:20:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A690420173 for ; Wed, 6 Jan 2016 13:20:20 +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 BFE7F200E9 for ; Wed, 6 Jan 2016 13:20:19 +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 1aGnyD-0002wA-VP; Wed, 06 Jan 2016 13:17:45 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aGnyC-0002vR-Qo for xen-devel@lists.xenproject.org; Wed, 06 Jan 2016 13:17:44 +0000 Received: from [85.158.139.211] by server-9.bemta-5.messagelabs.com id 84/69-30270-8F31D865; Wed, 06 Jan 2016 13:17:44 +0000 X-Env-Sender: prvs=80683a78a=Paul.Durrant@citrix.com X-Msg-Ref: server-4.tower-206.messagelabs.com!1452086259!14258377!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 19191 invoked from network); 6 Jan 2016 13:17:41 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-4.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 6 Jan 2016 13:17:40 -0000 X-IronPort-AV: E=Sophos;i="5.20,529,1444694400"; d="scan'208";a="323179051" From: Paul Durrant To: Date: Wed, 6 Jan 2016 13:11:45 +0000 Message-ID: <1452085907-4431-2-git-send-email-paul.durrant@citrix.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1452085907-4431-1-git-send-email-paul.durrant@citrix.com> References: <1452085907-4431-1-git-send-email-paul.durrant@citrix.com> MIME-Version: 1.0 X-DLP: MIA2 Cc: Keir Fraser , Ian Campbell , Tim Deegan , Ian Jackson , Paul Durrant , Jan Beulich Subject: [Xen-devel] [PATCH v3 1/3] public/io/netif.h: document transmit and receive wire formats separately 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 Currently there is no documented wire format for guest receive-side packets but the location of the 'wire format' comment block suggests it is the same as transmit-side. This is almost true but there is a subtle difference in the use of the 'size' field for the first fragment. For clarity this patch creates separate comment blocks for receive and transmit side packet wire formats, tries to be more clear about the distinction between 'fragments' and 'extras', and documents the subtlety concerning the size field of the first fragment. Signed-off-by: Paul Durrant Cc: Ian Campbell Cc: Ian Jackson Cc: Jan Beulich Cc: Keir Fraser Cc: Tim Deegan --- xen/include/public/io/netif.h | 39 ++++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/xen/include/public/io/netif.h b/xen/include/public/io/netif.h index e103cf3..1790ea0 100644 --- a/xen/include/public/io/netif.h +++ b/xen/include/public/io/netif.h @@ -151,22 +151,22 @@ */ /* - * This is the 'wire' format for packets: - * Request 1: netif_tx_request_t -- NETTXF_* (any flags) - * [Request 2: netif_extra_info_t] (only if request 1 has - * NETTXF_extra_info) - * [Request 3: netif_extra_info_t] (only if request 2 has - * XEN_NETIF_EXTRA_MORE) - * Request 4: netif_tx_request_t -- NETTXF_more_data - * Request 5: netif_tx_request_t -- NETTXF_more_data - * ... - * Request N: netif_tx_request_t -- 0 - */ - -/* * Guest transmit * ============== * + * This is the 'wire' format for 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) + * flags = 0 + * size = fragment size + * * Ring slot size is 12 octets, however not all request/response * structs use the full size. * @@ -202,6 +202,19 @@ * Guest receive * ============= * + * This is the 'wire' format for 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) + * flags = 0 + * size = fragment size + * * Ring slot size is 8 octets. * * rx request (netif_rx_request_t)