From patchwork Sat Dec 7 00:59:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajit Khaparde X-Patchwork-Id: 63617 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id EF858A04F3; Sat, 7 Dec 2019 01:59:34 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id ABFF328EE; Sat, 7 Dec 2019 01:59:33 +0100 (CET) Received: from rnd-relay.smtp.broadcom.com (rnd-relay.smtp.broadcom.com [192.19.229.170]) by dpdk.org (Postfix) with ESMTP id 929DA2B93 for ; Sat, 7 Dec 2019 01:59:31 +0100 (CET) Received: from mail-irv-17.broadcom.com (mail-irv-17.lvn.broadcom.net [10.75.242.48]) by rnd-relay.smtp.broadcom.com (Postfix) with ESMTP id F3AE030C0D4; Fri, 6 Dec 2019 16:55:09 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.10.3 rnd-relay.smtp.broadcom.com F3AE030C0D4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1575680110; bh=NJIucnIKMzxYkytly7vAmtiKYzfRWnAckOOHVPI6WYE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wFvfnmP6UKN3/I49a9NQib52jkwZHdSOMdzocthhn1ECPA15tZLM4yt6DHBkv2hJv CAcXjfVBwm5F+VxERhG0rDR7WR72ofoQ3OddUtKmqKRTaMP03uXRClMwE+CYeOX79i 1+3vcwyo3x/NoFdUq2xzGB6M6DRGc1xu1lqgIj0U= Received: from localhost.localdomain (unknown [10.230.0.104]) by mail-irv-17.broadcom.com (Postfix) with ESMTP id 6419914008B; Fri, 6 Dec 2019 16:59:27 -0800 (PST) From: Ajit Khaparde To: dev@dpdk.org Cc: ferruh.yigit@intel.com Date: Fri, 6 Dec 2019 16:59:17 -0800 Message-Id: <20191207005919.10962-2-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122.2) In-Reply-To: <20191207005919.10962-1-ajit.khaparde@broadcom.com> References: <20191207005919.10962-1-ajit.khaparde@broadcom.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 1/3] ethdev: add RSS hash level X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This patch adds ability to configure RSS hash level in hardware. This feature will allow an application to select RSS hash calculation on outer or inner headers for tunneled packets. Signed-off-by: Ajit Khaparde --- lib/librte_ethdev/rte_ethdev.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h index 18a9defc2..5189bdbab 100644 --- a/lib/librte_ethdev/rte_ethdev.h +++ b/lib/librte_ethdev/rte_ethdev.h @@ -444,11 +444,35 @@ struct rte_vlan_filter_conf { * The *rss_hf* field of the *rss_conf* structure indicates the different * types of IPv4/IPv6 packets to which the RSS hashing must be applied. * Supplying an *rss_hf* equal to zero disables the RSS feature. + * + * The *rss_level* field of the *rss_conf* structure indicates the + * Packet encapsulation level RSS hash @p types apply to. + * + * - @p 0 requests the default behavior. Depending on the packet + * type, it can mean outermost, innermost, anything in between or + * even no RSS. + * + * It basically stands for the innermost encapsulation level RSS + * can be performed on according to PMD and device capabilities. + * + * - @p 1 requests RSS to be performed on the outermost packet + * encapsulation level. + * + * - @p 2 and subsequent values request RSS to be performed on the + * specified inner packet encapsulation level, from outermost to + * innermost (lower to higher values). + * + * Support for values other than @p 0 is dependent on the underlying + * hardware in use. + * + * Requesting a specific RSS level on unrecognized traffic results + * in undefined behavior. */ struct rte_eth_rss_conf { uint8_t *rss_key; /**< If not NULL, 40-byte hash key. */ uint8_t rss_key_len; /**< hash key length in bytes. */ uint64_t rss_hf; /**< Hash functions to apply - see below. */ + uint32_t rss_level; /**< RSS hash level */ }; /* @@ -599,6 +623,8 @@ rte_eth_rss_hf_refine(uint64_t rss_hf) ETH_RSS_GENEVE | \ ETH_RSS_NVGRE) +#define ETH_RSS_LEVEL_DEFAULT 0 + /* * Definitions used for redirection table entry size. * Some RSS RETA sizes may not be supported by some drivers, check the @@ -1103,6 +1129,7 @@ struct rte_eth_conf { #define DEV_RX_OFFLOAD_SCTP_CKSUM 0x00020000 #define DEV_RX_OFFLOAD_OUTER_UDP_CKSUM 0x00040000 #define DEV_RX_OFFLOAD_RSS_HASH 0x00080000 +#define DEV_RX_OFFLOAD_RSS_LEVEL 0x00100000 #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \ DEV_RX_OFFLOAD_UDP_CKSUM | \