net/cxgbe: fix check for redefined match items

Fix issue where ethertype is set to 0x800 for IPv4 by ether match
item and IPv4 match item also inherently sets ethertype to 0x800.

Current logic returns error when IPv4 match item is parsed. So, fix
by only bailing if the redefined match items have different values.

Fixes: ee61f5113b ("net/cxgbe: parse and validate flows")
Cc: stable@dpdk.org

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
This commit is contained in:
Rahul Lakkireddy 2018-11-09 13:26:25 +05:30 committed by Ferruh Yigit
parent 6507fb6f0a
commit 15fb77f62c

View File

@ -7,14 +7,12 @@
#define __CXGBE_FILL_FS(__v, __m, fs, elem, e) \
do { \
if (!((fs)->val.elem || (fs)->mask.elem)) { \
(fs)->val.elem = (__v); \
(fs)->mask.elem = (__m); \
} else { \
if ((fs)->mask.elem && ((fs)->val.elem != (__v))) \
return rte_flow_error_set(e, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, \
NULL, "a filter can be specified" \
" only once"); \
} \
NULL, "Redefined match item with" \
" different values found"); \
(fs)->val.elem = (__v); \
(fs)->mask.elem = (__m); \
} while (0)
#define __CXGBE_FILL_FS_MEMCPY(__v, __m, fs, elem) \