From patchwork Wed Dec 23 10:06:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Durrant X-Patchwork-Id: 7909791 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 F1AADBEEE5 for ; Wed, 23 Dec 2015 10:14:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0C63520459 for ; Wed, 23 Dec 2015 10:14:09 +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 B5F8120450 for ; Wed, 23 Dec 2015 10:14:07 +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 1aBgO8-00033o-74; Wed, 23 Dec 2015 10:11:20 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aBgO5-000338-Nu for xen-devel@lists.xenproject.org; Wed, 23 Dec 2015 10:11:17 +0000 Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id 6E/95-12831-4437A765; Wed, 23 Dec 2015 10:11:16 +0000 X-Env-Sender: prvs=7929e83f2=Paul.Durrant@citrix.com X-Msg-Ref: server-11.tower-206.messagelabs.com!1450865475!12415568!1 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 63192 invoked from network); 23 Dec 2015 10:11:16 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-11.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 23 Dec 2015 10:11:16 -0000 X-IronPort-AV: E=Sophos;i="5.20,468,1444694400"; d="scan'208";a="327121642" From: Paul Durrant To: Date: Wed, 23 Dec 2015 10:06:35 +0000 Message-ID: <1450865195-12883-4-git-send-email-paul.durrant@citrix.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1450865195-12883-1-git-send-email-paul.durrant@citrix.com> References: <1450865195-12883-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 3/3] public/io/netif.h: document new extra info for passing hash values 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 To properly support NDIS RSS, the Windows frontend PV driver needs the toeplitz hash value calculated by the backend (otherwise it would have to duplicate the calculation). This patch adds documentation for "feature-hash" and a definition of a new XEN_NETIF_EXTRA_TYPE_HASH extra info segment which both frontends and backends can use to pass hash values to the other end. 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 | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/xen/include/public/io/netif.h b/xen/include/public/io/netif.h index 612dbd0..fd96d87 100644 --- a/xen/include/public/io/netif.h +++ b/xen/include/public/io/netif.h @@ -151,6 +151,12 @@ */ /* + * "feature-hash" advertises the capability to accept extra info slots of + * type XEN_NETIF_EXTRA_TYPE_HASH. They will not be sent by either end + * unless the other end advertises this feature. + */ + +/* * Control ring: * * Some features, such as toeplitz hashing (detailed below), require a @@ -630,6 +636,18 @@ struct xen_netif_ctrl_msg_hdr { * type: Must be XEN_NETIF_EXTRA_TYPE_MCAST_{ADD,DEL} * flags: XEN_NETIF_EXTRA_FLAG_* * addr: address to add/remove + * + * XEN_NETIF_EXTRA_TYPE_HASH: + * + * 0 1 2 3 4 5 6 7 octet + * +-----+-----+-----+-----+-----+-----+-----+-----+ + * |type |flags|htype| pad |LSB ---- value ---- MSB| + * +-----+-----+-----+-----+-----+-----+-----+-----+ + * + * type: Must be XEN_NETIF_EXTRA_TYPE_HASH + * flags: XEN_NETIF_EXTRA_FLAG_* + * htype: XEN_NETIF_HASH_TYPE_* + * value: Hash value */ /* Protocol checksum field is blank in the packet (hardware offload)? */ @@ -663,7 +681,8 @@ typedef struct netif_tx_request netif_tx_request_t; #define XEN_NETIF_EXTRA_TYPE_GSO (1) /* u.gso */ #define XEN_NETIF_EXTRA_TYPE_MCAST_ADD (2) /* u.mcast */ #define XEN_NETIF_EXTRA_TYPE_MCAST_DEL (3) /* u.mcast */ -#define XEN_NETIF_EXTRA_TYPE_MAX (4) +#define XEN_NETIF_EXTRA_TYPE_HASH (4) /* u.hash */ +#define XEN_NETIF_EXTRA_TYPE_MAX (5) /* netif_extra_info_t flags. */ #define _XEN_NETIF_EXTRA_FLAG_MORE (0) @@ -675,6 +694,16 @@ typedef struct netif_tx_request netif_tx_request_t; #define XEN_NETIF_GSO_TYPE_TCPV6 (2) /* + * Hash types. (See NETIF_CTRL_TOEPLITZ_FLAG_* definitions above + * for more information). + */ +#define XEN_NETIF_HASH_TYPE_NONE 0 +#define XEN_NETIF_HASH_TYPE_IPV4 1 +#define XEN_NETIF_HASH_TYPE_IPV4_TCP 2 +#define XEN_NETIF_HASH_TYPE_IPV6 3 +#define XEN_NETIF_HASH_TYPE_IPV6_TCP 4 + +/* * This structure needs to fit within both netif_tx_request_t and * netif_rx_response_t for compatibility. */ @@ -691,6 +720,11 @@ struct netif_extra_info { struct { uint8_t addr[6]; } mcast; + struct { + uint8_t type; + uint8_t pad; + uint8_t value[4]; + } hash; uint16_t pad[3]; } u; };