From patchwork Fri Sep 26 06:03:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jingjing Wu X-Patchwork-Id: 552 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id C8C437E44; Fri, 26 Sep 2014 07:58:02 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 910147DEB for ; Fri, 26 Sep 2014 07:57:58 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP; 25 Sep 2014 22:55:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,862,1389772800"; d="scan'208";a="391863734" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by FMSMGA003.fm.intel.com with ESMTP; 25 Sep 2014 22:58:15 -0700 Received: from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com [10.239.29.89]) by shvmail01.sh.intel.com with ESMTP id s8Q64F6r029341; Fri, 26 Sep 2014 14:04:15 +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 s8Q64D9q013025; Fri, 26 Sep 2014 14:04:15 +0800 Received: (from wujingji@localhost) by shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id s8Q64DXK013021; Fri, 26 Sep 2014 14:04:13 +0800 From: Jingjing Wu To: dev@dpdk.org Date: Fri, 26 Sep 2014 14:03:33 +0800 Message-Id: <1411711418-12881-16-git-send-email-jingjing.wu@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1411711418-12881-1-git-send-email-jingjing.wu@intel.com> References: <1411711418-12881-1-git-send-email-jingjing.wu@intel.com> Subject: [dpdk-dev] [PATCH v3 15/20] lib/librte_ether: define structures for configuring flexible payload 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" define structures for configuring flexible payload Signed-off-by: Jingjing Wu Acked-by: Chen Jing D(Mark) Acked-by: Helin Zhang --- lib/librte_ether/rte_eth_ctrl.h | 42 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_ctrl.h index 208082e..e412471 100644 --- a/lib/librte_ether/rte_eth_ctrl.h +++ b/lib/librte_ether/rte_eth_ctrl.h @@ -75,6 +75,25 @@ enum rte_filter_op { * Define all structures for Flow Director Filter type corresponding with specific operations. */ + +/** + * A structure defined a field vector to specify each field. + */ +struct rte_eth_field_vector { + uint8_t offset; /**< Source word offset */ + uint8_t size; /**< Field Size defined in word units */ +}; + +/** + * payload type + */ +enum rte_eth_payload_type { + RTE_ETH_PAYLOAD_UNKNOWN = 0, + RTE_ETH_L2_PAYLOAD, + RTE_ETH_L3_PAYLOAD, + RTE_ETH_L4_PAYLOAD, +}; + /** * flow type */ @@ -91,6 +110,29 @@ enum rte_eth_flow_type { }; /** + * A structure used to select fields extracted from the protocol layers to + * the Field Vector as flexible payload for filter + */ +struct rte_eth_flex_payload_cfg { + enum rte_eth_payload_type type; /**< payload type */ + uint8_t nb_field; /**< the number of folloing fieds */ + struct rte_eth_field_vector field[0]; +}; + +#define RTE_ETH_FDIR_CFG_FLX 0x0001 +/** + * A structure used to config FDIR filter global set + * to support RTE_ETH_FILTER_FDIR with RTE_ETH_FILTER_OP_SET operation. + */ +struct rte_eth_fdir_cfg { + uint16_t cmd; /**< define sub command in the generic OP_SET */ + /** + * A pointer to structure for the configuration e.g. + * struct rte_eth_flex_payload_cfg for FDIR_CFG_FLX + */ + void *cfg; +}; +/** * A structure used to define the input for IPV4 UDP flow */ struct rte_eth_udpv4_flow {