aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/pending-4.14/642-net-8021q-support-hardware-flow-table-offload.patch
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2018-03-12 20:51:55 +0100
committerFelix Fietkau <nbd@nbd.name>2018-04-05 18:12:30 +0200
commit11a3d270436137fa485257eab8153ce5d307cfa7 (patch)
tree360d1f8ccb4a4688f983da7a854a44c945e542fe /target/linux/generic/pending-4.14/642-net-8021q-support-hardware-flow-table-offload.patch
parentf8dbafb234c9a0a836ff3bede0540c20914b6d4e (diff)
downloadupstream-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/642-net-8021q-support-hardware-flow-table-offload.patch')
-rw-r--r--target/linux/generic/pending-4.14/642-net-8021q-support-hardware-flow-table-offload.patch56
1 files changed, 56 insertions, 0 deletions
diff --git a/target/linux/generic/pending-4.14/642-net-8021q-support-hardware-flow-table-offload.patch b/target/linux/generic/pending-4.14/642-net-8021q-support-hardware-flow-table-offload.patch
new file mode 100644
index 0000000000..cda2e0ffd4
--- /dev/null
+++ b/target/linux/generic/pending-4.14/642-net-8021q-support-hardware-flow-table-offload.patch
@@ -0,0 +1,56 @@
+From: Felix Fietkau <nbd@nbd.name>
+Date: Thu, 15 Mar 2018 20:49:58 +0100
+Subject: [PATCH] net: 8021q: support hardware flow table offload
+
+Add the VLAN ID and protocol information
+
+Signed-off-by: Felix Fietkau <nbd@nbd.name>
+---
+
+--- a/net/8021q/vlan_dev.c
++++ b/net/8021q/vlan_dev.c
+@@ -29,8 +29,10 @@
+ #include <linux/net_tstamp.h>
+ #include <linux/etherdevice.h>
+ #include <linux/ethtool.h>
++#include <linux/netfilter.h>
+ #include <net/arp.h>
+ #include <net/switchdev.h>
++#include <net/netfilter/nf_flow_table.h>
+
+ #include "vlan.h"
+ #include "vlanproc.h"
+@@ -762,6 +764,25 @@ static int vlan_dev_get_iflink(const str
+ return real_dev->ifindex;
+ }
+
++static int vlan_dev_flow_offload_check(struct flow_offload_hw_path *path)
++{
++ struct net_device *dev = path->dev;
++ struct vlan_dev_priv *vlan = vlan_dev_priv(dev);
++
++ if (path->flags & FLOW_OFFLOAD_PATH_VLAN)
++ return -EEXIST;
++
++ path->flags |= FLOW_OFFLOAD_PATH_VLAN;
++ path->vlan_proto = vlan->vlan_proto;
++ path->vlan_id = vlan->vlan_id;
++ path->dev = vlan->real_dev;
++
++ if (vlan->real_dev->netdev_ops->ndo_flow_offload_check)
++ return vlan->real_dev->netdev_ops->ndo_flow_offload_check(path);
++
++ return 0;
++}
++
+ static const struct ethtool_ops vlan_ethtool_ops = {
+ .get_link_ksettings = vlan_ethtool_get_link_ksettings,
+ .get_drvinfo = vlan_ethtool_get_drvinfo,
+@@ -799,6 +820,7 @@ static const struct net_device_ops vlan_
+ .ndo_fix_features = vlan_dev_fix_features,
+ .ndo_get_lock_subclass = vlan_dev_get_lock_subclass,
+ .ndo_get_iflink = vlan_dev_get_iflink,
++ .ndo_flow_offload_check = vlan_dev_flow_offload_check,
+ };
+
+ static void vlan_dev_free(struct net_device *dev)