Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3510947pxf; Mon, 15 Mar 2021 11:09:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz0lwsKhuiqsBCvuUU2bpfMt8ZO0N5gDa3Z9WcGjy9S6jXu9ZJAlZYTi7UMV9ZJPci30rwJ X-Received: by 2002:a17:907:2661:: with SMTP id ci1mr24724576ejc.403.1615831741801; Mon, 15 Mar 2021 11:09:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615831741; cv=none; d=google.com; s=arc-20160816; b=iw7dB/N/57/ezxsClsplrki+SqJUTaGF0C9/ShiBRLen1MrsPOiC+wu3tRdHZlbpNp TwuVivqu0DMh/16KbUMt4Zwt+SENkI2cZCPZzYoopJeKBmMTpQihDBYj7AbcsyxtI/jg 2iTOKu7KFGK7QCje9sg9CTylkPtYK9vzG75ozZoG/a5TRh8Ra43+onfLrLSznIRQBEtW 2kwgjjQJCUomernv2I6PYNfcoH5eek2RPitjzY6Vnm0IXn1OPbaARJ3hFIhh7lwWC33W ourFmnGKDGPrCKzhkYVoP7iaCyXAp3Ea6afbOJ/K0qEuUnLc9iqt8UsSi1ZTnEn5Mmqa eq6Q== 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=X17kKCIzpCcqBk915i4ciw4y6wXp6vOfxFJ8OsrhWrI=; b=ArgGVSaCJmfmSxbP3kOUX/HxIInunYRyV2mUhjUZDxf5f+6li2kYdUNLbIx4QZc+/f XSn1DaMXFYiUSU0umGIhyqMFrYLxXTw9NX4agQ0b9QrIgE5iz46f+D8n+DNJrrRgVWQU YUpCnkAveMKEUkgKNKTiNfIk6mExSP2c/zS/pR+LtwnejFo9Ps8bgb2TBE/FBVBwnIk8 tGOi04y7uzqwG1Wic7rKYcRsdprifaDwopsQPScdZo7xBvyoDUpowO2x8zC2GiCaUjJk 4c5ZEGBtOB/VnJpDgdFXxR6I5oCA+r1xc5ejIIao0Bwj8vtbHb64ss1ghzjXnwRgy7Z+ 3fTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jfX5mox8; 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 ot6si12051747ejb.337.2021.03.15.11.08.22; Mon, 15 Mar 2021 11:09: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=jfX5mox8; 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 S235092AbhCOOJI (ORCPT + 99 others); Mon, 15 Mar 2021 10:09:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:36670 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230186AbhCON6C (ORCPT ); Mon, 15 Mar 2021 09:58:02 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5BBE464F18; Mon, 15 Mar 2021 13:58:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816682; bh=2XZdOGL53ESY6DlRyQR2Jwsr7kFarKg/sWBDEMmMrhE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jfX5mox8YzRrUVSxv1WjVRQlE8Aj8KiAP+TAeMjgIg15HCamXZXiiVpbL5sIgZTY9 jLASFVpmtbDPhVrX50441gUy3Ly7kouLb9j7qYEuqEGMuco2g5L/HArKDMR7spn1wV 7DkJScFkyRdoTcIwpk+YkrG4T+DDwBjMcUAYHxSw= 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.4 044/168] net: hns3: fix bug when calculating the TCAM table info Date: Mon, 15 Mar 2021 14:54:36 +0100 Message-Id: <20210315135551.812109735@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135550.333963635@linuxfoundation.org> References: <20210315135550.333963635@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 @@ -4908,9 +4908,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;