[PATCH v5 04/25] net/nfp: add the flow APIs of nfp PMD
Ferruh Yigit
ferruh.yigit at amd.com
Thu Oct 20 13:09:35 CEST 2022
On 10/20/2022 3:19 AM, Chaoyong He wrote:
> Add the flow validate/create/query/destroy/flush API of nfp PMD.
>
> The flow create API construct a control cmsg and send it to
> firmware, then add this flow to the hash table.
>
> The flow query API get flow stats from the flow_priv structure.
> Note there exist an rte_spin_lock to prevent the update and query
> action occur at the same time.
>
> The flow destroy API construct a control cmsg and send it to
> firmware, then adelete this flow from the hash table.
>
> The flow flush API just iterate the flows in hash table and
> call the flow destroy API.
>
> Signed-off-by: Chaoyong He <chaoyong.he at corigine.com>
> Reviewed-by: Niklas Söderlund <niklas.soderlund at corigine.com>
<...>
> diff --git a/drivers/net/nfp/nfp_flow.h b/drivers/net/nfp/nfp_flow.h
> index e8fd22a..6fa1b3e 100644
> --- a/drivers/net/nfp/nfp_flow.h
> +++ b/drivers/net/nfp/nfp_flow.h
> @@ -6,10 +6,36 @@
> #ifndef _NFP_FLOW_H_
> #define _NFP_FLOW_H_
>
> +#include <ethdev_driver.h>
> +
> +#define NFP_FLOWER_LAYER_EXT_META (1 << 0)
> +#define NFP_FLOWER_LAYER_PORT (1 << 1)
> +#define NFP_FLOWER_LAYER_MAC (1 << 2)
> +#define NFP_FLOWER_LAYER_TP (1 << 3)
> +#define NFP_FLOWER_LAYER_IPV4 (1 << 4)
> +#define NFP_FLOWER_LAYER_IPV6 (1 << 5)
> +#define NFP_FLOWER_LAYER_CT (1 << 6)
> +#define NFP_FLOWER_LAYER_VXLAN (1 << 7)
> +
> +#define NFP_FLOWER_LAYER2_GRE (1 << 0)
> +#define NFP_FLOWER_LAYER2_QINQ (1 << 4)
> +#define NFP_FLOWER_LAYER2_GENEVE (1 << 5)
> +#define NFP_FLOWER_LAYER2_GENEVE_OP (1 << 6)
> +#define NFP_FLOWER_LAYER2_TUN_IPV6 (1 << 7)
> +
RTE_BIT32() may be used, up to you.
More information about the dev
mailing list