From: Rahul Lakkireddy Date: Fri, 9 Nov 2018 07:56:25 +0000 (+0530) Subject: net/cxgbe: fix check for redefined match items X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=15fb77f62cc819b998b191d885d3b15091a40bad;p=dpdk.git 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: ee61f5113b17 ("net/cxgbe: parse and validate flows") Cc: stable@dpdk.org Signed-off-by: Rahul Lakkireddy --- diff --git a/drivers/net/cxgbe/cxgbe_flow.c b/drivers/net/cxgbe/cxgbe_flow.c index 54ec7e5952..a8f076e6c5 100644 --- a/drivers/net/cxgbe/cxgbe_flow.c +++ b/drivers/net/cxgbe/cxgbe_flow.c @@ -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) \