From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by dpdk.org (Postfix) with ESMTP id F30DFDD2 for ; Mon, 30 Apr 2018 16:54:34 +0200 (CEST) Received: by mail-wm0-f66.google.com with SMTP id f8so4168053wmc.4 for ; Mon, 30 Apr 2018 07:54:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=WUoLwsgy2/Z4ZsjGUEgL01xE0JfsEzYsi4qTEujccLQ=; b=FwokPIPFLD9iD2m4mckC3JIP4y74/vB9XdnmLLmXbHCFDQo101K0CRB5xbcbdPl1ci CjnTnyo0UlyE1o4r9ljAfwb5sUxCBW+jJj75wyIZK+o0QpYIPX4HrdBvnOtIZo3my9oO C2xxu3LgWmALEQVr1iQcnFxyy/mg/bx3yPDUxVuEMxIOLC4FPXaE9Ny+VyFm92C6dvyN qLjFhMQe8LLgLQP5sOInIEivutf3WWN+gqg3rWzeciapvQ7caW4x+QsicRsY316nzaMw O+n4VJsLGOufJCojCTDEst5hwepGmc4mcb5vet95TgMEl3HoUawD3+VnS2dAWU0hdpsn tPZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=WUoLwsgy2/Z4ZsjGUEgL01xE0JfsEzYsi4qTEujccLQ=; b=qeY5itZtyE5Oye0LbAeW3KPRKiz1TO5lwGOjmjBA1L4CaC8aP0YnylUVMb8KDmNzDT gjP9YD9Qoy6RwjRV63WjF1JwxHP1zkl1V7a3TDkU1p3tg/XEL3i7ufZIWNB/COmhN4lh bATmKR5h9UmZMkpjmZeRjYrlXCt/x2gSfqnAqNxMCm2Qa39zeBSeNNqxETpDRyy1YPMA 3H2Y8PGW0VFAA45VWgaVh12hq4OWQTkPUR+HGfIiDLrPvigtHQTI7yPYu5QY2pljqQxV ynfHqQYhZ6u0GZOOTxHb/3KE6p3RQKUVbkNa0LPomDRZTOK/fZ8fVIQI/hWDznG51QjX tsCA== X-Gm-Message-State: ALQs6tArynBc2qmtB5H6G1BVBQQ9Y1/Nk1Zf4BIL2keDS/kNI7lfhXEp W6z6OJH4pdiu4PeEqOXOO+w= X-Google-Smtp-Source: AB8JxZr28t6ZkFgGVC7XHESBiUPhZ7SeZUsUaigtPszS+f8WEFEKGVOnyEzRtkEPYVOio3LziYfs2Q== X-Received: by 10.28.202.26 with SMTP id a26mr8210582wmg.126.1525100074293; Mon, 30 Apr 2018 07:54:34 -0700 (PDT) Received: from localhost ([2a00:23c5:be9a:5200:ce4c:82c0:d567:ecbb]) by smtp.gmail.com with ESMTPSA id 20sm10367271wms.35.2018.04.30.07.54.33 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Apr 2018 07:54:33 -0700 (PDT) From: luca.boccassi@gmail.com To: Adrien Mazarguil Cc: Ferruh Yigit , dpdk stable Date: Mon, 30 Apr 2018 15:53:38 +0100 Message-Id: <20180430145402.23057-19-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180430145402.23057-1-luca.boccassi@gmail.com> References: <20180430144223.18657-85-luca.boccassi@gmail.com> <20180430145402.23057-1-luca.boccassi@gmail.com> Subject: [dpdk-stable] patch 'net/bnxt: fix matching of flow API item masks' has been queued to stable release 18.02.2 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Apr 2018 14:54:35 -0000 Hi, FYI, your patch has been queued to stable release 18.02.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/02/18. So please shout if anyone has objections. Thanks. Luca Boccassi --- >>From 774362c7c44c54d155815a241a6cd842028c1cd6 Mon Sep 17 00:00:00 2001 From: Adrien Mazarguil Date: Thu, 19 Apr 2018 12:07:31 +0200 Subject: [PATCH] net/bnxt: fix matching of flow API item masks [ upstream commit e65f082adbf62a17dc1759c8af532811672095c3 ] Some values are interpreted without endian conversion and/or without taking the proper mask into account. Fixes: 5ef3b79fdfe6 ("net/bnxt: support flow filter ops") Signed-off-by: Adrien Mazarguil Acked-by: Ferruh Yigit --- drivers/net/bnxt/bnxt_filter.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/net/bnxt/bnxt_filter.c b/drivers/net/bnxt/bnxt_filter.c index 5ede63436..3b9820813 100644 --- a/drivers/net/bnxt/bnxt_filter.c +++ b/drivers/net/bnxt/bnxt_filter.c @@ -33,6 +33,7 @@ #include +#include #include #include #include @@ -382,7 +383,8 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp, } /* Mask is not allowed. Only exact matches are */ - if ((eth_mask->type & UINT16_MAX) != UINT16_MAX) { + if (eth_mask->type && + eth_mask->type != RTE_BE16(0xffff)) { rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, item, @@ -408,7 +410,7 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp, * RTE_LOG(ERR, PMD, "Handle this condition\n"); * } */ - if (eth_spec->type) { + if (eth_mask->type) { filter->ethertype = rte_be_to_cpu_16(eth_spec->type); en |= use_ntuple ? @@ -422,13 +424,15 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp, (const struct rte_flow_item_vlan *)item->spec; vlan_mask = (const struct rte_flow_item_vlan *)item->mask; - if (vlan_mask->tci & 0xFFFF && !vlan_mask->tpid) { + if (vlan_mask->tci && + vlan_mask->tci == RTE_BE16(0x0fff) && + !vlan_mask->tpid) { /* Only the VLAN ID can be matched. */ filter->l2_ovlan = rte_be_to_cpu_16(vlan_spec->tci & - 0xFFF); + RTE_BE16(0x0fff)); en |= EM_FLOW_ALLOC_INPUT_EN_OVLAN_VID; - } else { + } else if (vlan_mask->tci || vlan_mask->tpid) { rte_flow_error_set(error, EINVAL, RTE_FLOW_ERROR_TYPE_ITEM, item, -- 2.14.2