X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Fethdev%2Frte_flow.c;h=a93f68abbc1634fa90654917cc92bd47cfddce1c;hb=6e858b4d9244cf53505589673755ab18ac2a4a83;hp=bcf0513b3c3ddc0299aa0660cf865c0f4a184dd3;hpb=e1823e084255869680322e515b9dcb1c18bcb798;p=dpdk.git diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c index bcf0513b3c..a93f68abbc 100644 --- a/lib/ethdev/rte_flow.c +++ b/lib/ethdev/rte_flow.c @@ -54,11 +54,13 @@ rte_flow_conv_copy(void *buf, const void *data, const size_t size, /** * 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; } @@ -156,6 +158,8 @@ static const struct rte_flow_desc_data rte_flow_desc_item[] = { 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. */