From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <wenzhuo.lu@intel.com>
Received: from mga02.intel.com (mga02.intel.com [134.134.136.20])
 by dpdk.org (Postfix) with ESMTP id 6D33E374E
 for <dev@dpdk.org>; Fri, 23 Oct 2015 15:07:01 +0200 (CEST)
Received: from orsmga003.jf.intel.com ([10.7.209.27])
 by orsmga101.jf.intel.com with ESMTP; 23 Oct 2015 06:07:00 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.20,186,1444719600"; d="scan'208";a="670283548"
Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205])
 by orsmga003.jf.intel.com with ESMTP; 23 Oct 2015 06:07:00 -0700
Received: from FMSMSX110.amr.corp.intel.com (10.18.116.10) by
 fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS)
 id 14.3.248.2; Fri, 23 Oct 2015 06:07:00 -0700
Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by
 fmsmsx110.amr.corp.intel.com (10.18.116.10) with Microsoft SMTP Server (TLS)
 id 14.3.248.2; Fri, 23 Oct 2015 06:06:59 -0700
Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.253]) by
 SHSMSX104.ccr.corp.intel.com ([169.254.5.194]) with mapi id 14.03.0248.002;
 Fri, 23 Oct 2015 21:06:57 +0800
From: "Lu, Wenzhuo" <wenzhuo.lu@intel.com>
To: "Richardson, Bruce" <bruce.richardson@intel.com>
Thread-Topic: [dpdk-dev] [PATCH v3 1/7] lib/librte_ether: modify the
 structures for fdir new modes
Thread-Index: AQHRDJj6rMkUnExxaECGcrnYz33abJ528w4AgAFTqhCAAAycAIAAuEPw
Date: Fri, 23 Oct 2015 13:06:56 +0000
Message-ID: <6A0DE07E22DDAD4C9103DF62FEBC0909020A2248@shsmsx102.ccr.corp.intel.com>
References: <1443161125-1035-1-git-send-email-wenzhuo.lu@intel.com>
 <1445497902-16703-1-git-send-email-wenzhuo.lu@intel.com>
 <1445497902-16703-2-git-send-email-wenzhuo.lu@intel.com>
 <20151022125718.GB20740@bricha3-MOBL3>
 <6A0DE07E22DDAD4C9103DF62FEBC0909020A1EE3@shsmsx102.ccr.corp.intel.com>
 <20151023095807.GA8464@bricha3-MOBL3>
In-Reply-To: <20151023095807.GA8464@bricha3-MOBL3>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsIiwiaWQiOiIwMzg2YTBmYy0yYzNmLTQxYjMtODc2NS0yNjU4MmZmYzYzYjkiLCJwcm9wcyI6W3sibiI6IkludGVsRGF0YUNsYXNzaWZpY2F0aW9uIiwidmFscyI6W3sidmFsdWUiOiJDVFBfUFVCTElDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjQuMTAuMTkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiaFBVXC8rSCtacnFZTENwN1M3S0NuQm50a21jRldxR3Q1WGZFcjdiYUZkMmM9In0=
x-inteldataclassification: CTP_PUBLIC
x-originating-ip: [10.239.127.40]
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v3 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 <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Fri, 23 Oct 2015 13:07:02 -0000

Hi Bruce,

