[dpdk-dev] [PATCH v5 4/8]librte_ether:add a common filter API
Thomas Monjalon
thomas.monjalon at 6wind.com
Thu Oct 16 22:09:52 CEST 2014
I don't review the common API as it should be done in an unique place
and there are many copies in different patchsets. Let's focus on tunnels.
2014-10-11 13:55, Jijiang Liu:
> +/**** TUNNEL FILTER DATA DEFINATION *** */
We cannot miss this comment :)
> +#define ETH_TUNNEL_FILTER_OMAC 0x01
> +#define ETH_TUNNEL_FILTER_OIP 0x02
> +#define ETH_TUNNEL_FILTER_TENID 0x04
> +#define ETH_TUNNEL_FILTER_IMAC 0x08
> +#define ETH_TUNNEL_FILTER_IVLAN 0x10
> +#define ETH_TUNNEL_FILTER_IIP 0x20
> +
> +#define RTE_TUNNEL_FLAGS_TO_QUEUE 1
These values requires some comments.
> +/*
> + * Tunneled filter type
> + */
> +enum rte_tunnel_filter_type {
> + RTE_TUNNEL_FILTER_TYPE_NONE = 0,
> + RTE_TUNNEL_FILTER_OIP = ETH_TUNNEL_FILTER_OIP,
> + RTE_TUNNEL_FILTER_IMAC_IVLAN =
> + ETH_TUNNEL_FILTER_IMAC | ETH_TUNNEL_FILTER_IVLAN,
> + RTE_TUNNEL_FILTER_IMAC_IVLAN_TENID =
> + ETH_TUNNEL_FILTER_IMAC | ETH_TUNNEL_FILTER_IVLAN |
> + ETH_TUNNEL_FILTER_TENID,
> + RTE_TUNNEL_FILTER_IMAC_TENID =
> + ETH_TUNNEL_FILTER_IMAC | ETH_TUNNEL_FILTER_TENID,
> + RTE_TUNNEL_FILTER_IMAC = ETH_TUNNEL_FILTER_IMAC,
> + RTE_TUNNEL_FILTER_OMAC_TENID_IMAC =
> + ETH_TUNNEL_FILTER_OMAC | ETH_TUNNEL_FILTER_TENID |
> + ETH_TUNNEL_FILTER_IMAC,
> + RTE_TUNNEL_FILTER_IIP = ETH_TUNNEL_FILTER_IIP,
> + RTE_TUNNEL_FILTER_TYPE_MAX,
> +};
It's absolutely impossible to understand. Keep in mind the first goal of an
API: be used (which imply to be understood by users).
And I really don't understand why you define values for combination of
previous flags. Please, keep it simple.
--
Thomas
More information about the dev
mailing list