diff options
author | Felix Fietkau <nbd@nbd.name> | 2018-03-12 20:51:55 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2018-04-05 18:12:30 +0200 |
commit | 11a3d270436137fa485257eab8153ce5d307cfa7 (patch) | |
tree | 360d1f8ccb4a4688f983da7a854a44c945e542fe /target/linux/generic/pending-4.14/643-net-bridge-support-hardware-flow-table-offload.patch | |
parent | f8dbafb234c9a0a836ff3bede0540c20914b6d4e (diff) | |
download | upstream-11a3d270436137fa485257eab8153ce5d307cfa7.tar.gz upstream-11a3d270436137fa485257eab8153ce5d307cfa7.tar.bz2 upstream-11a3d270436137fa485257eab8153ce5d307cfa7.zip |
kernel: add hardware offload patch for flow tables support
Supports offloading through VLAN, bridge and PPPoE devices as well
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'target/linux/generic/pending-4.14/643-net-bridge-support-hardware-flow-table-offload.patch')
-rw-r--r-- | target/linux/generic/pending-4.14/643-net-bridge-support-hardware-flow-table-offload.patch | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/target/linux/generic/pending-4.14/643-net-bridge-support-hardware-flow-table-offload.patch b/target/linux/generic/pending-4.14/643-net-bridge-support-hardware-flow-table-offload.patch new file mode 100644 index 0000000000..3158714f54 --- /dev/null +++ b/target/linux/generic/pending-4.14/643-net-bridge-support-hardware-flow-table-offload.patch @@ -0,0 +1,55 @@ +From: Felix Fietkau <nbd@nbd.name> +Date: Thu, 15 Mar 2018 20:50:37 +0100 +Subject: [PATCH] net: bridge: support hardware flow table offload + +Look up the real device and pass it on + +Signed-off-by: Felix Fietkau <nbd@nbd.name> +--- + +--- a/net/bridge/br_device.c ++++ b/net/bridge/br_device.c +@@ -18,6 +18,8 @@ + #include <linux/ethtool.h> + #include <linux/list.h> + #include <linux/netfilter_bridge.h> ++#include <linux/netfilter.h> ++#include <net/netfilter/nf_flow_table.h> + + #include <linux/uaccess.h> + #include "br_private.h" +@@ -340,6 +342,26 @@ static const struct ethtool_ops br_ethto + .get_link = ethtool_op_get_link, + }; + ++static int br_flow_offload_check(struct flow_offload_hw_path *path) ++{ ++ struct net_device *dev = path->dev; ++ struct net_bridge *br = netdev_priv(dev); ++ struct net_bridge_fdb_entry *dst; ++ ++ if (!(path->flags & FLOW_OFFLOAD_PATH_ETHERNET)) ++ return -EINVAL; ++ ++ dst = br_fdb_find_rcu(br, path->eth_dest, path->vlan_id); ++ if (!dst || !dst->dst) ++ return -ENOENT; ++ ++ path->dev = dst->dst->dev; ++ if (path->dev->netdev_ops->ndo_flow_offload_check) ++ return path->dev->netdev_ops->ndo_flow_offload_check(path); ++ ++ return 0; ++} ++ + static const struct net_device_ops br_netdev_ops = { + .ndo_open = br_dev_open, + .ndo_stop = br_dev_stop, +@@ -367,6 +389,7 @@ static const struct net_device_ops br_ne + .ndo_bridge_setlink = br_setlink, + .ndo_bridge_dellink = br_dellink, + .ndo_features_check = passthru_features_check, ++ .ndo_flow_offload_check = br_flow_offload_check, + }; + + static struct device_type br_type = { |