Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3516649pxf; Mon, 15 Mar 2021 11:17:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwhArQEeOlqKfuTN/XvyI7mmyV8WzOAPBlXs8Rdksbhyf7//zqY95xhzapAokO80YWvm7mP X-Received: by 2002:a05:6402:10c6:: with SMTP id p6mr31456082edu.241.1615832221206; Mon, 15 Mar 2021 11:17:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615832221; cv=none; d=google.com; s=arc-20160816; b=rkuy8zn4HHACsLxKHMuM2FbEtrLIqjlTu+a392XiIVDOwUx0zGTrvdXnSTxUS/ehdM yMzdzCAbRVib0L0N8vPuta2vIa6iV/3VrnU4eTe00qOlf4AWTOD4o4MDLkjHgI9KwUoT eubCKce2YAxDSGhLlgJwaj6XsvUgsWdxLYHibWubTufgspT24FPWrYB5oR66092qvhnY G/f4uSl/KBgxjtm+cj0K/NBPTGvs5UES/Yzt4F7+mmLNfpH7mHMmg6Bo+7w9UfJniNTa f9ABgKATY1happDpETdpFhhcdv//T0CKuNgWmwl2MH04fRO/hEBu2HMvVRxWRCDJVCcI 4yFg== 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=F120KXHwipb96S5jsu+XZEvzvnVQT7jjVJccm9pseX8=; b=WDxH+aK2H4SDZY5Pi42oMZ3pSk67q1ULKHhKEVYS0BM0+1SxlzP8IlyGGq+wd9WrAP BRloSE2bD/lYOyyY0k9uVQZXXlh/qL1Rwr+mLiXX/Lw+bSBX+U7g/8T1eM2lfSforN3N ckMCS8FIpbQObaygHbfU1yz73vegH7Gz1x85YhIvcVITgyMc6UYz9Ga2BGau40I2ChAH EEXQuCv8lQzeeEBcc7nl9k6kIM1Pddzkv3qsaz5tFAAowOwEffVFIkz0/1K6jIujoVHX ewZM8W8zpqnv3sQf9ivIHawI+TWVYDqDcwVbgyr6KNmsyZ45ymw3FFXULHlY0KZ2I+r5 17mA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qhISo5JW; 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 z24si11255254ejx.462.2021.03.15.11.16.36; Mon, 15 Mar 2021 11:17:01 -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=qhISo5JW; 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 S236761AbhCOOPS (ORCPT + 99 others); Mon, 15 Mar 2021 10:15:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:36594 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232515AbhCON7A (ORCPT ); Mon, 15 Mar 2021 09:59:00 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 980DE64E4D; Mon, 15 Mar 2021 13:58:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816723; bh=NDPQ7FYGS8yZ1oCfwTxWbaEhC+/5hAfhGVa8tPwknQs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qhISo5JW18V2CBhyLRzH0ChISpNNpejsy6FuFJSzQgnYO4rXwFV984C8CFLCYypm1 52fp2wtUjDk+maeHlMW3MkJbyGiAv17y5t9lpIWYzaqAUzCyxN8ZwImXeMYpiu8ays e3t/JtGLaeh/1DAmtzYItIXc8zQlyGwpwaAF8tPQ= 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.10 076/290] net: hns3: fix bug when calculating the TCAM table info Date: Mon, 15 Mar 2021 14:52:49 +0100 Message-Id: <20210315135544.480234037@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135541.921894249@linuxfoundation.org> References: <20210315135541.921894249@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 @@ -5115,9 +5115,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;