From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from stargate3.asicdesigners.com (stargate.chelsio.com [12.32.117.8]) by dpdk.org (Postfix) with ESMTP id 1C56F95D9 for ; Wed, 3 Feb 2016 09:32:41 +0100 (CET) Received: from localhost (scalar.blr.asicdesigners.com [10.193.185.94]) by stargate3.asicdesigners.com (8.13.8/8.13.8) with ESMTP id u138WcI7024892; Wed, 3 Feb 2016 00:32:39 -0800 From: Rahul Lakkireddy To: dev@dpdk.org Date: Wed, 3 Feb 2016 14:02:22 +0530 Message-Id: X-Mailer: git-send-email 2.5.3 In-Reply-To: References: In-Reply-To: References: Cc: Kumar Sanghvi , Nirranjan Kirubaharan Subject: [dpdk-dev] [PATCH 01/10] ethdev: add a generic flow and new behavior switch to fdir 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: Wed, 03 Feb 2016 08:32:42 -0000 Add a new raw packet flow that allows specifying generic flow input. Add the ability to provide masks for fields in flow to allow range of values. Add a new behavior switch. Add the ability to provide behavior arguments to allow rewriting matched fields with new values. Ex: allows to provide new ip and port addresses to rewrite the fields of packets matching a filter rule before NAT'ing. Signed-off-by: Rahul Lakkireddy Signed-off-by: Kumar Sanghvi --- doc/guides/rel_notes/release_2_3.rst | 3 +++ lib/librte_ether/rte_eth_ctrl.h | 15 ++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/doc/guides/rel_notes/release_2_3.rst b/doc/guides/rel_notes/release_2_3.rst index 99de186..19ce954 100644 --- a/doc/guides/rel_notes/release_2_3.rst +++ b/doc/guides/rel_notes/release_2_3.rst @@ -39,6 +39,9 @@ API Changes ABI Changes ----------- +* New flow type ``RTE_ETH_FLOW_RAW_PKT`` had been introduced and hence + ``RTE_ETH_FLOW_MAX`` had been increased to 19. + Shared Library Versions ----------------------- diff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_ctrl.h index ce224ad..1bc0d03 100644 --- a/lib/librte_ether/rte_eth_ctrl.h +++ b/lib/librte_ether/rte_eth_ctrl.h @@ -74,7 +74,8 @@ extern "C" { #define RTE_ETH_FLOW_IPV6_EX 15 #define RTE_ETH_FLOW_IPV6_TCP_EX 16 #define RTE_ETH_FLOW_IPV6_UDP_EX 17 -#define RTE_ETH_FLOW_MAX 18 +#define RTE_ETH_FLOW_RAW_PKT 18 +#define RTE_ETH_FLOW_MAX 19 /** * Feature filter types @@ -499,6 +500,9 @@ struct rte_eth_tunnel_flow { struct ether_addr mac_addr; /**< Mac address to match. */ }; +/**< Max length of raw packet in bytes. */ +#define RTE_ETH_RAW_PKT_FLOW_MAX_LEN 256 + /** * An union contains the inputs for all types of flow */ @@ -514,6 +518,7 @@ union rte_eth_fdir_flow { struct rte_eth_ipv6_flow ipv6_flow; struct rte_eth_mac_vlan_flow mac_vlan_flow; struct rte_eth_tunnel_flow tunnel_flow; + uint8_t raw_pkt_flow[RTE_ETH_RAW_PKT_FLOW_MAX_LEN]; }; /** @@ -534,6 +539,8 @@ struct rte_eth_fdir_input { uint16_t flow_type; union rte_eth_fdir_flow flow; /**< Flow fields to match, dependent on flow_type */ + union rte_eth_fdir_flow flow_mask; + /**< Mask for the fields matched, dependent on flow */ struct rte_eth_fdir_flow_ext flow_ext; /**< Additional fields to match */ }; @@ -545,6 +552,7 @@ enum rte_eth_fdir_behavior { RTE_ETH_FDIR_ACCEPT = 0, RTE_ETH_FDIR_REJECT, RTE_ETH_FDIR_PASSTHRU, + RTE_ETH_FDIR_SWITCH, }; /** @@ -558,6 +566,9 @@ enum rte_eth_fdir_status { RTE_ETH_FDIR_REPORT_FLEX_8, /**< Report 8 flex bytes. */ }; +/**< Max # of behavior arguments */ +#define RTE_ETH_BEHAVIOR_ARG_MAX_LEN 256 + /** * A structure used to define an action when match FDIR packet filter. */ @@ -569,6 +580,8 @@ struct rte_eth_fdir_action { /**< If report_status is RTE_ETH_FDIR_REPORT_ID_FLEX_4 or RTE_ETH_FDIR_REPORT_FLEX_8, flex_off specifies where the reported flex bytes start from in flexible payload. */ + uint8_t behavior_arg[RTE_ETH_BEHAVIOR_ARG_MAX_LEN]; + /**< Extra arguments for behavior taken */ }; /** -- 2.5.3