Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5091632img; Wed, 27 Mar 2019 01:46:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqz+NAinw2tsU977EjhJN7rkWem6DnKsg7FJsxE6Cb7pS1VRE9abIeHXWRE0tlHckpcJHVqQ X-Received: by 2002:a62:6d04:: with SMTP id i4mr33471270pfc.214.1553676397495; Wed, 27 Mar 2019 01:46:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553676397; cv=none; d=google.com; s=arc-20160816; b=sKJCxzfs88NimEJWIEPMhYeYYT+/QBMsckHzqI4i/V1r6vbbX7UINT22XCxYikCtLd HzmUk6fu1t3HxolZ5MWKgCZm+vfsqMU/qh9eHFsfTIsu4xKa6sobSgE09+zHzAFolGaL tkF3VxNs82niwbYs/Avq6nG2vBhAUWWpEw1E5sxI4wLjfPyH3ciA70IGw5tsy06BB9Sn D+4dYlrKcEvXEyCDd+iyJzKIloMcHSc/TrH4jlxPDi2gy9gX+U41XNUEG+EYA0dZRyyW aYUO3c23uVKH6a3Q+plBEQhba3exdnDfk3fb99U3cQd1f8wKtVRtL/6ksas0rn+GxkEI 34yA== 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=6iYG7ZowZ+rez5Ng4UBmX9zb9ibMu//G2zOzfGT96yg=; b=WSfnFXqxpMdDgjLuThunU/gZTGiA74GJzCSXyLDghDu7IRpLiH/70Z/mAtswS/irld EWldg5pC9kyalw0NnR54XtWxwiesxH7pnTU0JZO6VU8dJemoZnyN6f8TitlQde/uVAFm IlcK5wfpKic7s87wU8taioOHfOo11UCeyk8jtIciukbAmqt6tkXcts5OvC1AdPOdDwwB 2hEqPi5VfVFlXKlxG54ipJcHMumbiTIQhXRM2CgbIdo4+AGsudyA6x5cg+tLFxEvtIvz rPsgVwLBLIBHxzoRX5ubB0fJPqS2eM0DSZMErksdQVMwXG+ZYbb5oo1Hc+lvIO9AmicE vTqw== 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 e1si2101033pgf.254.2019.03.27.01.46.22; Wed, 27 Mar 2019 01:46:37 -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 S1733173AbfC0IpW (ORCPT + 99 others); Wed, 27 Mar 2019 04:45:22 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:57935 "EHLO relay2-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733143AbfC0IpV (ORCPT ); Wed, 27 Mar 2019 04:45:21 -0400 X-Originating-IP: 90.88.32.136 Received: from mc-bl-xps13.lan (aaubervilliers-681-1-91-136.w90-88.abo.wanadoo.fr [90.88.32.136]) (Authenticated sender: maxime.chevallier@bootlin.com) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id AC3224001C; Wed, 27 Mar 2019 08:45:17 +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, ymarkman@marvell.com, mw@semihalf.com, Russell King , linux-arm-kernel@lists.infradead.org Subject: [PATCH net-next 18/18] net: mvpp2: cls: Rework C2 engine macros Date: Wed, 27 Mar 2019 09:44:22 +0100 Message-Id: <20190327084422.4209-19-maxime.chevallier@bootlin.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190327084422.4209-1-maxime.chevallier@bootlin.com> References: <20190327084422.4209-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 The C2 classification engine has a 256 entry TCAM, used for ternary matches on an 8 byte Header Extracted Key. For now, we compute the various indices for classification and RSS that use this engine thanks to a set of macros. This commit mainly renames the macros used to make it clear that they should be used with the C2 engine, but also make use of the full 256 entries in the engine. For now, the C2 entries are only used for RSS. These entries are put at the end of the TCAM range, in case we want to add higher priority matches later on. Signed-off-by: Maxime Chevallier --- .../net/ethernet/marvell/mvpp2/mvpp2_cls.h | 28 +++++-------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.h b/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.h index bb3ea84c2888..96304ffc5d49 100644 --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.h +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.h @@ -108,28 +108,14 @@ struct mvpp2_cls_c2_entry { }; /* Classifier C2 engine entries */ -#define MVPP22_CLS_C2_RSS_ENTRY(port) (port) -#define MVPP22_CLS_C2_N_ENTRIES MVPP2_MAX_PORTS +#define MVPP22_CLS_C2_N_ENTRIES 256 -/* RSS flow entries in the flow table. We have 2 entries per port for RSS. - * - * The first performs a lookup using the C2 TCAM engine, to tag the - * packet for software forwarding (needed for RSS), enable or disable RSS, and - * assign the default rx queue. - * - * The second configures the hash generation, by specifying which fields of the - * packet header are used to generate the hash, and specifies the relevant hash - * engine to use. - */ -#define MVPP22_RSS_FLOW_C2_OFFS 0 -#define MVPP22_RSS_FLOW_HASH_OFFS 1 -#define MVPP22_RSS_FLOW_SIZE (MVPP22_RSS_FLOW_HASH_OFFS + 1) - -#define MVPP22_RSS_FLOW_C2(port) ((port) * MVPP22_RSS_FLOW_SIZE + \ - MVPP22_RSS_FLOW_C2_OFFS) -#define MVPP22_RSS_FLOW_HASH(port) ((port) * MVPP22_RSS_FLOW_SIZE + \ - MVPP22_RSS_FLOW_HASH_OFFS) -#define MVPP22_RSS_FLOW_FIRST(port) MVPP22_RSS_FLOW_C2(port) +/* Number of per-port dedicated entries in the C2 TCAM */ +#define MVPP22_CLS_C2_PORT_RANGE 8 + +#define MVPP22_CLS_C2_PORT_FIRST(p) (MVPP22_CLS_C2_N_ENTRIES - \ + ((p) * MVPP22_CLS_C2_PORT_RANGE)) +#define MVPP22_CLS_C2_RSS_ENTRY(p) (MVPP22_CLS_C2_PORT_FIRST(p) - 1) /* Packet flow ID */ enum mvpp2_prs_flow { -- 2.20.1