From: Thomas Monjalon <thomas.monjalon-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
To: Helin Zhang <helin.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: dev-VfR2kkLFssw@public.gmane.org
Subject: Re: [PATCH 5/7] ethdev: unification of flow types
Date: Mon, 02 Feb 2015 16:38:43 +0100 [thread overview]
Message-ID: <5329819.johOmNX3Da@xps13> (raw)
In-Reply-To: <1421650577-25969-6-git-send-email-helin.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
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-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
[...]
> --- 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?
Nitpicking: numbers from 0 to 9 should be 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_.
[...]
> 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 ;)
--
Thomas
next prev parent reply other threads:[~2015-02-02 15:38 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-19 6:56 [PATCH 0/7] unification of flow types and RSS offload types Helin Zhang
[not found] ` <1421650577-25969-1-git-send-email-helin.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-01-19 6:56 ` [PATCH 1/7] app/test-pmd: code style fix Helin Zhang
2015-01-19 6:56 ` [PATCH 2/7] ethdev: " Helin Zhang
2015-01-19 6:56 ` [PATCH 3/7] i40e: " Helin Zhang
2015-01-19 6:56 ` [PATCH 4/7] ethdev: fix of calculating the size of flow type mask array Helin Zhang
[not found] ` <1421650577-25969-5-git-send-email-helin.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-02-02 15:31 ` Thomas Monjalon
2015-02-03 5:24 ` Zhang, Helin
2015-01-19 6:56 ` [PATCH 5/7] ethdev: unification of flow types Helin Zhang
[not found] ` <98DB008FA2AC6644B40AD8C766FAB271014BDED15D@BOREAL.arubanetworks.com>
[not found] ` <98DB008FA2AC6644B40AD8C766FAB271014BDED15D-AxeMsvIPF9dVlT40swnHCBaHJUVzwnCM@public.gmane.org>
2015-01-27 5:20 ` Zhang, Helin
[not found] ` <1421650577-25969-6-git-send-email-helin.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-02-02 15:38 ` Thomas Monjalon [this message]
2015-02-03 5:40 ` Zhang, Helin
2015-01-19 6:56 ` [PATCH 6/7] ethdev: unification of RSS offload types Helin Zhang
2015-01-19 6:56 ` [PATCH 7/7] app/testpmd: support new rss offloads Helin Zhang
2015-01-22 7:48 ` [PATCH 0/7] unification of flow types and RSS offload types Wu, Jingjing
2015-02-04 7:16 ` [PATCH v2 0/7] unified " Helin Zhang
[not found] ` <1423034193-26966-1-git-send-email-helin.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2015-02-04 7:16 ` [PATCH v2 1/7] app/test-pmd: code style fix Helin Zhang
2015-02-04 7:16 ` [PATCH v2 2/7] ethdev: " Helin Zhang
2015-02-04 7:16 ` [PATCH v2 3/7] i40e: " Helin Zhang
2015-02-04 7:16 ` [PATCH v2 4/7] ethdev: fix of calculating the size of flow type mask array Helin Zhang
2015-02-04 7:16 ` [PATCH v2 5/7] ethdev: unification of flow types Helin Zhang
2015-02-04 7:16 ` [PATCH v2 6/7] ethdev: unification of RSS offload types Helin Zhang
2015-02-04 7:16 ` [PATCH v2 7/7] app/testpmd: support new rss offloads Helin Zhang
2015-02-15 5:03 ` [PATCH v2 0/7] unified flow types and RSS offload types Wu, Jingjing
[not found] ` <9BB6961774997848B5B42BEC655768F8BA84DF-0J0gbvR4kTg/UvCtAeCM4rfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-02-22 22:58 ` Thomas Monjalon
2015-02-24 13:45 ` Zhang, Helin
[not found] ` <F35DEAC7BCE34641BA9FAC6BCA4A12E70A80BDFB-0J0gbvR4kTg/UvCtAeCM4rfspsVTdybXVpNB7YpNyf8@public.gmane.org>
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=5329819.johOmNX3Da@xps13 \
--to=thomas.monjalon-pdr9zngts4eavxtiumwx3w@public.gmane.org \
--cc=dev-VfR2kkLFssw@public.gmane.org \
--cc=helin.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.