[dpdk-dev] [PATCH v5 12/18] net/ixgbe: parse ethertype filter
Ferruh Yigit
ferruh.yigit at intel.com
Thu Jan 12 16:39:56 CET 2017
On 1/12/2017 9:17 AM, Wei Zhao wrote:
> check if the rule is a ethertype rule, and get the ethertype info.
>
> Signed-off-by: Wei Zhao <wei.zhao1 at intel.com>
> Signed-off-by: Wenzhuo Lu <wenzhuo.lu at intel.com>
> ---
> drivers/net/ixgbe/ixgbe_flow.c | 278 +++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 278 insertions(+)
>
> diff --git a/drivers/net/ixgbe/ixgbe_flow.c b/drivers/net/ixgbe/ixgbe_flow.c
> index ac9f663..2f97129 100644
> --- a/drivers/net/ixgbe/ixgbe_flow.c
> +++ b/drivers/net/ixgbe/ixgbe_flow.c
> @@ -90,6 +90,18 @@ ixgbe_parse_ntuple_filter(const struct rte_flow_attr *attr,
> struct rte_eth_ntuple_filter *filter,
> struct rte_flow_error *error);
> static int
> +cons_parse_ethertype_filter(const struct rte_flow_attr *attr,
Although this is static function, you may prefer to keep ixgbe_
namespace in the function.
> + const struct rte_flow_item *pattern,
> + const struct rte_flow_action *actions,
> + struct rte_eth_ethertype_filter *filter,
> + struct rte_flow_error *error);
> +static int
> +ixgbe_parse_ethertype_filter(const struct rte_flow_attr *attr,
> + const struct rte_flow_item pattern[],
> + const struct rte_flow_action actions[],
> + struct rte_eth_ethertype_filter *filter,
> + struct rte_flow_error *error);
> +static int
> ixgbe_flow_validate(__rte_unused struct rte_eth_dev *dev,
> const struct rte_flow_attr *attr,
> const struct rte_flow_item pattern[],
> @@ -480,6 +492,265 @@ ixgbe_parse_ntuple_filter(const struct rte_flow_attr *attr,
> }
>
> /**
> + * Parse the rule to see if it is a ethertype rule.
> + * And get the ethertype filter info BTW.
> + * pattern:
> + * The first not void item can be ETH.
> + * The next not void item must be END.
This documents item.type, can you please also document expected/valid
item->spec, item->last and item->mask values.
Same for all parse functions.
I am aware this is lots of comment when you think all parse functions,
but I believe this can be very useful in the future.
And it is very unlikely that it will be done later, if it has not been
done now.
Thanks,
ferruh
> + * action:
> + * The first not void action should be QUEUE.
> + * The next not void action should be END.
> + */
> +static int
> +cons_parse_ethertype_filter(const struct rte_flow_attr *attr,
> + const struct rte_flow_item *pattern,
> + const struct rte_flow_action *actions,
> + struct rte_eth_ethertype_filter *filter,
> + struct rte_flow_error *error)
<...>
More information about the dev
mailing list