Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5091257img; Wed, 27 Mar 2019 01:45:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqyUcALMw884J1N6iFV55FxLR6sKp2mcPEcQSC61MJ3lzY9ViBtRz/Mg5oDCfUxtmwDLtsKK X-Received: by 2002:a17:902:2e83:: with SMTP id r3mr18272073plb.153.1553676356939; Wed, 27 Mar 2019 01:45:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553676356; cv=none; d=google.com; s=arc-20160816; b=W/lp0P7e9JJmsyuiPkzA/kcKVSjoPah03qpmi0bRYdzyb2/xgqEQszwjuSWPlbLpIm G3hVzm6eDCY6bAxsEZr1/fY+cKTweZ9C5KeSTDtfehDS+IKp3flT1RAJjR2AGLrDp0Ae h2zopXUpi65j/C5xBJ86ZDsPRtY1qdVONLpKFc8XckGJ74BVbgBCW2iRNhmlm9mzW9FX Zvpl4okwu6w5EmQ9aeTSYm3HTZZNNc2uPMQ2or3wntr3UWupTvDTnO2gIUd8rJ7A3QfB dnrHVEGERPY79tLWWCs0egvXULHYVieZTmIEQaTbXJFniC61kf0s/4+NR26sL8udOrN+ Pn8g== 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=QXgCmaIuj4bV7rnQS96d2htfBh4bfGJodmJ2giPu1FI=; b=dqpsnKYvOqLbmC0U/FmyjEMlXxetjslVnJsRNzdDr8/8WPb+bC6fMqvhRjeuIeidyY F+cUr1BhM6ErAfBzh5gWFGtEdXU85eBkDKuhFIB1mHrVw/srznuZP/+KqydJwlYZQi3j 4yTrpV3+GIa6TxwVcmliizaPU+H4d4d520/EDVxiSrZn4iBnVVjMnP+8F4TcuGrZ32yo wpfl/hxscw3Lq1F4T2KhAWBlQZAuWJ42Mfouf/HGrgItCh3/UNRjnDM4NgIeqD3pgZp4 G/Ctk/xxj0ZE87Og/4DFbkGuuXt8d4qEoSHKPiv6g94UqLWsrCR3OQ9V8YEtyu1d7AxH YMEQ== 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 o35si15490544pgb.551.2019.03.27.01.45.41; Wed, 27 Mar 2019 01:45:56 -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 S1732701AbfC0Iow (ORCPT + 99 others); Wed, 27 Mar 2019 04:44:52 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:33057 "EHLO relay2-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732432AbfC0Ion (ORCPT ); Wed, 27 Mar 2019 04:44:43 -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 533B040010; Wed, 27 Mar 2019 08:44:40 +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, Alan Winkowski Subject: [PATCH net-next 03/18] net: mvpp2: cls: Start cls flow entries from beginning of table Date: Wed, 27 Mar 2019 09:44:07 +0100 Message-Id: <20190327084422.4209-4-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 Classifier flow table has 512 entries, that contains lookups commands executed consecutively for every flow. Since we have 21 different flows, we have to carefully manage the flow table use. As of today, the start index of a lookup sequence is computed directly based in the flow->id. There are 8 reserved flow ids, from 0-7, which don't have any corresponding sequence in the flow table. We can therefore ignore them when computing the index, and make so that the first non-reserved flow point to the very beginning of the flow table. Signed-off-by: Maxime Chevallier Suggested-by: Alan Winkowski --- drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.h b/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.h index 089f05f29891..c1424f90cbaf 100644 --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.h +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.h @@ -179,9 +179,11 @@ struct mvpp2_cls_flow { #define MVPP2_N_FLOWS 52 #define MVPP2_ENTRIES_PER_FLOW (MVPP2_MAX_PORTS + 1) -#define MVPP2_FLOW_C2_ENTRY(id) ((id) * MVPP2_ENTRIES_PER_FLOW) -#define MVPP2_PORT_FLOW_HASH_ENTRY(port, id) ((id) * MVPP2_ENTRIES_PER_FLOW + \ - (port) + 1) +#define MVPP2_FLOW_C2_ENTRY(id) ((((id) - MVPP2_FL_START) * \ + MVPP2_ENTRIES_PER_FLOW) + 1) +#define MVPP2_PORT_FLOW_HASH_ENTRY(port, id) (MVPP2_FLOW_C2_ENTRY(id) + \ + 1 + (port)) + struct mvpp2_cls_flow_entry { u32 index; u32 data[MVPP2_CLS_FLOWS_TBL_DATA_WORDS]; -- 2.20.1