Skip to content

Commit

Permalink
net: mvpp2: cls: Use a dedicated lu_type for the RSS lookup
Browse files Browse the repository at this point in the history
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 <maxime.chevallier@bootlin.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Maxime Chevallier authored and David S. Miller committed Jun 19, 2019
1 parent 9368b8e commit c641af4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++)
Expand Down Expand Up @@ -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);
Expand Down
5 changes: 5 additions & 0 deletions drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit c641af4

Please sign in to comment.