Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp651935pxv; Thu, 15 Jul 2021 12:31:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwC5Yh7z/Hp2YsFGCmXJyIsUdX6x54VVf9/FdJ8W7xUdDcVWWRBbPpNJJAEUM2l5j8acE6y X-Received: by 2002:a05:6402:2023:: with SMTP id ay3mr9142893edb.383.1626377468865; Thu, 15 Jul 2021 12:31:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626377468; cv=none; d=google.com; s=arc-20160816; b=CB4/QGHRGeYjZKcU2dcRvU8goDpXn/YG1C233iXE1B2KSSEEBBIV5lfOTOqW3yEpYM FzHPssbTJ/tTxUtr7qIvQsb2TYzOa8VJre1s8ig8EQ017twEk8ITJbVspXd6Dv4w153i BgeXcLUGTGybZqudXo1zcVw8DAkWgLgvf9ctDvbLZ7gp87QiEAQ5iriAxMNJMd5VnEYW /vu5+CX66fNLF5XkR4w7Vcom7TlvJBP44GPAz6BNv74h3MFaiBDz9eppzrSUxPZqJj4T L0fes02RYhRyaeFlMmDjCIEqRQ5in21d6WMLhlM326GyYO0JJbsNfnlbBa7IYffvfJqj O5TA== 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=mia7sdm26rxxDG/4rh3j3ewQdQMrKw3IxgLQdXAqso4=; b=Bj5VkjBZ5IOO8htyYj6inQZu3k4uklI0RS4Ty3fQAKAb7AuDJztowM5BbgtaXQTb+m teigMEY2AEAjs+AhABxzq2tMiMwH6aQZTZqVeasZ9vVaMK/w1w9mlGtASnAqKy8jJ0sE hWtN9xCGSFQ5PZMPSdFLC1Q3M87KXUa2myR9M6P8aqqvEhPvL7JDpetINAWPq3NUvpku dF1zoQc/kTOg9LXaNQLOSI0KRL2uBPCKkcIbx/I86O91FaSjDiHxCYJksHlHPN3E8EXv s+kp9wXTufJN7N6TUaEXO7fkqYiBgCI4xZDaKSYAEre6lSmkWQ/6pErjVoyl6qimgDaJ ckgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NClZlovN; 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 u26si7593158ejz.460.2021.07.15.12.30.45; Thu, 15 Jul 2021 12:31:08 -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=NClZlovN; 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 S1345259AbhGOTa6 (ORCPT + 99 others); Thu, 15 Jul 2021 15:30:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:46340 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243190AbhGOTJ3 (ORCPT ); Thu, 15 Jul 2021 15:09:29 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 450A461370; Thu, 15 Jul 2021 19:05:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626375911; bh=qwDOPYoWnDfuwo7d96yAIbMByB5OAY5HzokkWBqgC+Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NClZlovNV8kvw6Qn1czodIskzaS67R2KXWq86wMPg4YUOOZJVKXKkPGcC09IyI/Ff 00wEI8JF4mbqLdUbiKZZqUz9MaTP1F3Ymdwxd9rWlZ6CWEdDDKUOtKloeD4MWUtU33 ZpiV1+6sXP14RYWbiYHmnOmiS+bKWqBWd669A7MM= 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.13 046/266] net/mlx5e: IPsec/rep_tc: Fix rep_tc_update_skb drops IPsec packet Date: Thu, 15 Jul 2021 20:36:41 +0200 Message-Id: <20210715182622.344961549@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182613.933608881@linuxfoundation.org> References: <20210715182613.933608881@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 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.30.2