Commit c07274ab authored by Huy Nguyen's avatar Huy Nguyen Committed by Saeed Mahameed
Browse files

net/mlx5e: IPsec/rep_tc: Fix rep_tc_update_skb drops IPsec packet



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: default avatarHuy Nguyen <huyn@nvidia.com>
Signed-off-by: default avatarRaed Salem <raeds@nvidia.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
parent b973cf32
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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;
	}