From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 5E3C2C502 for ; Fri, 23 Oct 2015 12:42:05 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP; 23 Oct 2015 03:39:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,186,1444719600"; d="scan'208";a="586588431" Received: from irsmsx101.ger.corp.intel.com ([163.33.3.153]) by FMSMGA003.fm.intel.com with ESMTP; 23 Oct 2015 03:39:20 -0700 Received: from irsmsx111.ger.corp.intel.com (10.108.20.4) by IRSMSX101.ger.corp.intel.com (163.33.3.153) with Microsoft SMTP Server (TLS) id 14.3.248.2; Fri, 23 Oct 2015 11:39:19 +0100 Received: from irsmsx106.ger.corp.intel.com ([169.254.8.229]) by irsmsx111.ger.corp.intel.com ([169.254.2.212]) with mapi id 14.03.0248.002; Fri, 23 Oct 2015 11:39:19 +0100 From: "Chilikin, Andrey" To: "Lu, Wenzhuo" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v4 1/7] lib/librte_ether: modify the structures for fdir new modes Thread-Index: AQHRDTkmV0nQOsllGku/mO4NbcGKYJ543z6g Date: Fri, 23 Oct 2015 10:39:19 +0000 Message-ID: References: <1443161125-1035-1-git-send-email-wenzhuo.lu@intel.com> <1445566690-15767-1-git-send-email-wenzhuo.lu@intel.com> <1445566690-15767-2-git-send-email-wenzhuo.lu@intel.com> In-Reply-To: <1445566690-15767-2-git-send-email-wenzhuo.lu@intel.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v4 1/7] lib/librte_ether: modify the structures for fdir new modes 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: Fri, 23 Oct 2015 10:42:06 -0000 I would suggest rearranging members of rte_eth_fdir_tunnel_type to set RTE_= FDIR_TUNNEL_TYPE_UNKNOWN=3D0 so any global/static variables or variables af= ter memset(0) would have unknown type. Regards, Andrey > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Wenzhuo Lu > Sent: Friday, October 23, 2015 3:18 AM > To: dev@dpdk.org > Subject: [dpdk-dev] [PATCH v4 1/7] lib/librte_ether: modify the structure= s for > fdir new modes >=20 > Define the new modes and modify the filter and mask structures for the ma= c > vlan and tunnel modes. >=20 > Signed-off-by: Wenzhuo Lu > --- > lib/librte_ether/rte_eth_ctrl.h | 51 +++++++++++++++++++++++++++++++++--= -- > ---- > 1 file changed, 42 insertions(+), 9 deletions(-) >=20 > diff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_c= trl.h > index 26b7b33..cf32814 100644 > --- a/lib/librte_ether/rte_eth_ctrl.h > +++ b/lib/librte_ether/rte_eth_ctrl.h > @@ -377,18 +377,46 @@ struct rte_eth_sctpv6_flow { }; >=20 > /** > + * A structure used to define the input for MAC VLAN flow */ struct > +rte_eth_mac_vlan_flow { > + struct ether_addr mac_addr; /**< Mac address to match. */ }; > + > +/** > + * Tunnel type for flow director. > + */ > +enum rte_eth_fdir_tunnel_type { > + RTE_FDIR_TUNNEL_TYPE_NVGRE =3D 0, > + RTE_FDIR_TUNNEL_TYPE_VXLAN, > + RTE_FDIR_TUNNEL_TYPE_UNKNOWN, > +}; > + > +/** > + * A structure used to define the input for tunnel flow, now it's VxLAN > +or > + * NVGRE > + */ > +struct rte_eth_tunnel_flow { > + enum rte_eth_fdir_tunnel_type tunnel_type; /**< Tunnel type to > match. */ > + uint32_t tunnel_id; /**< Tunnel ID to match. TNI= , VNI... > */ > + struct ether_addr mac_addr; /**< Mac address to match. *= / > +}; > + > +/** > * An union contains the inputs for all types of flow > */ > union rte_eth_fdir_flow { > - struct rte_eth_l2_flow l2_flow; > - struct rte_eth_udpv4_flow udp4_flow; > - struct rte_eth_tcpv4_flow tcp4_flow; > - struct rte_eth_sctpv4_flow sctp4_flow; > - struct rte_eth_ipv4_flow ip4_flow; > - struct rte_eth_udpv6_flow udp6_flow; > - struct rte_eth_tcpv6_flow tcp6_flow; > - struct rte_eth_sctpv6_flow sctp6_flow; > - struct rte_eth_ipv6_flow ipv6_flow; > + struct rte_eth_l2_flow l2_flow; > + struct rte_eth_udpv4_flow udp4_flow; > + struct rte_eth_tcpv4_flow tcp4_flow; > + struct rte_eth_sctpv4_flow sctp4_flow; > + struct rte_eth_ipv4_flow ip4_flow; > + struct rte_eth_udpv6_flow udp6_flow; > + struct rte_eth_tcpv6_flow tcp6_flow; > + struct rte_eth_sctpv6_flow sctp6_flow; > + struct rte_eth_ipv6_flow ipv6_flow; > + struct rte_eth_mac_vlan_flow mac_vlan_flow; > + struct rte_eth_tunnel_flow tunnel_flow; > }; >=20 > /** > @@ -465,6 +493,9 @@ struct rte_eth_fdir_masks { > struct rte_eth_ipv6_flow ipv6_mask; > uint16_t src_port_mask; > uint16_t dst_port_mask; > + uint8_t mac_addr_byte_mask; /** Per byte MAC address mask */ > + uint32_t tunnel_id_mask; /** tunnel ID mask */ > + uint8_t tunnel_type_mask; > }; >=20 > /** > @@ -522,6 +553,8 @@ enum rte_fdir_mode { > RTE_FDIR_MODE_NONE =3D 0, /**< Disable FDIR support. */ > RTE_FDIR_MODE_SIGNATURE, /**< Enable FDIR signature filter > mode. */ > RTE_FDIR_MODE_PERFECT, /**< Enable FDIR perfect filter mode. > */ > + RTE_FDIR_MODE_PERFECT_MAC_VLAN, /**< Enable FDIR filter mode > - MAC VLAN. */ > + RTE_FDIR_MODE_PERFECT_TUNNEL, /**< Enable FDIR filter mode - > tunnel. */ > }; >=20 > #define UINT32_BIT (CHAR_BIT * sizeof(uint32_t)) > -- > 1.9.3