Commit 96521683 authored by David S. Miller's avatar David S. Miller

Merge branch 'mtk_ppe_offload-fixes'

Pablo Neira Ayuso says:

====================
mtk_ppe_offload fixes

A few incremental fixes for the initial flowtable offload support
and this driver:

1) Fix undefined reference to `dsa_port_from_netdev' due to missing
   dependencies in Kconfig, reported by Kbuild robot.

2) Missing mutex to serialize flow events via workqueue to the driver.

3) Handle FLOW_ACTION_VLAN_POP tag action.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 6dd06ec7 f5c2cb58
......@@ -9,6 +9,7 @@ if NET_VENDOR_MEDIATEK
config NET_MEDIATEK_SOC
tristate "MediaTek SoC Gigabit Ethernet support"
depends on NET_DSA || !NET_DSA
select PHYLINK
help
This driver supports the gigabit ethernet MACs in the
......
......@@ -232,6 +232,8 @@ mtk_flow_offload_replace(struct mtk_eth *eth, struct flow_cls_offload *f)
data.vlan.proto = act->vlan.proto;
data.vlan.num++;
break;
case FLOW_ACTION_VLAN_POP:
break;
case FLOW_ACTION_PPPOE_PUSH:
if (data.pppoe.num == 1)
return -EOPNOTSUPP;
......@@ -391,6 +393,8 @@ mtk_flow_offload_stats(struct mtk_eth *eth, struct flow_cls_offload *f)
return 0;
}
static DEFINE_MUTEX(mtk_flow_offload_mutex);
static int
mtk_eth_setup_tc_block_cb(enum tc_setup_type type, void *type_data, void *cb_priv)
{
......@@ -398,6 +402,7 @@ mtk_eth_setup_tc_block_cb(enum tc_setup_type type, void *type_data, void *cb_pri
struct net_device *dev = cb_priv;
struct mtk_mac *mac = netdev_priv(dev);
struct mtk_eth *eth = mac->hw;
int err;
if (!tc_can_offload(dev))
return -EOPNOTSUPP;
......@@ -405,18 +410,24 @@ mtk_eth_setup_tc_block_cb(enum tc_setup_type type, void *type_data, void *cb_pri
if (type != TC_SETUP_CLSFLOWER)
return -EOPNOTSUPP;
mutex_lock(&mtk_flow_offload_mutex);
switch (cls->command) {
case FLOW_CLS_REPLACE:
return mtk_flow_offload_replace(eth, cls);
err = mtk_flow_offload_replace(eth, cls);
break;
case FLOW_CLS_DESTROY:
return mtk_flow_offload_destroy(eth, cls);
err = mtk_flow_offload_destroy(eth, cls);
break;
case FLOW_CLS_STATS:
return mtk_flow_offload_stats(eth, cls);
err = mtk_flow_offload_stats(eth, cls);
break;
default:
return -EOPNOTSUPP;
err = -EOPNOTSUPP;
break;
}
mutex_unlock(&mtk_flow_offload_mutex);
return 0;
return err;
}
static int
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment