DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Zhang, Helin" <helin.zhang@intel.com>
To: Thomas Monjalon <thomas.monjalon@6wind.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH 5/7] ethdev: unification of flow types
Date: Tue, 3 Feb 2015 05:40:04 +0000	[thread overview]
Message-ID: <F35DEAC7BCE34641BA9FAC6BCA4A12E70A803E47@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <5329819.johOmNX3Da@xps13>



> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> Sent: Monday, February 2, 2015 11:39 PM
> To: Zhang, Helin
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH 5/7] ethdev: unification of flow types
> 
> Hi Helin,
> 
> 2015-01-19 14:56, Helin Zhang:
> > Flow types was defined actually for i40e hardware specifically, and
> > wasn't able to be used for defining RSS offload types of all PMDs. It
> > removed the enum flow types, and uses macros instead with new names.
> > The new macros can be used for defining RSS offload types later. Also
> > modifications are made in i40e and testpmd accordingly.
> >
> > Signed-off-by: Helin Zhang <helin.zhang@intel.com>
> [...]
> > --- a/lib/librte_ether/rte_eth_ctrl.h
> > +++ b/lib/librte_ether/rte_eth_ctrl.h
> > @@ -46,6 +46,35 @@
> >  extern "C" {
> >  #endif
> >
> > +/*
> > + * A packet can be identified by hardware as different flow types.
> > +Different
> > + * NIC hardwares may support different flow types.
> > + * Basically, the NIC hardware identifies the flow type as deep
> > +protocol as
> > + * possible, and exclusively. For example, if a packet is identified
> > +as
> > + * 'ETH_FLOW_TYPE_NONFRAG_IPV4_TCP', it will not be any of other flow
> > +types,
> > + * though it is an actual IPV4 packet.
> > + * Note that the flow types are used to define RSS offload types in
> > + * rte_ethdev.h.
> > + */
> > +#define ETH_FLOW_TYPE_UNKNOWN            0
> > +#define ETH_FLOW_TYPE_IPV4               1
> > +#define ETH_FLOW_TYPE_FRAG_IPV4          2
> > +#define ETH_FLOW_TYPE_NONFRAG_IPV4_TCP   3
> > +#define ETH_FLOW_TYPE_NONFRAG_IPV4_UDP   4
> > +#define ETH_FLOW_TYPE_NONFRAG_IPV4_SCTP  5 #define
> > +ETH_FLOW_TYPE_NONFRAG_IPV4_OTHER 6
> > +#define ETH_FLOW_TYPE_IPV6               7
> > +#define ETH_FLOW_TYPE_FRAG_IPV6          8
> > +#define ETH_FLOW_TYPE_NONFRAG_IPV6_TCP   9
> > +#define ETH_FLOW_TYPE_NONFRAG_IPV6_UDP   10
> > +#define ETH_FLOW_TYPE_NONFRAG_IPV6_SCTP  11 #define
> > +ETH_FLOW_TYPE_NONFRAG_IPV6_OTHER 12
> > +#define ETH_FLOW_TYPE_L2_PAYLOAD         13
> > +#define ETH_FLOW_TYPE_IPV6_EX            14
> > +#define ETH_FLOW_TYPE_IPV6_TCP_EX        15
> > +#define ETH_FLOW_TYPE_IPV6_UDP_EX        16
> > +#define ETH_FLOW_TYPE_MAX                17
> 
> Why not using an enum?
Enum is 'int' which needs 32 bits, while flow_type is just 16 bits.
The old one which is not enum was in rte_ethdev.h, the enum one was added
recently in rte_eth_ctrl.h.

> Nitpicking: numbers from 0 to 9 should be right aligned.
In my source file, they are right aligned.

> 
> >  /**
> >   * Feature filter types
> >   */
> > @@ -179,24 +208,6 @@ struct rte_eth_tunnel_filter_conf {
> >  #define RTE_ETH_FDIR_MAX_FLEXLEN         16 /** < Max length of
> flexbytes. */
> >
> >  /**
> > - * Flow type
> > - */
> > -enum rte_eth_flow_type {
> > -	RTE_ETH_FLOW_TYPE_NONE = 0,
> > -	RTE_ETH_FLOW_TYPE_UDPV4,
> > -	RTE_ETH_FLOW_TYPE_TCPV4,
> > -	RTE_ETH_FLOW_TYPE_SCTPV4,
> > -	RTE_ETH_FLOW_TYPE_IPV4_OTHER,
> > -	RTE_ETH_FLOW_TYPE_FRAG_IPV4,
> > -	RTE_ETH_FLOW_TYPE_UDPV6,
> > -	RTE_ETH_FLOW_TYPE_TCPV6,
> > -	RTE_ETH_FLOW_TYPE_SCTPV6,
> > -	RTE_ETH_FLOW_TYPE_IPV6_OTHER,
> > -	RTE_ETH_FLOW_TYPE_FRAG_IPV6,
> > -	RTE_ETH_FLOW_TYPE_MAX = 64,
> > -};
> 
> You are renaming the prefix RTE_ETH_FLOW_TYPE_ to ETH_FLOW_TYPE.
> As this is an exported enum (in the API), we should keep RTE_ prefix.
> If you are trying to shorten the names, I suggest RTE_ETH_FLOW_.
OK. Started with RTE_ETH_FLOW_ is good for me. I will modified it in v2.

> 
> [...]
> >  struct rte_eth_fdir_input {
> > -	enum rte_eth_flow_type flow_type;      /**< Type of flow */
> > +	uint16_t flow_type;      /**< Type of flow */
> [...]
> >  struct rte_eth_fdir_flex_mask {
> > -	enum rte_eth_flow_type flow_type;  /**< Flow type */
> > +	uint16_t flow_type;  /**< Flow type */
> 
> I think this comment is useless ;)
OK. I will remove it. Thanks!

Regards,
Helin

> 
> --
> Thomas

  parent reply	other threads:[~2015-02-03  5:40 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-19  6:56 [dpdk-dev] [PATCH 0/7] unification of flow types and RSS offload types Helin Zhang
2015-01-19  6:56 ` [dpdk-dev] [PATCH 1/7] app/test-pmd: code style fix Helin Zhang
2015-01-19  6:56 ` [dpdk-dev] [PATCH 2/7] ethdev: " Helin Zhang
2015-01-19  6:56 ` [dpdk-dev] [PATCH 3/7] i40e: " Helin Zhang
2015-01-19  6:56 ` [dpdk-dev] [PATCH 4/7] ethdev: fix of calculating the size of flow type mask array Helin Zhang
     [not found]   ` <2108624.Ik2ARBIxyb@xps13>
2015-02-03  5:24     ` Zhang, Helin
2015-01-19  6:56 ` [dpdk-dev] [PATCH 5/7] ethdev: unification of flow types Helin Zhang
     [not found]   ` <98DB008FA2AC6644B40AD8C766FAB271014BDED15D@BOREAL.arubanetworks.com>
2015-01-27  5:20     ` Zhang, Helin
     [not found]   ` <5329819.johOmNX3Da@xps13>
2015-02-03  5:40     ` Zhang, Helin [this message]
2015-01-19  6:56 ` [dpdk-dev] [PATCH 6/7] ethdev: unification of RSS offload types Helin Zhang
2015-01-19  6:56 ` [dpdk-dev] [PATCH 7/7] app/testpmd: support new rss offloads Helin Zhang
2015-01-22  7:48 ` [dpdk-dev] [PATCH 0/7] unification of flow types and RSS offload types Wu, Jingjing
2015-02-04  7:16 ` [dpdk-dev] [PATCH v2 0/7] unified " Helin Zhang
2015-02-04  7:16   ` [dpdk-dev] [PATCH v2 1/7] app/test-pmd: code style fix Helin Zhang
2015-02-04  7:16   ` [dpdk-dev] [PATCH v2 2/7] ethdev: " Helin Zhang
2015-02-04  7:16   ` [dpdk-dev] [PATCH v2 3/7] i40e: " Helin Zhang
2015-02-04  7:16   ` [dpdk-dev] [PATCH v2 4/7] ethdev: fix of calculating the size of flow type mask array Helin Zhang
2015-02-04  7:16   ` [dpdk-dev] [PATCH v2 5/7] ethdev: unification of flow types Helin Zhang
2015-02-04  7:16   ` [dpdk-dev] [PATCH v2 6/7] ethdev: unification of RSS offload types Helin Zhang
2015-02-04  7:16   ` [dpdk-dev] [PATCH v2 7/7] app/testpmd: support new rss offloads Helin Zhang
2015-02-15  5:03   ` [dpdk-dev] [PATCH v2 0/7] unified flow types and RSS offload types Wu, Jingjing
2015-02-22 22:58     ` Thomas Monjalon
2015-02-24 13:45       ` Zhang, Helin
2015-02-24 15:01         ` Wu, Jingjing

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=F35DEAC7BCE34641BA9FAC6BCA4A12E70A803E47@SHSMSX104.ccr.corp.intel.com \
    --to=helin.zhang@intel.com \
    --cc=dev@dpdk.org \
    --cc=thomas.monjalon@6wind.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).