From: Maxime Chevallier <maxime.chevallier@bootlin.com>
To: davem@davemloft.net
Cc: Maxime Chevallier <maxime.chevallier@bootlin.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Antoine Tenart <antoine.tenart@bootlin.com>,
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@armlinux.org.uk>,
linux-arm-kernel@lists.infradead.org
Subject: [PATCH net-next 05/18] net: mvpp2: cls: Rename MVPP2_N_FLOWS to MVPP2_N_PRS_FLOWS
Date: Wed, 27 Mar 2019 09:44:09 +0100 [thread overview]
Message-ID: <20190327084422.4209-6-maxime.chevallier@bootlin.com> (raw)
In-Reply-To: <20190327084422.4209-1-maxime.chevallier@bootlin.com>
The macro definition MVPP2_N_FLOWS is ambiguous because it really
represents the number of entries in the Header Parser that are used to
identify the classification flows.
Rename the macro to clearly state that we represent the number of flows
in the Header Parser.
Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
---
drivers/net/ethernet/marvell/mvpp2/mvpp2.h | 2 ++
drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c | 10 +++++-----
drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.h | 3 ++-
drivers/net/ethernet/marvell/mvpp2/mvpp2_debugfs.c | 2 +-
4 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2.h b/drivers/net/ethernet/marvell/mvpp2/mvpp2.h
index 1356fc4fbccb..6220284798b1 100644
--- a/drivers/net/ethernet/marvell/mvpp2/mvpp2.h
+++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2.h
@@ -612,6 +612,8 @@
#define MVPP2_BIT_TO_WORD(bit) ((bit) / 32)
#define MVPP2_BIT_IN_WORD(bit) ((bit) % 32)
+#define MVPP2_N_PRS_FLOWS 52
+
/* RSS constants */
#define MVPP22_RSS_TABLE_ENTRIES 32
diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c
index 9e3b9036b75a..853254846f30 100644
--- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c
+++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c
@@ -22,7 +22,7 @@
} \
}
-static struct mvpp2_cls_flow cls_flows[MVPP2_N_FLOWS] = {
+static struct mvpp2_cls_flow cls_flows[MVPP2_N_PRS_FLOWS] = {
/* TCP over IPv4 flows, Not fragmented, no vlan tag */
MVPP2_DEF_FLOW(TCP_V4_FLOW, MVPP2_FL_IP4_TCP_NF_UNTAG,
MVPP22_CLS_HEK_IP4_5T,
@@ -599,7 +599,7 @@ static int mvpp2_flow_set_hek_fields(struct mvpp2_cls_flow_entry *fe,
struct mvpp2_cls_flow *mvpp2_cls_flow_get(int flow)
{
- if (flow >= MVPP2_N_FLOWS)
+ if (flow >= MVPP2_N_PRS_FLOWS)
return NULL;
return &cls_flows[flow];
@@ -624,7 +624,7 @@ static int mvpp2_port_rss_hash_opts_set(struct mvpp2_port *port, int flow_type,
int i, engine, flow_index;
u16 hash_opts;
- for (i = 0; i < MVPP2_N_FLOWS; i++) {
+ for (i = 0; i < MVPP2_N_PRS_FLOWS; i++) {
flow = mvpp2_cls_flow_get(i);
if (!flow)
return -EINVAL;
@@ -713,7 +713,7 @@ static u16 mvpp2_port_rss_hash_opts_get(struct mvpp2_port *port, int flow_type)
int i, flow_index;
u16 hash_opts = 0;
- for (i = 0; i < MVPP2_N_FLOWS; i++) {
+ for (i = 0; i < MVPP2_N_PRS_FLOWS; i++) {
flow = mvpp2_cls_flow_get(i);
if (!flow)
return 0;
@@ -737,7 +737,7 @@ static void mvpp2_cls_port_init_flows(struct mvpp2 *priv)
struct mvpp2_cls_flow *flow;
int i;
- for (i = 0; i < MVPP2_N_FLOWS; i++) {
+ for (i = 0; i < MVPP2_N_PRS_FLOWS; i++) {
flow = mvpp2_cls_flow_get(i);
if (!flow)
break;
diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.h b/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.h
index 9ffbb4f4675d..22d7d9a587b0 100644
--- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.h
+++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.h
@@ -169,6 +169,8 @@ enum mvpp2_cls_lu_type {
/* LU Type defined for all engines, and specified in the flow table */
#define MVPP2_CLS_LU_TYPE_MASK 0x3f
+#define MVPP2_N_FLOWS (MVPP2_FL_LAST - MVPP2_FL_START)
+
struct mvpp2_cls_flow {
/* The L2-L4 traffic flow type */
int flow_type;
@@ -183,7 +185,6 @@ struct mvpp2_cls_flow {
struct mvpp2_prs_result_info prs_ri;
};
-#define MVPP2_N_FLOWS 52
#define MVPP2_ENTRIES_PER_FLOW (MVPP2_MAX_PORTS + 1)
#define MVPP2_FLOW_C2_ENTRY(id) ((((id) - MVPP2_FL_START) * \
diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_debugfs.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_debugfs.c
index f9744a61e5dd..97e0ef130a61 100644
--- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_debugfs.c
+++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_debugfs.c
@@ -557,7 +557,7 @@ static int mvpp2_dbgfs_flow_init(struct dentry *parent, struct mvpp2 *priv)
if (!flow_dir)
return -ENOMEM;
- for (i = 0; i < MVPP2_N_FLOWS; i++) {
+ for (i = 0; i < MVPP2_N_PRS_FLOWS; i++) {
ret = mvpp2_dbgfs_flow_entry_init(flow_dir, priv, i);
if (ret)
return ret;
--
2.20.1
next prev parent reply other threads:[~2019-03-27 8:46 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-27 8:44 [PATCH net-next 00/18] net: mvpp2: Classifier updates and cleanups Maxime Chevallier
2019-03-27 8:44 ` [PATCH net-next 01/18] net: mvpp2: Don't use an int to store netdev_features_t Maxime Chevallier
2019-03-27 8:44 ` [PATCH net-next 02/18] net: mvpp2: cls: Add missing MAC_DA field extraction Maxime Chevallier
2019-03-27 8:44 ` [PATCH net-next 03/18] net: mvpp2: cls: Start cls flow entries from beginning of table Maxime Chevallier
2019-03-27 8:44 ` [PATCH net-next 04/18] net: mvpp2: cls: use Lookup Type in classification engines Maxime Chevallier
2019-03-27 8:44 ` Maxime Chevallier [this message]
2019-03-27 8:44 ` [PATCH net-next 06/18] net: mvpp2: cls: Make the flow definitions const Maxime Chevallier
2019-03-27 8:44 ` [PATCH net-next 07/18] net: mvpp2: debugfs: Store debugfs entries data in mvpp2 struct Maxime Chevallier
2019-03-27 8:44 ` [PATCH net-next 08/18] net: mvpp2: debugfs: Allow reading the flow table from debugfs Maxime Chevallier
2019-03-27 8:44 ` [PATCH net-next 09/18] net: mvpp2: debugfs: Allow reading the C2 engine " Maxime Chevallier
2019-03-27 8:44 ` [PATCH net-next 10/18] net: mvpp2: cls: Use iterators to go through the cls_table Maxime Chevallier
2019-03-27 8:44 ` [PATCH net-next 11/18] net: mvpp2: cls: Write C2 TCAM data last when writing a C2 entry Maxime Chevallier
2019-03-27 8:44 ` [PATCH net-next 12/18] net: mvpp2: cls: Move C2 read/write helpers around Maxime Chevallier
2019-03-27 8:44 ` [PATCH net-next 13/18] net: mvpp2: cls: Rename classifer per-port functions Maxime Chevallier
2019-03-27 8:44 ` [PATCH net-next 14/18] net: mvpp2: cls: Don't use the sequence attribute for classification Maxime Chevallier
2019-03-27 8:44 ` [PATCH net-next 15/18] net: mvpp2: cls: Rename the flow table macros Maxime Chevallier
2019-03-27 8:44 ` [PATCH net-next 16/18] net: mvpp2: cls: Invalidate all C2 entries except the ones we use Maxime Chevallier
2019-03-27 8:44 ` [PATCH net-next 17/18] net: mvpp2: cls: Initialize lookup priorities for all entries in the flow Maxime Chevallier
2019-03-27 8:44 ` [PATCH net-next 18/18] net: mvpp2: cls: Rework C2 engine macros Maxime Chevallier
2019-03-27 18:11 ` [PATCH net-next 00/18] net: mvpp2: Classifier updates and cleanups David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190327084422.4209-6-maxime.chevallier@bootlin.com \
--to=maxime.chevallier@bootlin.com \
--cc=antoine.tenart@bootlin.com \
--cc=davem@davemloft.net \
--cc=gregory.clement@bootlin.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=miquel.raynal@bootlin.com \
--cc=mw@semihalf.com \
--cc=nadavh@marvell.com \
--cc=netdev@vger.kernel.org \
--cc=stefanc@marvell.com \
--cc=thomas.petazzoni@bootlin.com \
--cc=ymarkman@marvell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®