From: Adrien Mazarguil <adrien.mazarguil@6wind.com>
To: dev@dpdk.org
Cc: stable@dpdk.org, Ajit Khaparde <ajit.khaparde@broadcom.com>
Subject: [dpdk-stable] [PATCH v2 04/13] net/bnxt: fix matching of flow API item masks
Date: Wed, 4 Apr 2018 16:57:52 +0200 [thread overview]
Message-ID: <20180404144805.11966-5-adrien.mazarguil@6wind.com> (raw)
In-Reply-To: <20180404144805.11966-1-adrien.mazarguil@6wind.com>
Some values are interpreted without endian conversion and/or without
taking the proper mask into account.
Fixes: 5ef3b79fdfe6 ("net/bnxt: support flow filter ops")
Cc: stable@dpdk.org
Cc: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
---
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 bbaae1a07..0d735edf6 100644
--- a/drivers/net/bnxt/bnxt_filter.c
+++ b/drivers/net/bnxt/bnxt_filter.c
@@ -33,6 +33,7 @@
#include <sys/queue.h>
+#include <rte_byteorder.h>
#include <rte_log.h>
#include <rte_malloc.h>
#include <rte_flow.h>
@@ -374,7 +375,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,
@@ -400,7 +402,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 ?
@@ -412,13 +414,15 @@ bnxt_validate_and_parse_flow_type(struct bnxt *bp,
case RTE_FLOW_ITEM_TYPE_VLAN:
vlan_spec = item->spec;
vlan_mask = 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.11.0
next prev parent reply other threads:[~2018-04-04 14:58 UTC|newest]
Thread overview: 80+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20180323124725.15806-1-adrien.mazarguil@6wind.com>
2018-03-23 12:58 ` [dpdk-stable] [PATCH v1 1/9] net/mlx4: fix RSS resource leak in case of error Adrien Mazarguil
2018-03-23 12:58 ` [dpdk-stable] [PATCH v1 2/9] net/mlx4: fix ignored RSS hash types Adrien Mazarguil
2018-03-23 12:58 ` [dpdk-stable] [PATCH v1 3/9] app/testpmd: fix flow completion for RSS queues Adrien Mazarguil
2018-03-23 12:58 ` [dpdk-stable] [PATCH v1 4/9] app/testpmd: fix lack of flow action configuration Adrien Mazarguil
2018-03-23 12:58 ` [dpdk-stable] [PATCH v1 5/9] app/testpmd: fix RSS " Adrien Mazarguil
2018-03-23 12:58 ` [dpdk-stable] [PATCH v1 6/9] app/testpmd: fix missing RSS fields in flow action Adrien Mazarguil
2018-03-23 12:58 ` [dpdk-stable] [PATCH v1 7/9] ethdev: fix shallow copy of flow API RSS action Adrien Mazarguil
2018-03-23 12:58 ` [dpdk-stable] [PATCH v1 8/9] ethdev: fix missing boolean values in flow command Adrien Mazarguil
[not found] ` <20180404144805.11966-1-adrien.mazarguil@6wind.com>
2018-04-04 14:57 ` [dpdk-stable] [PATCH v2 01/13] net/mlx4: fix RSS resource leak in case of error Adrien Mazarguil
2018-04-04 14:57 ` [dpdk-stable] [PATCH v2 02/13] net/mlx4: fix ignored RSS hash types Adrien Mazarguil
2018-04-04 14:57 ` [dpdk-stable] [PATCH v2 03/13] net/mlx5: fix RSS flow action bounds check Adrien Mazarguil
2018-04-05 6:57 ` Nélio Laranjeiro
2018-04-04 14:57 ` Adrien Mazarguil [this message]
2018-04-04 14:57 ` [dpdk-stable] [PATCH v2 05/13] net/sfc: fix endian conversions in flow API Adrien Mazarguil
2018-04-04 15:30 ` Andrew Rybchenko
2018-04-04 16:08 ` Adrien Mazarguil
2018-04-04 14:57 ` [dpdk-stable] [PATCH v2 06/13] app/testpmd: fix flow completion for RSS queues Adrien Mazarguil
2018-04-04 14:57 ` [dpdk-stable] [PATCH v2 07/13] app/testpmd: fix lack of flow action configuration Adrien Mazarguil
2018-04-05 6:59 ` Nélio Laranjeiro
2018-04-04 14:57 ` [dpdk-stable] [PATCH v2 08/13] app/testpmd: fix RSS " Adrien Mazarguil
2018-04-05 7:39 ` Nélio Laranjeiro
2018-04-04 14:58 ` [dpdk-stable] [PATCH v2 09/13] app/testpmd: fix missing RSS fields in flow action Adrien Mazarguil
2018-04-05 8:15 ` Nélio Laranjeiro
2018-04-04 14:58 ` [dpdk-stable] [PATCH v2 10/13] ethdev: fix shallow copy of flow API RSS action Adrien Mazarguil
2018-04-04 14:58 ` [dpdk-stable] [PATCH v2 11/13] ethdev: fix missing boolean values in flow command Adrien Mazarguil
2018-04-05 8:17 ` Nélio Laranjeiro
2018-04-04 14:58 ` [dpdk-stable] [PATCH v2 13/13] ethdev: fix missing include in flow API Adrien Mazarguil
2018-04-05 8:18 ` Nélio Laranjeiro
[not found] ` <20180406131243.19037-1-adrien.mazarguil@6wind.com>
2018-04-06 13:22 ` [dpdk-stable] [PATCH v3 01/11] net/mlx4: fix RSS resource leak in case of error Adrien Mazarguil
2018-04-06 13:22 ` [dpdk-stable] [PATCH v3 02/11] net/mlx4: fix ignored RSS hash types Adrien Mazarguil
2018-04-06 13:22 ` [dpdk-stable] [PATCH v3 03/11] net/mlx5: fix RSS flow action bounds check Adrien Mazarguil
2018-04-06 13:22 ` [dpdk-stable] [PATCH v3 04/11] net/bnxt: fix matching of flow API item masks Adrien Mazarguil
2018-04-06 13:22 ` [dpdk-stable] [PATCH v3 05/11] app/testpmd: fix flow completion for RSS queues Adrien Mazarguil
2018-04-06 13:22 ` [dpdk-stable] [PATCH v3 06/11] app/testpmd: fix lack of flow action configuration Adrien Mazarguil
2018-04-06 13:22 ` [dpdk-stable] [PATCH v3 07/11] app/testpmd: fix RSS " Adrien Mazarguil
2018-04-06 13:22 ` [dpdk-stable] [PATCH v3 08/11] app/testpmd: fix missing RSS fields in flow action Adrien Mazarguil
2018-04-06 13:22 ` [dpdk-stable] [PATCH v3 09/11] ethdev: fix shallow copy of flow API RSS action Adrien Mazarguil
2018-04-06 13:22 ` [dpdk-stable] [PATCH v3 10/11] ethdev: fix missing boolean values in flow command Adrien Mazarguil
2018-04-06 13:22 ` [dpdk-stable] [PATCH v3 11/11] ethdev: fix missing include in flow API Adrien Mazarguil
[not found] ` <20180410161132.8776-1-adrien.mazarguil@6wind.com>
2018-04-10 16:34 ` [dpdk-stable] [PATCH v4 01/11] net/mlx4: fix RSS resource leak in case of error Adrien Mazarguil
2018-04-10 16:34 ` [dpdk-stable] [PATCH v4 02/11] net/mlx4: fix ignored RSS hash types Adrien Mazarguil
2018-04-10 16:34 ` [dpdk-stable] [PATCH v4 03/11] net/mlx5: fix RSS flow action bounds check Adrien Mazarguil
2018-04-10 16:34 ` [dpdk-stable] [PATCH v4 04/11] net/bnxt: fix matching of flow API item masks Adrien Mazarguil
2018-04-10 16:34 ` [dpdk-stable] [PATCH v4 05/11] app/testpmd: fix flow completion for RSS queues Adrien Mazarguil
2018-04-10 16:34 ` [dpdk-stable] [PATCH v4 06/11] app/testpmd: fix lack of flow action configuration Adrien Mazarguil
2018-04-10 16:34 ` [dpdk-stable] [PATCH v4 07/11] app/testpmd: fix RSS " Adrien Mazarguil
2018-04-10 16:34 ` [dpdk-stable] [PATCH v4 08/11] app/testpmd: fix missing RSS fields in flow action Adrien Mazarguil
2018-04-10 16:34 ` [dpdk-stable] [PATCH v4 09/11] ethdev: fix shallow copy of flow API RSS action Adrien Mazarguil
2018-04-10 16:34 ` [dpdk-stable] [PATCH v4 10/11] ethdev: fix missing boolean values in flow command Adrien Mazarguil
2018-04-10 16:34 ` [dpdk-stable] [PATCH v4 11/11] ethdev: fix missing include in flow API Adrien Mazarguil
[not found] ` <20180416150058.2620-1-adrien.mazarguil@6wind.com>
2018-04-16 16:21 ` [dpdk-stable] [PATCH v5 01/11] net/mlx4: fix RSS resource leak in case of error Adrien Mazarguil
2018-04-17 9:19 ` [dpdk-stable] [dpdk-dev] " Nélio Laranjeiro
2018-04-16 16:21 ` [dpdk-stable] [PATCH v5 02/11] net/mlx4: fix ignored RSS hash types Adrien Mazarguil
2018-04-17 9:20 ` [dpdk-stable] [dpdk-dev] " Nélio Laranjeiro
2018-04-16 16:21 ` [dpdk-stable] [PATCH v5 03/11] net/mlx5: fix RSS flow action bounds check Adrien Mazarguil
2018-04-16 16:21 ` [dpdk-stable] [PATCH v5 04/11] net/bnxt: fix matching of flow API item masks Adrien Mazarguil
2018-04-16 16:21 ` [dpdk-stable] [PATCH v5 05/11] app/testpmd: fix flow completion for RSS queues Adrien Mazarguil
2018-04-16 16:21 ` [dpdk-stable] [PATCH v5 06/11] app/testpmd: fix lack of flow action configuration Adrien Mazarguil
2018-04-16 16:21 ` [dpdk-stable] [PATCH v5 07/11] app/testpmd: fix RSS " Adrien Mazarguil
2018-04-16 16:22 ` [dpdk-stable] [PATCH v5 08/11] app/testpmd: fix missing RSS fields in flow action Adrien Mazarguil
2018-04-16 16:22 ` [dpdk-stable] [PATCH v5 09/11] ethdev: fix shallow copy of flow API RSS action Adrien Mazarguil
2018-04-17 9:18 ` Nélio Laranjeiro
2018-04-16 16:22 ` [dpdk-stable] [PATCH v5 10/11] ethdev: fix missing boolean values in flow command Adrien Mazarguil
2018-04-16 19:17 ` [dpdk-stable] [dpdk-dev] " Matan Azrad
2018-04-17 8:25 ` Adrien Mazarguil
2018-04-18 17:16 ` Ferruh Yigit
2018-04-19 10:18 ` Adrien Mazarguil
2018-04-16 16:22 ` [dpdk-stable] [PATCH v5 11/11] ethdev: fix missing include in flow API Adrien Mazarguil
[not found] ` <20180419100204.5728-1-adrien.mazarguil@6wind.com>
2018-04-19 10:07 ` [dpdk-stable] [PATCH v6 01/11] net/mlx4: fix RSS resource leak in case of error Adrien Mazarguil
2018-04-19 10:07 ` [dpdk-stable] [PATCH v6 02/11] net/mlx4: fix ignored RSS hash types Adrien Mazarguil
2018-04-19 10:07 ` [dpdk-stable] [PATCH v6 03/11] net/mlx5: fix RSS flow action bounds check Adrien Mazarguil
2018-04-19 10:07 ` [dpdk-stable] [PATCH v6 04/11] net/bnxt: fix matching of flow API item masks Adrien Mazarguil
2018-04-19 10:07 ` [dpdk-stable] [PATCH v6 05/11] app/testpmd: fix flow completion for RSS queues Adrien Mazarguil
2018-04-19 10:07 ` [dpdk-stable] [PATCH v6 06/11] app/testpmd: fix lack of flow action configuration Adrien Mazarguil
2018-04-19 10:07 ` [dpdk-stable] [PATCH v6 07/11] app/testpmd: fix RSS " Adrien Mazarguil
2018-05-07 5:23 ` [dpdk-stable] [dpdk-dev] " Peng, Yuan
2018-04-19 10:07 ` [dpdk-stable] [PATCH v6 08/11] app/testpmd: fix missing RSS fields in flow action Adrien Mazarguil
2018-04-19 10:07 ` [dpdk-stable] [PATCH v6 09/11] app/testpmd: fix missing boolean values in flow command Adrien Mazarguil
2018-04-19 10:07 ` [dpdk-stable] [PATCH v6 10/11] ethdev: fix shallow copy of flow API RSS action Adrien Mazarguil
2018-04-19 10:07 ` [dpdk-stable] [PATCH v6 11/11] ethdev: fix missing include in flow API Adrien Mazarguil
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180404144805.11966-5-adrien.mazarguil@6wind.com \
--to=adrien.mazarguil@6wind.com \
--cc=ajit.khaparde@broadcom.com \
--cc=dev@dpdk.org \
--cc=stable@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).