> -----Original Message-----
> From: Richardson, Bruce
> Sent: Friday, October 23, 2015 5:58 PM
> To: Lu, Wenzhuo
> Cc: dev@dpdk.org; thomas.monjalon@6wind.com
> Subject: Re: [dpdk-dev] [PATCH v3 1/7] lib/librte_ether: modify the struc=
tures
> for fdir new modes
>=20
> On Fri, Oct 23, 2015 at 02:22:28AM +0100, Lu, Wenzhuo wrote:
> > Hi Bruce,
> >
> > > -----Original Message-----
> > > From: Richardson, Bruce
> > > Sent: Thursday, October 22, 2015 8:57 PM
> > > To: Lu, Wenzhuo
> > > Cc: dev@dpdk.org
> > > Subject: Re: [dpdk-dev] [PATCH v3 1/7] lib/librte_ether: modify the
> > > structures for fdir new modes
> > >
> > > On Thu, Oct 22, 2015 at 03:11:36PM +0800, Wenzhuo Lu wrote:
> > > > Define the new modes and modify the filter and mask structures for
> > > > the mac vlan and tunnel modes.
> > > >
> > > > Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
> > >
> > > Hi Wenzhuo,
> > >
> > > couple of stylistic comments below, which would help with patch
> > > review, especially with regards to checking for ABI issues.
> > >
> > > /Bruce
> > >
> > > > ---
> > > >  lib/librte_ether/rte_eth_ctrl.h | 69
> > > > ++++++++++++++++++++++++++++++-----------
> > > >  1 file changed, 51 insertions(+), 18 deletions(-)
> > > >
> > > > diff --git a/lib/librte_ether/rte_eth_ctrl.h
> > > > b/lib/librte_ether/rte_eth_ctrl.h index 26b7b33..078faf9 100644
> > > > --- a/lib/librte_ether/rte_eth_ctrl.h
> > > > +++ b/lib/librte_ether/rte_eth_ctrl.h
> > > > @@ -248,6 +248,17 @@ enum rte_eth_tunnel_type {  };
> > > >
> > > >  /**
> > > > + *  Flow Director setting modes: none, signature or perfect.
> > > > + */
> > > > +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 for
> > > IP. */
> > > > +	RTE_FDIR_MODE_PERFECT_MAC_VLAN, /**< Enable FDIR filter mode
> > > - MAC VLAN. */
> > > > +	RTE_FDIR_MODE_PERFECT_TUNNEL,   /**< Enable FDIR filter mode -
> > > tunnel. */
> > > > +};
> > > > +
> > >
> > > Why is this structure definition moved in the file, it makes seeing
> > > the diff vs the old version difficult.
> > I remember in the original version I move this enum to resolve a compil=
e
> issue.
> > But now after all the code changed, the issue is not here. So, I'll mov=
e it
> back.
> >
> > >
> > > > +/**
> > > >   * filter type of tunneling packet
> > > >   */
> > > >  #define ETH_TUNNEL_FILTER_OMAC  0x01 /**< filter by outer MAC
> > > > addr
> > > */
> > > > @@ -377,18 +388,46 @@ struct rte_eth_sctpv6_flow {  };
> > > >
> > > >  /**
> > > > + * 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 matc=
h. TNI, VNI...
> > > */
> > > > +	struct ether_addr mac_addr;                /**< Mac address to ma=
tch. */
> > > > +};
> > > > +
> > > > +/**
> > > >   * 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;
> > >
> > > Can you please minimize the whitespace changes here. It looks in the
> > > diff like you are replacing the entire set of entries, but on closer
> > > inspection it looks like you are just adding in two extra lines.
> > Using vi or other editing tools, we can see all this fields are
> > aligned. I think it's worth to keep it.
> >
>=20
> I'm a bit uncertain about this. It really makes the diff confusing, so id=
eally
> the whitespace cleanup should go in a separate patch. On the other hand,
> it's a fairly small change, so maybe it's ok here.
>=20
> Right now, I'd prefer it as a separate patch, because I had to manually g=
o
> through each line added/removed to see how they tallied before I
> understood that you were just adding in two new lines, and nothing else.
>=20
> Thomas, perhaps you'd like to comment here?
Maybe you miss the Thomas' mail.=20
I'd like to remove the whitespaces for reviewer's sake. :)=20
>=20
> > >
> > > >  };
> > > >
> > > >  /**
> > > > @@ -465,6 +504,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;
> > > >  };
> > > >
> > > >  /**
> > > > @@ -515,15 +557,6 @@ struct rte_eth_fdir_flex_conf {
> > > >  	/**< Flex mask configuration for each flow type */  };
> > > >
> > > > -/**
> > > > - *  Flow Director setting modes: none, signature or perfect.
> > > > - */
> > > > -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=
.
> > > */
> > > > -};
> > > > -
> > > >  #define UINT32_BIT (CHAR_BIT * sizeof(uint32_t))  #define
> > > > RTE_FLOW_MASK_ARRAY_SIZE \
> > > >  	(RTE_ALIGN(RTE_ETH_FLOW_MAX, UINT32_BIT)/UINT32_BIT)
> > > > --
> > > > 1.9.3
> > > >