Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3514788pxf; Mon, 15 Mar 2021 11:14:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqwGJ5kzsH6H0QdEeQLl2+gcQAFgFhaqkLwtDetlqBNTbvVr/MWYFiqEhOsO/oxf7mWLNs X-Received: by 2002:a17:906:b817:: with SMTP id dv23mr25786939ejb.281.1615832069473; Mon, 15 Mar 2021 11:14:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615832069; cv=none; d=google.com; s=arc-20160816; b=anzE1gPkqbt6ynHhNiogydyuuXED1eckr5xffZUD77J48gRc8p+Etcbr1ykeokgCXw owQY+sGRqJS50YkzR3B1z1s2FlxMSjfpLpD2EXu5zmzEGd6FuUIMe6rTPUTqP40Y6UQ8 qWI6QXalpJZMe4AhPiDBf4imr5x+/PTf9klMj+aLoBZjKeVj7YvmqVkVXtn5tEUDMv/6 QCtgGcmWKA8P5YM40CgGG0um7tOxzBvXW2w0L9Bt+yNBE98eJo9MYmalEKDSxmF2weFd k9oKMFnIr0/76vEvLYc4TrBfz3t3wRsct1aXLwepcIYEB1HRalYEmHrxFaVIHbRDurMw bbvw== 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=B5v+8kYha5Rc/9TCHF4pWXkFlWbqAK3nuNYbQwmfKqg=; b=rfJmZ0FS/BJuwicPiVvu7ufM/5eW4O222UWMFl2i64DVC4vROY7CSV5MwjWDYEm6VR YwxUFldVqIBdvgRaNyOedjsdCxIL+aoSuQAObB61a7fXTUsim5VK15Sn9JcKWhCXRijL I0L6hhcYqzV77rji4eo+QHqdX4faw7zcrjSoibrnIlfLLaPzWbCrcyN/RjEfRCte+A9g Y5IR6qP5pznHqlnFDkXMy2Aaaat/OMvv+gRWFSPY4l+X2cfIiqqvAETbdtUyKDHiPj+A geAqyQhIsa0YLAcQVuFInqA0VHjSavdKJjF4OSdsT+0GfyiZ+T+9zX0pi0ppIUnmqAJm cNMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Z1e3a6VB; 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 m13si11466190edd.35.2021.03.15.11.14.06; Mon, 15 Mar 2021 11:14:29 -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=Z1e3a6VB; 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 S236491AbhCOONH (ORCPT + 99 others); Mon, 15 Mar 2021 10:13:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:36788 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232574AbhCON7D (ORCPT ); Mon, 15 Mar 2021 09:59:03 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BF47964F42; Mon, 15 Mar 2021 13:58:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816732; bh=9B0idt4ktbkNfuNjgxBbHLPLTbav9DYS7RS8bmWB0i0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z1e3a6VBd2gZLPjz8xnKKT2mN5DyIh5B1Tuw99pQtOkDZJCK1xUSm1O5FpQFReHLl Q/yGy6TDYTOt5zR5ih/AhJv7tNR2KFqR3Smw4SINyKGiKM5CMfktw/nLuDfegxAN6F WDKgm7iqzqzjqOvCeUJTbWRF/AhylDU5w27rxgSE= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jian Shen , Huazhong Tan , Jakub Kicinski Subject: [PATCH 5.11 091/306] net: hns3: fix bug when calculating the TCAM table info Date: Mon, 15 Mar 2021 14:52:34 +0100 Message-Id: <20210315135510.726779082@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135507.611436477@linuxfoundation.org> References: <20210315135507.611436477@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: Greg Kroah-Hartman From: Jian Shen commit b36fc875bcdee56865c444a2cdae17d354a6d5f5 upstream. The function hclge_fd_convert_tuple() is used to convert tuples and tuples mask to TCAM x and y. But it misuses the source mac as source mac mask when convert INNER_SRC_MAC, which may cause the flow director rule works unexpectedly. So fix it. Fixes: 117328680288 ("net: hns3: Add input key and action config support for flow director") Signed-off-by: Jian Shen Signed-off-by: Huazhong Tan Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -5194,9 +5194,9 @@ static bool hclge_fd_convert_tuple(u32 t case BIT(INNER_SRC_MAC): for (i = 0; i < ETH_ALEN; i++) { calc_x(key_x[ETH_ALEN - 1 - i], rule->tuples.src_mac[i], - rule->tuples.src_mac[i]); + rule->tuples_mask.src_mac[i]); calc_y(key_y[ETH_ALEN - 1 - i], rule->tuples.src_mac[i], - rule->tuples.src_mac[i]); + rule->tuples_mask.src_mac[i]); } return true;