Skip to contentSkip to conversation

net: mvpp2: Add classification based on the ETHER flow

PATCH In review Maxime Chevallier 3 participants 5 messages Jul 5, 2019 – Jul 8, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover net: mvpp2: Add classification based on the ETHER flow

Hello everyone,

This series adds support for classification of the ETHER flow in the mvpp2 driver.

The first patch allows detecting when a user specifies a flow_type that isn't supported by the driver, while the second adds support for this flow_type by adding the mapping between the ETHER_FLOW enum value and the relevant classifier flow entries.

Thanks,

Maxime

Maxime Chevallier (2):
net: mvpp2: cls: Report an error for unsupported flow types
net: mvpp2: cls: Add support for ETHER_FLOW

 drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c | 6 ++++++
 1 file changed, 6 insertions(+)
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/2 net: mvpp2: cls: Report an error for unsupported flow types

Add a missing check to detect flow types that we don't support, so that user can be informed of this.

---
 drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c +4 -0
index b195fb5d61f4..6c088c903c15 100644
@@ -1373,6 +1373,10 @@ int mvpp2_ethtool_cls_rule_ins(struct mvpp2_port *port,
 
 	efs->rule.flow = ethtool_rule->rule;
 	efs->rule.flow_type = mvpp2_cls_ethtool_flow_to_type(info->fs.flow_type);
+	if (efs->rule.flow_type < 0) {
+		ret = efs->rule.flow_type;
+		goto clean_rule;
+	}
 
 	ret = mvpp2_cls_rfs_parse_rule(&efs->rule);
 	if (ret)
Signature · 1 line
2.20.1
#2 lore raw

PATCH 2/2 net: mvpp2: cls: Add support for ETHER_FLOW

In reply to Maxime Chevallier

Users can specify classification actions based on the 'ether' flow type. In that case, this will apply to all ethernet traffic, superseeding flows such as 'udp4' or 'tcp6'.

Add support for this flow type in the PPv2 classifier, by mapping the ETHER_FLOW value to the corresponding entries in the classifier.

---
 drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c +2 -0
index 6c088c903c15..35478cba2aa5 100644
@@ -548,6 +548,8 @@ void mvpp2_cls_c2_read(struct mvpp2 *priv, int index,
 static int mvpp2_cls_ethtool_flow_to_type(int flow_type)
 {
 	switch (flow_type & ~(FLOW_EXT | FLOW_MAC_EXT | FLOW_RSS)) {
+	case ETHER_FLOW:
+		return MVPP22_FLOW_ETHERNET;
 	case TCP_V4_FLOW:
 		return MVPP22_FLOW_TCP4;
 	case TCP_V6_FLOW:
Signature · 1 line
2.20.1
#3 lore raw
In reply to Maxime Chevallier
Quoted 9 lines · Maxime Chevallier

Hello everyone,

This series adds support for classification of the ETHER flow in the mvpp2 driver.

The first patch allows detecting when a user specifies a flow_type that isn't supported by the driver, while the second adds support for this flow_type by adding the mapping between the ETHER_FLOW enum value and the relevant classifier flow entries.

LGTM

maintainer
#4 lore raw
In reply to Maxime Chevallier

From: Maxime Chevallier <[email protected]>
Date: Fri, 5 Jul 2019 14:09:11 +0200

Quoted 9 lines

Hello everyone,

This series adds support for classification of the ETHER flow in the mvpp2 driver.

The first patch allows detecting when a user specifies a flow_type that isn't supported by the driver, while the second adds support for this flow_type by adding the mapping between the ETHER_FLOW enum value and the relevant classifier flow entries.

Series applied, thanks.