/**
* Allow PMD private flow item
*/
- size_t sz = type >= 0 ? desc[type].size : sizeof(void *);
+ bool rte_type = type >= 0;
+
+ size_t sz = rte_type ? desc[type].size : sizeof(void *);
if (buf == NULL || data == NULL)
return 0;
rte_memcpy(buf, data, (size > sz ? sz : size));
- if (desc[type].desc_fn)
+ if (rte_type && desc[type].desc_fn)
sz += desc[type].desc_fn(size > 0 ? buf : NULL, data);
return sz;
}
MK_FLOW_ITEM(META, sizeof(struct rte_flow_item_meta)),
MK_FLOW_ITEM(TAG, sizeof(struct rte_flow_item_tag)),
MK_FLOW_ITEM(GRE_KEY, sizeof(rte_be32_t)),
+ MK_FLOW_ITEM(GRE_OPTION, sizeof(struct rte_flow_item_gre_opt)),
MK_FLOW_ITEM(GTP_PSC, sizeof(struct rte_flow_item_gtp_psc)),
MK_FLOW_ITEM(PPPOES, sizeof(struct rte_flow_item_pppoe)),
MK_FLOW_ITEM(PPPOED, sizeof(struct rte_flow_item_pppoe)),
MK_FLOW_ITEM(REPRESENTED_PORT, sizeof(struct rte_flow_item_ethdev)),
MK_FLOW_ITEM_FN(FLEX, sizeof(struct rte_flow_item_flex),
rte_flow_item_flex_conv),
+ MK_FLOW_ITEM(L2TPV2, sizeof(struct rte_flow_item_l2tpv2)),
+ MK_FLOW_ITEM(PPP, sizeof(struct rte_flow_item_ppp)),
};
/** Generate flow_action[] entry. */
if (flag < 0)
goto error;
rte_flow_dynf_metadata_offs = offset;
- rte_flow_dynf_metadata_mask = (1ULL << flag);
+ rte_flow_dynf_metadata_mask = RTE_BIT64(flag);
return 0;
error:
rte_flow_dynf_metadata_offs = -1;
- rte_flow_dynf_metadata_mask = 0ULL;
+ rte_flow_dynf_metadata_mask = UINT64_C(0);
return -rte_errno;
}