From: Bing Zhao <bingz@nvidia.com>
To: <suanmingm@nvidia.com>, <rasland@nvidia.com>, <dev@dpdk.org>
Cc: <matan@nvidia.com>, <viacheslavo@nvidia.com>, <orika@nvidia.com>,
<dsosnowski@nvidia.com>, <stable@dpdk.org>,
Hamdan Igbaria <hamdani@nvidia.com>
Subject: [PATCH] net/mlx5/hws: fix VLAN item handling on non relaxed mode
Date: Wed, 21 Feb 2024 05:53:51 +0200 [thread overview]
Message-ID: <20240221035351.298066-1-bingz@nvidia.com> (raw)
From: Hamdan Igbaria <hamdani@nvidia.com>
If a VLAN item was passed with null mask, the item handler would
return immediately and thus won't set default values for non relax
mode.
Also change the non relax default set to single-tagged (CVLAN).
Fixes: c55c2bf35333 ("net/mlx5/hws: add definer layer")
Cc: stable@dpdk.org
Signed-off-by: Hamdan Igbaria <hamdani@nvidia.com>
Acked-by: Suanming Mou <suanmingm@nvidia.com>
---
drivers/net/mlx5/hws/mlx5dr_definer.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/drivers/net/mlx5/hws/mlx5dr_definer.c b/drivers/net/mlx5/hws/mlx5dr_definer.c
index 79d98bbf78..6585c91e1f 100644
--- a/drivers/net/mlx5/hws/mlx5dr_definer.c
+++ b/drivers/net/mlx5/hws/mlx5dr_definer.c
@@ -196,6 +196,7 @@ struct mlx5dr_definer_conv_data {
X(SET, ib_l4_opcode, v->hdr.opcode, rte_flow_item_ib_bth) \
X(SET, random_number, v->value, rte_flow_item_random) \
X(SET, ib_l4_bth_a, v->hdr.a, rte_flow_item_ib_bth) \
+ X(SET, cvlan, STE_CVLAN, rte_flow_item_vlan) \
/* Item set function format */
#define X(set_type, func_name, value, item_type) \
@@ -837,6 +838,15 @@ mlx5dr_definer_conv_item_vlan(struct mlx5dr_definer_conv_data *cd,
struct mlx5dr_definer_fc *fc;
bool inner = cd->tunnel;
+ if (!cd->relaxed) {
+ /* Mark packet as tagged (CVLAN) */
+ fc = &cd->fc[DR_CALC_FNAME(VLAN_TYPE, inner)];
+ fc->item_idx = item_idx;
+ fc->tag_mask_set = &mlx5dr_definer_ones_set;
+ fc->tag_set = &mlx5dr_definer_cvlan_set;
+ DR_CALC_SET(fc, eth_l2, first_vlan_qualifier, inner);
+ }
+
if (!m)
return 0;
@@ -845,8 +855,7 @@ mlx5dr_definer_conv_item_vlan(struct mlx5dr_definer_conv_data *cd,
return rte_errno;
}
- if (!cd->relaxed || m->has_more_vlan) {
- /* Mark packet as tagged (CVLAN or SVLAN) even if TCI is not specified.*/
+ if (m->has_more_vlan) {
fc = &cd->fc[DR_CALC_FNAME(VLAN_TYPE, inner)];
fc->item_idx = item_idx;
fc->tag_mask_set = &mlx5dr_definer_ones_set;
--
2.34.1
next reply other threads:[~2024-02-21 3:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-21 3:53 Bing Zhao [this message]
2024-02-21 3:59 ` [PATCH v2] " Bing Zhao
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=20240221035351.298066-1-bingz@nvidia.com \
--to=bingz@nvidia.com \
--cc=dev@dpdk.org \
--cc=dsosnowski@nvidia.com \
--cc=hamdani@nvidia.com \
--cc=matan@nvidia.com \
--cc=orika@nvidia.com \
--cc=rasland@nvidia.com \
--cc=stable@dpdk.org \
--cc=suanmingm@nvidia.com \
--cc=viacheslavo@nvidia.com \
/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).