Add integrity item definition to the rte_flow_desc_item array. The new entry allows RTE conv API to work with the new flow item.
Add bitmasks to the integrity item value. The masks allow to query multiple integrity filters in a single compare operation. Fixes: b10a421a1f3b ("ethdev: add packet integrity check flow rules") Signed-off-by: Gregory Etelson <getel...@nvidia.com> Acked-by: Viacheslav Ovsiienko <viachesl...@nvidia.com> --- lib/ethdev/rte_flow.c | 1 + lib/ethdev/rte_flow.h | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c index c7c7108933..8cb7a069c8 100644 --- a/lib/ethdev/rte_flow.c +++ b/lib/ethdev/rte_flow.c @@ -98,6 +98,7 @@ static const struct rte_flow_desc_data rte_flow_desc_item[] = { MK_FLOW_ITEM(PFCP, sizeof(struct rte_flow_item_pfcp)), MK_FLOW_ITEM(ECPRI, sizeof(struct rte_flow_item_ecpri)), MK_FLOW_ITEM(GENEVE_OPT, sizeof(struct rte_flow_item_geneve_opt)), + MK_FLOW_ITEM(INTEGRITY, sizeof(struct rte_flow_item_integrity)), MK_FLOW_ITEM(CONNTRACK, sizeof(uint32_t)), }; diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h index 94c8c1ccc8..cf72999cd9 100644 --- a/lib/ethdev/rte_flow.h +++ b/lib/ethdev/rte_flow.h @@ -1738,6 +1738,15 @@ struct rte_flow_item_integrity { }; }; +#define RTE_FLOW_ITEM_INTEGRITY_PKT_OK (1ULL << 0) +#define RTE_FLOW_ITEM_INTEGRITY_L2_OK (1ULL << 1) +#define RTE_FLOW_ITEM_INTEGRITY_L3_OK (1ULL << 2) +#define RTE_FLOW_ITEM_INTEGRITY_L4_OK (1ULL << 3) +#define RTE_FLOW_ITEM_INTEGRITY_L2_CRC_OK (1ULL << 4) +#define RTE_FLOW_ITEM_INTEGRITY_IPV4_CSUM_OK (1ULL << 5) +#define RTE_FLOW_ITEM_INTEGRITY_L4_CSUM_OK (1ULL << 6) +#define RTE_FLOW_ITEM_INTEGRITY_L3_LEN_OK (1ULL << 7) + #ifndef __cplusplus static const struct rte_flow_item_integrity rte_flow_item_integrity_mask = { -- 2.31.1