Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp638124pxv; Thu, 15 Jul 2021 12:09:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxSa5VR1cYCk27g7ovXHDecljhePD+E5hiXuf6dRQgQtyKUsVNhjhUVvAkQ6kIxTPp177AC X-Received: by 2002:aa7:da4f:: with SMTP id w15mr9108594eds.266.1626376162025; Thu, 15 Jul 2021 12:09:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626376162; cv=none; d=google.com; s=arc-20160816; b=BTgxL6OS+uA5cxKdIaHMpAiqZ+n4uUtQtwzjQPSvNjcJOOOqJ915xDB9/YLhaZVBKd h7FBavQ3Ck9Fap7Q4Q2Ujf3VAebGRLqVgwHBtIIv6gtSvg5GXV7H0vd13/aDF7vLDnV5 xI5DJyN4TCOV4eG2yqFoXaNpZSvg1YiKzhCMulXwPJdqAmKSUjI8q4k0QynBGWJyT8na VfrgqYe+HTWzTmq4H1CeDd0enKDYbUitSlE3Yoes5fVmjFsUgLmLuwZFjJBGSyHZ1Yj7 Kk3f5WGWRtbdxeWL4FP6CqoHSvsAA64FkNt9rKw8BOTkmqVVwsNT+Yoj6yeijJWz7Ykf Twuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=m9CsZE1wEQe7YU37cJEtjQf36I5UoCogJynLWA1n+90=; b=tYEgDmCwJFSWXK6o6lU3k02ISpLa6NmXcvnRrJpX9IWCL1BlVapEegs0vaem+8gr6A E21RieWZz/ZF0I1Kq4V682zKNG/+wQySq9ikaaX51qz5zVGLiwHFY0r1j7033DGgu9Hv 4OVJ1wL7K48khFqMM5tm+DRi5Zg6McqDpXLsIiyy9nUenqd/i7yIj4KqXRCoxm8ZTvWF 4HHbt7zEGyib5P5Xonwy7R7oprLnLDmZ/KlzqYc36U5s9XMgyEG99lfq5uS575vGUJnO YOn/7azMJbM3oUDEjIKZ1SBKQ9ss8WFoxfTOrDTRgGURNwwGTbgPwg2L+XGOhx3DuhyP /bSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cKHOGwob; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o8si8278866edw.60.2021.07.15.12.08.58; Thu, 15 Jul 2021 12:09:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cKHOGwob; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243330AbhGOTJp (ORCPT + 99 others); Thu, 15 Jul 2021 15:09:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:35572 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240821AbhGOS6N (ORCPT ); Thu, 15 Jul 2021 14:58:13 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 980B0601FE; Thu, 15 Jul 2021 18:55:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626375320; bh=WE3iQ4QdE2iVQ6Yk+6vTFUR7rdHzH9Eo/9dk/CYwD0o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cKHOGwobd3LdkMRY6893F7h14eH563sa2CVXw4esrNHLhhjTaONG/xTodaoLLeL7e QzaSwWVrxx/K+oU3GfhcBj1ZmSIH6iigZhWfbES5I1joz95/al1uT/lYeuvFHzV94p G7SR+RHUx83RevAyJMywgtr7jgXVu7DShkxosuJw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Huy Nguyen , Raed Salem , Saeed Mahameed , Sasha Levin Subject: [PATCH 5.12 037/242] net/mlx5e: IPsec/rep_tc: Fix rep_tc_update_skb drops IPsec packet Date: Thu, 15 Jul 2021 20:36:39 +0200 Message-Id: <20210715182558.529346941@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182551.731989182@linuxfoundation.org> References: <20210715182551.731989182@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Huy Nguyen [ Upstream commit c07274ab1ab2c38fb128e32643c22c89cb319384 ] 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 Signed-off-by: Raed Salem Signed-off-by: Saeed Mahameed Signed-off-by: Sasha Levin --- 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 249d8905e644..e7528fa7e187 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c @@ -1308,7 +1308,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; } @@ -1365,7 +1366,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.30.2