From: Saeed Mahameed <saeed@kernel.org>
To: "David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org, Tariq Toukan <tariqt@nvidia.com>,
Huy Nguyen <huyn@nvidia.com>, Raed Salem <raeds@nvidia.com>,
Saeed Mahameed <saeedm@nvidia.com>
Subject: [net-next 05/17] net/mlx5e: IPsec/rep_tc: Fix rep_tc_update_skb drops IPsec packet
Date: Wed, 26 May 2021 21:35:57 -0700 [thread overview]
Message-ID: <20210527043609.654854-6-saeed@kernel.org> (raw)
In-Reply-To: <20210527043609.654854-1-saeed@kernel.org>
From: Huy Nguyen <huyn@nvidia.com>
rep_tc copy REG_C1 to REG_B. IPsec crypto utilizes the whole REG_B
register with BIT31 as IPsec marker. rep_tc_update_skb drops
IPsec because it thought REG_B contains bad value.
In previous patch, BIT 31 of REG_C1 is reserved for IPsec.
Skip the rep_tc_update_skb if BIT31 of REG_B is set.
Signed-off-by: Huy Nguyen <huyn@nvidia.com>
Signed-off-by: Raed Salem <raeds@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
index f90894eea9e0..5346271974f5 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
@@ -1310,7 +1310,8 @@ static void mlx5e_handle_rx_cqe_rep(struct mlx5e_rq *rq, struct mlx5_cqe64 *cqe)
if (rep->vlan && skb_vlan_tag_present(skb))
skb_vlan_pop(skb);
- if (!mlx5e_rep_tc_update_skb(cqe, skb, &tc_priv)) {
+ if (unlikely(!mlx5_ipsec_is_rx_flow(cqe) &&
+ !mlx5e_rep_tc_update_skb(cqe, skb, &tc_priv))) {
dev_kfree_skb_any(skb);
goto free_wqe;
}
@@ -1367,7 +1368,8 @@ static void mlx5e_handle_rx_cqe_mpwrq_rep(struct mlx5e_rq *rq, struct mlx5_cqe64
mlx5e_complete_rx_cqe(rq, cqe, cqe_bcnt, skb);
- if (!mlx5e_rep_tc_update_skb(cqe, skb, &tc_priv)) {
+ if (unlikely(!mlx5_ipsec_is_rx_flow(cqe) &&
+ !mlx5e_rep_tc_update_skb(cqe, skb, &tc_priv))) {
dev_kfree_skb_any(skb);
goto mpwrq_cqe_out;
}
--
2.31.1
next prev parent reply other threads:[~2021-05-27 4:36 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-27 4:35 [pull request][net-next 00/17] mlx5 misc updates 2021-05-26 Saeed Mahameed
2021-05-27 4:35 ` [net-next 01/17] net/mlx5e: CT, Remove newline from ct_dbg call Saeed Mahameed
2021-05-27 4:35 ` [net-next 02/17] net/mlx5: CT: Avoid reusing modify header context for natted entries Saeed Mahameed
2021-05-27 4:35 ` [net-next 03/17] net/mlx5e: TC: Use bit counts for register mapping Saeed Mahameed
2021-05-27 4:35 ` [net-next 04/17] net/mlx5e: TC: Reserved bit 31 of REG_C1 for IPsec offload Saeed Mahameed
2021-05-27 4:35 ` Saeed Mahameed [this message]
2021-05-27 4:35 ` [net-next 06/17] net/mlx5e: RX, Remove unnecessary check in RX CQE compression handling Saeed Mahameed
2021-05-27 4:35 ` [net-next 07/17] net/mlx5: DR, Remove unused field of send_ring struct Saeed Mahameed
2021-05-27 4:36 ` [net-next 08/17] net/mlx5: Add case for FS_FT_NIC_TX FT in MLX5_CAP_FLOWTABLE_TYPE Saeed Mahameed
2021-05-27 4:36 ` [net-next 09/17] net/mlx5: Move table size calculation to steering cmd layer Saeed Mahameed
2021-05-27 4:36 ` [net-next 10/17] net/mlx5: Move chains ft pool to be used by all firmware steering Saeed Mahameed
2021-05-27 4:36 ` [net-next 11/17] net/mlx5: DR, Set max table size to 2G entries Saeed Mahameed
2021-05-27 4:36 ` [net-next 12/17] net/mlx5: Cap the maximum flow group size to 16M entries Saeed Mahameed
2021-05-27 4:36 ` [net-next 13/17] net/mlx5: Remove unnecessary spin lock protection Saeed Mahameed
2021-05-27 4:36 ` [net-next 14/17] net/mlx5: Use boolean arithmetic to evaluate roce_lag Saeed Mahameed
2021-05-27 4:36 ` [net-next 15/17] net/mlx5: Fix lag port remapping logic Saeed Mahameed
2021-05-27 4:36 ` [net-next 16/17] net/mlx5: Ensure SF BAR size is at least PAGE_SIZE Saeed Mahameed
2021-05-27 7:38 ` Parav Pandit
2021-05-27 4:36 ` [net-next 17/17] net/mlx5: Improve performance in SF allocation Saeed Mahameed
2021-05-27 5:36 ` Parav Pandit
2021-05-27 18:52 ` Saeed Mahameed
2021-05-28 3:42 ` Parav Pandit
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=20210527043609.654854-6-saeed@kernel.org \
--to=saeed@kernel.org \
--cc=davem@davemloft.net \
--cc=huyn@nvidia.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=raeds@nvidia.com \
--cc=saeedm@nvidia.com \
--cc=tariqt@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).