From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id B93916A80 for ; Mon, 13 Oct 2014 08:05:35 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 12 Oct 2014 23:03:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,708,1406617200"; d="scan'208";a="604350088" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by fmsmga001.fm.intel.com with ESMTP; 12 Oct 2014 23:13:06 -0700 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id s9D6D3GP030293; Mon, 13 Oct 2014 14:13:03 +0800 Received: from shecgisg004.sh.intel.com (localhost [127.0.0.1]) by shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id s9D6D1L5012266; Mon, 13 Oct 2014 14:13:03 +0800 Received: (from hzhan75@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id s9D6D1Zc012262; Mon, 13 Oct 2014 14:13:01 +0800 From: Helin Zhang To: dev@dpdk.org Date: Mon, 13 Oct 2014 14:12:42 +0800 Message-Id: <1413180766-12211-4-git-send-email-helin.zhang@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1413180766-12211-1-git-send-email-helin.zhang@intel.com> References: <1412058028-10971-2-git-send-email-helin.zhang@intel.com> <1413180766-12211-1-git-send-email-helin.zhang@intel.com> Subject: [dpdk-dev] [PATCH v4 3/7] ethdev: add structures and enum for hash filter control X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Oct 2014 06:05:36 -0000 Structures and enum are added in rte_eth_ctrl.h to support hash filter control. Signed-off-by: Helin Zhang --- lib/librte_ether/rte_eth_ctrl.h | 74 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_ctrl.h index aaea075..10197fc 100644 --- a/lib/librte_ether/rte_eth_ctrl.h +++ b/lib/librte_ether/rte_eth_ctrl.h @@ -73,6 +73,80 @@ enum rte_filter_op { RTE_ETH_FILTER_OP_MAX, }; +/** + * Hash filter information types. + */ +enum rte_eth_hash_filter_info_type { + RTE_ETH_HASH_FILTER_INFO_TYPE_UNKNOWN = 0, + RTE_ETH_HASH_FILTER_INFO_TYPE_SYM_HASH_ENA_PER_PCTYPE, + RTE_ETH_HASH_FILTER_INFO_TYPE_SYM_HASH_ENA_PER_PORT, + RTE_ETH_HASH_FILTER_INFO_TYPE_FILTER_SWAP, + RTE_ETH_HASH_FILTER_INFO_TYPE_HASH_FUNCTION, + RTE_ETH_HASH_FILTER_INFO_TYPE_MAX, +}; + +/** + * Hash function types. + */ +enum rte_eth_hash_function { + RTE_ETH_HASH_FUNCTION_UNKNOWN = 0, + RTE_ETH_HASH_FUNCTION_TOEPLITZ, + RTE_ETH_HASH_FUNCTION_SIMPLE_XOR, + RTE_ETH_HASH_FUNCTION_MAX, +}; + +/** + * A structure used to set or get symmetric hash enable information, to support + * 'RTE_ETH_FILTER_HASH', 'RTE_ETH_FILTER_OP_GET/RTE_ETH_FILTER_OP_SET', with + * information type 'RTE_ETH_HASH_FILTER_INFO_TYPE_SYM_HASH_ENA_PER_PCTYPE'. + */ +struct rte_eth_sym_hash_ena_info { + /**< packet classification type, defined in rte_ethdev.h */ + uint8_t pctype; + uint8_t enable; /**< enable or disable flag */ +}; + +/** + * A structure used to set or get filter swap information, to support + * 'RTE_ETH_FILTER_HASH', 'RTE_ETH_FILTER_OP_GET/RTE_ETH_FILTER_OP_SET', + * with information type 'RTE_ETH_HASH_FILTER_INFO_TYPE_FILTER_SWAP'. + */ +struct rte_eth_filter_swap_info { + /**< Packet classification type, defined in rte_ethdev.h */ + uint8_t pctype; + /**< Offset of the 1st field of the 1st couple to be swapped. */ + uint8_t off0_src0; + /**< Offset of the 2nd field of the 1st couple to be swapped. */ + uint8_t off0_src1; + /**< Field length of the first couple. */ + uint8_t len0; + /**< Offset of the 1st field of the 2nd couple to be swapped. */ + uint8_t off1_src0; + /**< Offset of the 2nd field of the 2nd couple to be swapped. */ + uint8_t off1_src1; + /**< Field length of the second couple. */ + uint8_t len1; +}; + +/** + * A structure used to set or get hash filter information, to support filter + * type of 'RTE_ETH_FILTER_HASH' and its operations. + */ +struct rte_eth_hash_filter_info { + enum rte_eth_hash_filter_info_type info_type; /**< Information type. */ + /**< Details of hash filter infomation */ + union { + /* For RTE_ETH_HASH_FILTER_INFO_TYPE_SYM_HASH_ENA_PER_PCTYPE */ + struct rte_eth_sym_hash_ena_info sym_hash_ena; + /* For RTE_ETH_HASH_FILTER_INFO_TYPE_FILTER_SWAP */ + struct rte_eth_filter_swap_info filter_swap; + /* For RTE_ETH_HASH_FILTER_INFO_TYPE_SYM_HASH_ENA_PER_PORT */ + uint8_t enable; + /* For RTE_ETH_HASH_FILTER_INFO_TYPE_HASH_FUNCTION */ + enum rte_eth_hash_function hash_function; + } info; +}; + #ifdef __cplusplus } #endif -- 1.8.1.4