Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3877574ybi; Tue, 18 Jun 2019 07:55:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqyvayyZLT1bsADrnDhWt7Ia+lE2sYtMcFKc3/KZykgNiit5x8Um5Jbz3uR5cEw/Ltrb0O76 X-Received: by 2002:a17:90a:5d15:: with SMTP id s21mr5518709pji.125.1560869754363; Tue, 18 Jun 2019 07:55:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560869754; cv=none; d=google.com; s=arc-20160816; b=bFbb5ds7EYPtjxtPtzCqW7NU+sl1PYMsHj872m64scgTUUIsD++KODkpUi3aX0+yDm Q1oOrykqvjM0xkOl7QDrM1TnMxHQ3qo8RnRrlrWOAJNFA66QP0ToLlOiGuIm1tE6WvSJ WUSwZFlT8yVD8fp1FeDIktMJ9sk/X5YqBkqULEZ2w10MjQxSGmk/nje3oGsMVH3OxuMm tOxGKjGBpCQh91Vj/kAfHHbXdUHYAv1j13V28nVjAL0EflNSb8fS+WN8z7PpooIlgqPq 2Dp2scl7Jqi9BqogsCxcjaQl/6mhR3D9ps0vteWq51HuYl4hWYdT2BNJmAJIEXYVXnZ1 VBtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=eG5E0tpou7OqyKLNayZDr1e7jlE0T8IFvBCefaYjrsY=; b=P9tKjXXTQ/E9ujE2oxc1A1t1uPv8wI1pAPyX0SQtKNf0eg4Xb5vkOiMkux3r9ico/Q J3UMreO9JNZ3vFFDhe0Qa4gUF/510DZdtKbq5En9/4Rl2AmgBi/SVRMKJKEpB38yAaM4 7YTxK1TJYaQngyS6rG3GLh9i1y2rLXy4LqIsTzKCRq1K/l3HFuh2P6fUcEGtnb0sMp13 T8PhusyqXvHAFJLbyjXudeP0wwLjH2bblu4c3SecSy8r42a20RuTo/E1RGleb4Xe08CB E40tECn3RD9RWJGI2mHqJSSX8GQFw9FSOsfnDDsb/TXNaTUowl2ADJJfco+JNQr796fK utGA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u69si382550pgc.531.2019.06.18.07.55.39; Tue, 18 Jun 2019 07:55:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729571AbfFROzb (ORCPT + 99 others); Tue, 18 Jun 2019 10:55:31 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:50303 "EHLO relay2-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728881AbfFROz3 (ORCPT ); Tue, 18 Jun 2019 10:55:29 -0400 X-Originating-IP: 90.88.23.150 Received: from mc-bl-xps13.lan (aaubervilliers-681-1-81-150.w90-88.abo.wanadoo.fr [90.88.23.150]) (Authenticated sender: maxime.chevallier@bootlin.com) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id 17D6D4000B; Tue, 18 Jun 2019 14:55:25 +0000 (UTC) From: Maxime Chevallier To: davem@davemloft.net Cc: Maxime Chevallier , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Antoine Tenart , thomas.petazzoni@bootlin.com, gregory.clement@bootlin.com, miquel.raynal@bootlin.com, nadavh@marvell.com, stefanc@marvell.com, mw@semihalf.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH net-next 1/4] net: mvpp2: cls: Use a dedicated lu_type for the RSS lookup Date: Tue, 18 Jun 2019 16:55:16 +0200 Message-Id: <20190618145519.27705-2-maxime.chevallier@bootlin.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190618145519.27705-1-maxime.chevallier@bootlin.com> References: <20190618145519.27705-1-maxime.chevallier@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When performing a TCAM lookup in the C2 engine, it's possible that multiple entries match the packet. To make sure the correct entry match when performing a lookup, the Flow Table can set a lookup type, which will be used in the TCAM lookup, thus preventing such false-positives. We need to make sure the RSS match doesn't interfere with other classification lookups, hence we use a dedicated lookup_type for it. Signed-off-by: Maxime Chevallier --- drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c | 4 ++-- drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.h | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c index e47c00c5f829..8af13316ecb1 100644 --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c @@ -596,7 +596,7 @@ static void mvpp2_cls_flow_init(struct mvpp2 *priv, mvpp2_cls_flow_eng_set(&fe, MVPP22_CLS_ENGINE_C2); mvpp2_cls_flow_port_id_sel(&fe, true); - mvpp2_cls_flow_lu_type_set(&fe, MVPP22_FLOW_ETHERNET); + mvpp2_cls_flow_lu_type_set(&fe, MVPP22_CLS_LU_TYPE_ALL); /* Add all ports */ for (i = 0; i < MVPP2_MAX_PORTS; i++) @@ -861,7 +861,7 @@ static void mvpp2_port_c2_cls_init(struct mvpp2_port *port) /* Match on Lookup Type */ c2.tcam[4] |= MVPP22_CLS_C2_TCAM_EN(MVPP22_CLS_C2_LU_TYPE(MVPP2_CLS_LU_TYPE_MASK)); - c2.tcam[4] |= MVPP22_CLS_C2_LU_TYPE(MVPP22_FLOW_ETHERNET); + c2.tcam[4] |= MVPP22_CLS_C2_LU_TYPE(MVPP22_CLS_LU_TYPE_ALL); /* Update RSS status after matching this entry */ c2.act = MVPP22_CLS_C2_ACT_RSS_EN(MVPP22_C2_UPD_LOCK); diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.h b/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.h index 26cc1176e758..957f80b31743 100644 --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.h +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.h @@ -180,6 +180,11 @@ enum mvpp2_prs_flow { /* LU Type defined for all engines, and specified in the flow table */ #define MVPP2_CLS_LU_TYPE_MASK 0x3f +enum mvpp2_cls_lu_type { + /* rule->loc is used as a lu-type for the entries 0 - 62. */ + MVPP22_CLS_LU_TYPE_ALL = 63, +}; + #define MVPP2_N_FLOWS (MVPP2_FL_LAST - MVPP2_FL_START) struct mvpp2_cls_flow { -- 2.20.1