From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id BDD287F2C for ; Wed, 29 Oct 2014 04:13:29 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 28 Oct 2014 20:22:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,807,1406617200"; d="scan'208";a="627368913" Received: from pgsmsx103.gar.corp.intel.com ([10.221.44.82]) by orsmga002.jf.intel.com with ESMTP; 28 Oct 2014 20:22:17 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.110.14) by PGSMSX103.gar.corp.intel.com (10.221.44.82) with Microsoft SMTP Server (TLS) id 14.3.195.1; Wed, 29 Oct 2014 11:21:06 +0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.174]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.207]) with mapi id 14.03.0195.001; Wed, 29 Oct 2014 11:21:05 +0800 From: "Wu, Jingjing" To: Thomas Monjalon Thread-Topic: [dpdk-dev] [PATCH v4 16/21] ethdev: define structures for configuring flexible payload Thread-Index: AQHP7ZPfIwvsRrfuXUeuy4Ctl5hDX5xFEbmAgAFXaXA= Date: Wed, 29 Oct 2014 03:21:05 +0000 Message-ID: <9BB6961774997848B5B42BEC655768F8B24FC7@SHSMSX104.ccr.corp.intel.com> References: <1411711418-12881-1-git-send-email-jingjing.wu@intel.com> <1413939687-11177-1-git-send-email-jingjing.wu@intel.com> <1413939687-11177-17-git-send-email-jingjing.wu@intel.com> <5358622.rv8SXXlaQB@xps13> In-Reply-To: <5358622.rv8SXXlaQB@xps13> 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: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH v4 16/21] ethdev: 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: , X-List-Received-Date: Wed, 29 Oct 2014 03:13:30 -0000 > -----Original Message----- > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] > Sent: Tuesday, October 28, 2014 10:15 PM > To: Wu, Jingjing > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v4 16/21] ethdev: define structures for > configuring flexible payload >=20 > 2014-10-22 09:01, Jingjing Wu: > > +/** > > + * 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 */ > > +}; >=20 > I'm sorry but I don't understand this patch at all. > I think the reason is that I need more information about flex filter. >=20 Yes, it is a little difficult to understand the behavior. Let me explain it= as I can. <1> flex words: We can select where the 8 flex words are. It can be constituted of 1-3 part= itions. Each partition is defined as rte_eth_field_vector.=20 For example: if we set=20 rte_eth_flex_payload_cfg =3D { .type =3D RTE_ETH_L4_PAYLOAD; .nb_field =3D 1; .field =3D { {0, 8}, /*offset =3D 0, size =3D8*/ }; }; This means the 8 words from the beginning of l4 payload will be consider as= flex words. If we set=20 rte_eth_flex_payload_cfg =3D { .type =3D RTE_ETH_L4_PAYLOAD; .nb_field =3D 1; .field =3D { {0, 2}, /*offset =3D 0, size =3D2*/ {4, 6}, /*offset =3D 4, size =3D6*/ }; }; This means the 2 words from the beginning of l4 payload plus 6 words form t= he offset 4 will be consider as flex words. <2> flex mask: As the <1> configuration, we already select 8 words as flex words. Then the= flex mask Will help us to define whether these word will participate in comparing.=20 The flex mask can be constituted of 2 partitions. One is word mask, another= is bit mask. Word mask is defined in rte_eth_fdir_flex_masks.words_mask, it means bit i = enables word i of flex words. rte_eth_fdir_flex_masks.field specify each word's bit mask, Fortville suppo= rt 2 word bitmask. > > + > > +/** > > + * payload type > > + */ > > +enum rte_eth_payload_type { > > + RTE_ETH_PAYLOAD_UNKNOWN =3D 0, > > + RTE_ETH_L2_PAYLOAD, > > + RTE_ETH_L3_PAYLOAD, > > + RTE_ETH_L4_PAYLOAD, > > +}; > > + > > /** > > * flow type > > */ > > @@ -92,6 +111,30 @@ 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 following fields = */ > > + 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_SET operation. > > + */ > > +struct rte_eth_fdir_cfg { > > + uint16_t cmd; /**< sub command */ > > + /** > > + * A pointer to structure for the configuration e.g. > > + * struct rte_eth_flex_payload_cfg for FDIR_CFG_FLX > > + */ > > + void *cfg; > > +};