linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] net: mvpp2: Add classification based on the ETHER flow
@ 2019-07-05 12:09 Maxime Chevallier
  2019-07-05 12:09 ` [PATCH net-next 1/2] net: mvpp2: cls: Report an error for unsupported flow types Maxime Chevallier
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Maxime Chevallier @ 2019-07-05 12:09 UTC (permalink / raw)
  To: davem
  Cc: Maxime Chevallier, netdev, linux-kernel, linux-arm-kernel,
	Antoine Tenart, thomas.petazzoni, gregory.clement, miquel.raynal,
	nadavh, stefanc, mw

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(+)

-- 
2.20.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH net-next 1/2] net: mvpp2: cls: Report an error for unsupported flow types
  2019-07-05 12:09 [PATCH net-next 0/2] net: mvpp2: Add classification based on the ETHER flow Maxime Chevallier
@ 2019-07-05 12:09 ` Maxime Chevallier
  2019-07-05 12:09 ` [PATCH net-next 2/2] net: mvpp2: cls: Add support for ETHER_FLOW Maxime Chevallier
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Maxime Chevallier @ 2019-07-05 12:09 UTC (permalink / raw)
  To: davem
  Cc: Maxime Chevallier, netdev, linux-kernel, linux-arm-kernel,
	Antoine Tenart, thomas.petazzoni, gregory.clement, miquel.raynal,
	nadavh, stefanc, mw

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

Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
---
 drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c
index b195fb5d61f4..6c088c903c15 100644
--- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c
+++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c
@@ -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)
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH net-next 2/2] net: mvpp2: cls: Add support for ETHER_FLOW
  2019-07-05 12:09 [PATCH net-next 0/2] net: mvpp2: Add classification based on the ETHER flow Maxime Chevallier
  2019-07-05 12:09 ` [PATCH net-next 1/2] net: mvpp2: cls: Report an error for unsupported flow types Maxime Chevallier
@ 2019-07-05 12:09 ` Maxime Chevallier
  2019-07-05 21:49 ` [PATCH net-next 0/2] net: mvpp2: Add classification based on the ETHER flow Jakub Kicinski
  2019-07-08 22:50 ` David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: Maxime Chevallier @ 2019-07-05 12:09 UTC (permalink / raw)
  To: davem
  Cc: Maxime Chevallier, netdev, linux-kernel, linux-arm-kernel,
	Antoine Tenart, thomas.petazzoni, gregory.clement, miquel.raynal,
	nadavh, stefanc, mw

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.

Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
---
 drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c
index 6c088c903c15..35478cba2aa5 100644
--- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c
+++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c
@@ -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:
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next 0/2] net: mvpp2: Add classification based on the ETHER flow
  2019-07-05 12:09 [PATCH net-next 0/2] net: mvpp2: Add classification based on the ETHER flow Maxime Chevallier
  2019-07-05 12:09 ` [PATCH net-next 1/2] net: mvpp2: cls: Report an error for unsupported flow types Maxime Chevallier
  2019-07-05 12:09 ` [PATCH net-next 2/2] net: mvpp2: cls: Add support for ETHER_FLOW Maxime Chevallier
@ 2019-07-05 21:49 ` Jakub Kicinski
  2019-07-08 22:50 ` David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: Jakub Kicinski @ 2019-07-05 21:49 UTC (permalink / raw)
  To: Maxime Chevallier
  Cc: davem, netdev, linux-kernel, linux-arm-kernel, Antoine Tenart,
	thomas.petazzoni, gregory.clement, miquel.raynal, nadavh,
	stefanc, mw

On Fri,  5 Jul 2019 14:09:11 +0200, Maxime Chevallier wrote:
> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net-next 0/2] net: mvpp2: Add classification based on the ETHER flow
  2019-07-05 12:09 [PATCH net-next 0/2] net: mvpp2: Add classification based on the ETHER flow Maxime Chevallier
                   ` (2 preceding siblings ...)
  2019-07-05 21:49 ` [PATCH net-next 0/2] net: mvpp2: Add classification based on the ETHER flow Jakub Kicinski
@ 2019-07-08 22:50 ` David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2019-07-08 22:50 UTC (permalink / raw)
  To: maxime.chevallier
  Cc: netdev, linux-kernel, linux-arm-kernel, antoine.tenart,
	thomas.petazzoni, gregory.clement, miquel.raynal, nadavh,
	stefanc, mw

From: Maxime Chevallier <maxime.chevallier@bootlin.com>
Date: Fri,  5 Jul 2019 14:09:11 +0200

> 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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-07-08 22:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-05 12:09 [PATCH net-next 0/2] net: mvpp2: Add classification based on the ETHER flow Maxime Chevallier
2019-07-05 12:09 ` [PATCH net-next 1/2] net: mvpp2: cls: Report an error for unsupported flow types Maxime Chevallier
2019-07-05 12:09 ` [PATCH net-next 2/2] net: mvpp2: cls: Add support for ETHER_FLOW Maxime Chevallier
2019-07-05 21:49 ` [PATCH net-next 0/2] net: mvpp2: Add classification based on the ETHER flow Jakub Kicinski
2019-07-08 22:50 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).