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 8264F8E79 for ; Wed, 13 Jan 2016 02:13:27 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP; 12 Jan 2016 17:13:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,286,1449561600"; d="scan'208";a="632508859" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by FMSMGA003.fm.intel.com with ESMTP; 12 Jan 2016 17:12:54 -0800 Received: from fmsmsx112.amr.corp.intel.com (10.18.116.6) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 12 Jan 2016 17:12:53 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.110.14) by FMSMSX112.amr.corp.intel.com (10.18.116.6) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 12 Jan 2016 17:12:53 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.183]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.220]) with mapi id 14.03.0248.002; Wed, 13 Jan 2016 09:12:47 +0800 From: "Wu, Jingjing" To: Rahul Lakkireddy , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [RFC v2 1/2] ethdev: add packet filter flow and new behavior switch to fdir Thread-Index: AQHRPX9jli3iOcLCfEOMcpX9qz6b7574w1fQ Date: Wed, 13 Jan 2016 01:12:47 +0000 Message-ID: <9BB6961774997848B5B42BEC655768F8D74B6B@SHSMSX104.ccr.corp.intel.com> References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: Kumar Sanghvi , Felix Marti , Nirranjan Kirubaharan Subject: Re: [dpdk-dev] [RFC v2 1/2] ethdev: add packet filter 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, 13 Jan 2016 01:13:28 -0000 >=20 > diff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_c= trl.h > index ce224ad..5cc22a0 100644 > --- a/lib/librte_ether/rte_eth_ctrl.h > +++ b/lib/librte_ether/rte_eth_ctrl.h > @@ -74,7 +74,11 @@ 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_PKT_FILTER_IPV4_TCP 18 #define > +RTE_ETH_FLOW_PKT_FILTER_IPV4_UDP 19 #define > +RTE_ETH_FLOW_PKT_FILTER_IPV6_TCP 20 #define > +RTE_ETH_FLOW_PKT_FILTER_IPV6_UDP 21 > +#define RTE_ETH_FLOW_MAX 22 >=20 How to distinguish RTE_ETH_FLOW_PKT_FILTER_IPV4_XX with RTE_ETH_FLOW_NONFRA= G_IPV4_XX, what is the difference? > /** > * Feature filter types > @@ -407,6 +411,9 @@ struct rte_eth_l2_flow { struct rte_eth_ipv4_flow { > uint32_t src_ip; /**< IPv4 source address to match. */ > uint32_t dst_ip; /**< IPv4 destination address to match. */ > + uint8_t tos; /**< IPV4 type of service to match. */ > + uint8_t proto; /**< IPV4 proto to match. */ > + uint8_t ttl; /**< IPV4 time to live to match. */ > }; >=20 > /** > @@ -443,6 +450,10 @@ struct rte_eth_sctpv4_flow { struct > rte_eth_ipv6_flow { > uint32_t src_ip[4]; /**< IPv6 source address to match. */ > uint32_t dst_ip[4]; /**< IPv6 destination address to match. */ > + uint8_t tc; /**< IPv6 traffic class to match. */ > + uint32_t flow_label; /**< IPv6 flow label to match. */ > + uint8_t next_header; /**< IPv6 next header to match. */ > + uint8_t hop_limit; /**< IPv6 hop limits to match. */ > }; >=20 There is also a patch http://dpdk.org/dev/patchwork/patch/9661/ which added= these fields. Maybe we can merge them together. > +struct rte_eth_pkt_filter_flow { > + enum rte_eth_pkt_filter_type type; /**< Type of filter */ > + enum rte_eth_pkt_filter_type prio; > + /**< Prioritize the filter type when a packet matches several types */ > + struct rte_eth_pkt_filter pkt; /**< Packet fields to match. */ > + struct rte_eth_pkt_filter mask; /**< Mask for matched fields. */ > +}; > + > +/** > * An union contains the inputs for all types of flow > */ > union rte_eth_fdir_flow { > @@ -514,6 +570,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; > + struct rte_eth_pkt_filter_flow pkt_filter_flow; > }; Why not use rte_eth_XX_flow directly but add a new one? Is it because of th= e mask? If so, how about to add a field in rte_eth_fdir_input like: 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; struct rte_eth_fdir_flow_ext flow_ext; /**< Additional fields to match */ }; Thanks Jingjing