OSDN Git Service

net: mvpp2: cls: Rename MVPP2_N_FLOWS to MVPP2_N_PRS_FLOWS
authorMaxime Chevallier <maxime.chevallier@bootlin.com>
Wed, 27 Mar 2019 08:44:09 +0000 (09:44 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 27 Mar 2019 18:10:57 +0000 (11:10 -0700)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/mvpp2/mvpp2.h
drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c
drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.h
drivers/net/ethernet/marvell/mvpp2/mvpp2_debugfs.c

index 1356fc4..6220284 100644 (file)
 #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
 
index 9e3b903..8532548 100644 (file)
@@ -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;
index 9ffbb4f..22d7d9a 100644 (file)
@@ -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) * \
index f9744a6..97e0ef1 100644 (file)
@@ -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;