1 --- a/include/linux/if_bridge.h
2 +++ b/include/linux/if_bridge.h
3 @@ -59,6 +59,7 @@ struct br_ip_list {
4 #define BR_MRP_LOST_IN_CONT BIT(19)
5 #define BR_TX_FWD_OFFLOAD BIT(20)
6 #define BR_BPDU_FILTER BIT(21)
7 +#define BR_OFFLOAD BIT(22)
9 #define BR_DEFAULT_AGEING_TIME (300 * HZ)
11 --- a/net/bridge/Makefile
12 +++ b/net/bridge/Makefile
15 obj-$(CONFIG_BRIDGE) += bridge.o
17 -bridge-y := br.o br_device.o br_fdb.o br_forward.o br_if.o br_input.o \
18 +bridge-y := br.o br_device.o br_fdb.o br_forward.o br_if.o br_input.o br_offload.o \
19 br_ioctl.o br_stp.o br_stp_bpdu.o \
20 br_stp_if.o br_stp_timer.o br_netlink.o \
21 br_netlink_tunnel.o br_arp_nd_proxy.o
25 #include <net/switchdev.h>
27 #include "br_private.h"
28 +#include "br_private_offload.h"
31 * Handle changes in state of network devices enslaved to a bridge.
32 @@ -381,6 +382,10 @@ static int __init br_init(void)
36 + err = br_offload_init();
40 err = register_pernet_subsys(&br_net_ops);
43 @@ -430,6 +435,8 @@ err_out3:
45 unregister_pernet_subsys(&br_net_ops);
51 stp_proto_unregister(&br_stp_proto);
52 @@ -452,6 +459,7 @@ static void __exit br_deinit(void)
53 #if IS_ENABLED(CONFIG_ATM_LANE)
54 br_fdb_test_addr_hook = NULL;
60 --- a/net/bridge/br_device.c
61 +++ b/net/bridge/br_device.c
62 @@ -524,6 +524,8 @@ void br_dev_setup(struct net_device *dev
63 br->bridge_hello_time = br->hello_time = 2 * HZ;
64 br->bridge_forward_delay = br->forward_delay = 15 * HZ;
65 br->bridge_ageing_time = br->ageing_time = BR_DEFAULT_AGEING_TIME;
66 + br->offload_cache_size = 128;
67 + br->offload_cache_reserved = 8;
68 dev->max_mtu = ETH_MAX_MTU;
70 br_netfilter_rtable_init(br);
71 --- a/net/bridge/br_fdb.c
72 +++ b/net/bridge/br_fdb.c
74 #include <net/switchdev.h>
75 #include <trace/events/bridge.h>
76 #include "br_private.h"
77 +#include "br_private_offload.h"
79 static const struct rhashtable_params br_fdb_rht_params = {
80 .head_offset = offsetof(struct net_bridge_fdb_entry, rhnode),
81 @@ -518,6 +519,8 @@ static struct net_bridge_fdb_entry *fdb_
82 fdb->key.vlan_id = vid;
84 fdb->updated = fdb->used = jiffies;
85 + INIT_HLIST_HEAD(&fdb->offload_in);
86 + INIT_HLIST_HEAD(&fdb->offload_out);
87 if (rhashtable_lookup_insert_fast(&br->fdb_hash_tbl,
90 @@ -794,6 +797,8 @@ static void fdb_notify(struct net_bridge
94 + br_offload_fdb_update(fdb);
97 br_switchdev_fdb_notify(br, fdb, type);
99 --- a/net/bridge/br_forward.c
100 +++ b/net/bridge/br_forward.c
102 #include <linux/if_vlan.h>
103 #include <linux/netfilter_bridge.h>
104 #include "br_private.h"
105 +#include "br_private_offload.h"
107 /* Don't forward packets to originating port or forwarding disabled */
108 static inline int should_deliver(const struct net_bridge_port *p,
109 @@ -32,6 +33,8 @@ static inline int should_deliver(const s
111 int br_dev_queue_push_xmit(struct net *net, struct sock *sk, struct sk_buff *skb)
113 + br_offload_output(skb);
115 skb_push(skb, ETH_HLEN);
116 if (!is_skb_forwardable(skb->dev, skb))
118 --- a/net/bridge/br_if.c
119 +++ b/net/bridge/br_if.c
121 #include <net/net_namespace.h>
123 #include "br_private.h"
124 +#include "br_private_offload.h"
127 * Determine initial path cost based on speed.
128 @@ -428,7 +429,7 @@ static struct net_bridge_port *new_nbp(s
129 p->path_cost = port_cost(dev);
130 p->priority = 0x8000 >> BR_PORT_BITS;
132 - p->flags = BR_LEARNING | BR_FLOOD | BR_MCAST_FLOOD | BR_BCAST_FLOOD;
133 + p->flags = BR_LEARNING | BR_FLOOD | BR_MCAST_FLOOD | BR_BCAST_FLOOD | BR_OFFLOAD;
135 br_set_state(p, BR_STATE_DISABLED);
136 br_stp_port_timer_init(p);
137 @@ -771,6 +772,9 @@ void br_port_flags_change(struct net_bri
139 if (mask & BR_NEIGH_SUPPRESS)
140 br_recalculate_neigh_suppress_enabled(br);
142 + if (mask & BR_OFFLOAD)
143 + br_offload_port_state(p);
146 bool br_port_flag_is_set(const struct net_device *dev, unsigned long flag)
147 --- a/net/bridge/br_input.c
148 +++ b/net/bridge/br_input.c
150 #include <linux/rculist.h>
151 #include "br_private.h"
152 #include "br_private_tunnel.h"
153 +#include "br_private_offload.h"
156 br_netif_receive_skb(struct net *net, struct sock *sk, struct sk_buff *skb)
157 @@ -164,6 +165,7 @@ int br_handle_frame_finish(struct net *n
159 br_forward(dst->dst, skb, local_rcv, false);
161 + br_offload_skb_disable(skb);
163 br_flood(br, skb, pkt_type, local_rcv, false);
165 @@ -297,6 +299,9 @@ static rx_handler_result_t br_handle_fra
166 memset(skb->cb, 0, sizeof(struct br_input_skb_cb));
168 p = br_port_get_rcu(skb->dev);
169 + if (br_offload_input(p, skb))
170 + return RX_HANDLER_CONSUMED;
172 if (p->flags & BR_VLAN_TUNNEL)
173 br_handle_ingress_vlan_tunnel(skb, p, nbp_vlan_group_rcu(p));
176 +++ b/net/bridge/br_offload.c
178 +// SPDX-License-Identifier: GPL-2.0-only
179 +#include <linux/kernel.h>
180 +#include <linux/workqueue.h>
181 +#include "br_private.h"
182 +#include "br_private_offload.h"
184 +static DEFINE_SPINLOCK(offload_lock);
186 +struct bridge_flow_key {
189 +#ifdef CONFIG_BRIDGE_VLAN_FILTERING
195 +struct bridge_flow {
196 + struct net_bridge_port *port;
197 + struct rhash_head node;
198 + struct bridge_flow_key key;
199 +#ifdef CONFIG_BRIDGE_VLAN_FILTERING
200 + bool vlan_out_present;
204 + unsigned long used;
205 + struct net_bridge_fdb_entry *fdb_in, *fdb_out;
206 + struct hlist_node fdb_list_in, fdb_list_out;
208 + struct rcu_head rcu;
211 +static const struct rhashtable_params flow_params = {
212 + .automatic_shrinking = true,
213 + .head_offset = offsetof(struct bridge_flow, node),
214 + .key_len = sizeof(struct bridge_flow_key),
215 + .key_offset = offsetof(struct bridge_flow, key),
218 +static struct kmem_cache *offload_cache __read_mostly;
221 +flow_rcu_free(struct rcu_head *head)
223 + struct bridge_flow *flow;
225 + flow = container_of(head, struct bridge_flow, rcu);
226 + kmem_cache_free(offload_cache, flow);
230 +__br_offload_flow_free(struct bridge_flow *flow)
233 + hlist_del(&flow->fdb_list_in);
234 + hlist_del(&flow->fdb_list_out);
236 + call_rcu(&flow->rcu, flow_rcu_free);
240 +br_offload_flow_free(struct bridge_flow *flow)
242 + if (rhashtable_remove_fast(&flow->port->offload.rht, &flow->node,
246 + __br_offload_flow_free(flow);
250 +br_offload_flow_fdb_refresh_time(struct bridge_flow *flow,
251 + struct net_bridge_fdb_entry *fdb)
253 + if (!time_after(flow->used, fdb->updated))
256 + fdb->updated = flow->used;
263 +br_offload_flow_refresh_time(struct bridge_flow *flow)
265 + br_offload_flow_fdb_refresh_time(flow, flow->fdb_in);
266 + br_offload_flow_fdb_refresh_time(flow, flow->fdb_out);
270 +br_offload_destroy_cb(void *ptr, void *arg)
272 + struct bridge_flow *flow = ptr;
274 + __br_offload_flow_free(flow);
278 +br_offload_need_gc(struct net_bridge_port *p)
280 + return (atomic_read(&p->offload.rht.nelems) +
281 + p->br->offload_cache_reserved) >= p->br->offload_cache_size;
285 +br_offload_gc_work(struct work_struct *work)
287 + struct rhashtable_iter hti;
288 + struct net_bridge_port *p;
289 + struct bridge_flow *gc_flow = NULL;
290 + struct bridge_flow *flow;
291 + unsigned long gc_used;
293 + p = container_of(work, struct net_bridge_port, offload.gc_work);
295 + if (!br_offload_need_gc(p))
298 + rhashtable_walk_enter(&p->offload.rht, &hti);
299 + rhashtable_walk_start(&hti);
300 + while ((flow = rhashtable_walk_next(&hti)) != NULL) {
301 + unsigned long used;
306 + used = READ_ONCE(flow->used);
310 + if (gc_flow && !time_before(used, gc_used))
316 + rhashtable_walk_stop(&hti);
317 + rhashtable_walk_exit(&hti);
322 + spin_lock_bh(&offload_lock);
323 + if (br_offload_need_gc(p) && gc_flow &&
324 + gc_flow->used == gc_used)
325 + br_offload_flow_free(gc_flow);
326 + if (p->offload.enabled && br_offload_need_gc(p))
327 + queue_work(system_long_wq, work);
328 + spin_unlock_bh(&offload_lock);
332 +void br_offload_port_state(struct net_bridge_port *p)
334 + struct net_bridge_port_offload *o = &p->offload;
335 + bool enabled = true;
336 + bool flush = false;
338 + if (p->state != BR_STATE_FORWARDING ||
339 + !(p->flags & BR_OFFLOAD))
342 + spin_lock_bh(&offload_lock);
343 + if (o->enabled == enabled)
347 + if (!o->gc_work.func)
348 + INIT_WORK(&o->gc_work, br_offload_gc_work);
349 + rhashtable_init(&o->rht, &flow_params);
352 + rhashtable_free_and_destroy(&o->rht, br_offload_destroy_cb, o);
355 + o->enabled = enabled;
358 + spin_unlock_bh(&offload_lock);
361 + flush_work(&o->gc_work);
364 +void br_offload_fdb_update(const struct net_bridge_fdb_entry *fdb)
366 + struct bridge_flow *f;
367 + struct hlist_node *tmp;
369 + spin_lock_bh(&offload_lock);
371 + hlist_for_each_entry_safe(f, tmp, &fdb->offload_in, fdb_list_in)
372 + br_offload_flow_free(f);
374 + hlist_for_each_entry_safe(f, tmp, &fdb->offload_out, fdb_list_out)
375 + br_offload_flow_free(f);
377 + spin_unlock_bh(&offload_lock);
381 +br_offload_prepare_key(struct net_bridge_port *p, struct bridge_flow_key *key,
382 + struct sk_buff *skb)
384 + memset(key, 0, sizeof(*key));
385 + memcpy(key, eth_hdr(skb), 2 * ETH_ALEN);
386 +#ifdef CONFIG_BRIDGE_VLAN_FILTERING
387 + if (!br_opt_get(p->br, BROPT_VLAN_ENABLED))
390 + if (!skb_vlan_tag_present(skb) || skb->vlan_proto != p->br->vlan_proto)
393 + key->vlan_present = true;
394 + key->vlan_tag = skb_vlan_tag_get_id(skb);
398 +void br_offload_output(struct sk_buff *skb)
400 + struct net_bridge_port_offload *o;
401 + struct br_input_skb_cb *cb = (struct br_input_skb_cb *)skb->cb;
402 + struct net_bridge_port *p, *inp;
403 + struct net_device *dev;
404 + struct net_bridge_fdb_entry *fdb_in, *fdb_out;
405 + struct net_bridge_vlan_group *vg;
406 + struct bridge_flow_key key;
407 + struct bridge_flow *flow;
415 + p = br_port_get_rcu(skb->dev);
423 + if (atomic_read(&p->offload.rht.nelems) >= p->br->offload_cache_size)
426 + dev = dev_get_by_index_rcu(dev_net(p->br->dev), cb->input_ifindex);
430 + inp = br_port_get_rcu(dev);
434 + vg = nbp_vlan_group_rcu(inp);
435 + vlan = cb->input_vlan_present ? cb->input_vlan_tag : br_get_pvid(vg);
436 + fdb_in = br_fdb_find_rcu(p->br, eth_hdr(skb)->h_source, vlan);
440 + vg = nbp_vlan_group_rcu(p);
441 + vlan = skb_vlan_tag_present(skb) ? skb_vlan_tag_get_id(skb) : br_get_pvid(vg);
442 + fdb_out = br_fdb_find_rcu(p->br, eth_hdr(skb)->h_dest, vlan);
446 + br_offload_prepare_key(p, &key, skb);
447 +#ifdef CONFIG_BRIDGE_VLAN_FILTERING
448 + key.vlan_present = cb->input_vlan_present;
449 + key.vlan_tag = cb->input_vlan_tag;
452 + flow = kmem_cache_alloc(offload_cache, GFP_ATOMIC);
453 + flow->port = fdb_in->dst;
454 + memcpy(&flow->key, &key, sizeof(key));
456 +#ifdef CONFIG_BRIDGE_VLAN_FILTERING
457 + flow->vlan_out_present = skb_vlan_tag_present(skb);
458 + flow->vlan_out = skb_vlan_tag_get(skb);
461 + flow->fdb_in = fdb_in;
462 + flow->fdb_out = fdb_out;
463 + flow->used = jiffies;
465 + spin_lock_bh(&offload_lock);
467 + atomic_read(&p->offload.rht.nelems) >= p->br->offload_cache_size ||
468 + rhashtable_insert_fast(&flow->port->offload.rht, &flow->node, flow_params)) {
469 + kmem_cache_free(offload_cache, flow);
473 + hlist_add_head(&flow->fdb_list_in, &fdb_in->offload_in);
474 + hlist_add_head(&flow->fdb_list_out, &fdb_out->offload_out);
476 + if (br_offload_need_gc(p))
477 + queue_work(system_long_wq, &p->offload.gc_work);
480 + spin_unlock_bh(&offload_lock);
486 +bool br_offload_input(struct net_bridge_port *p, struct sk_buff *skb)
488 + struct net_bridge_port_offload *o = &p->offload;
489 + struct br_input_skb_cb *cb = (struct br_input_skb_cb *)skb->cb;
490 + struct bridge_flow_key key;
491 + struct net_bridge_port *dst;
492 + struct bridge_flow *flow;
493 + unsigned long now = jiffies;
496 + if (skb->len < sizeof(key))
502 + if (is_multicast_ether_addr(eth_hdr(skb)->h_dest))
505 + br_offload_prepare_key(p, &key, skb);
508 + flow = rhashtable_lookup(&o->rht, &key, flow_params);
511 +#ifdef CONFIG_BRIDGE_VLAN_FILTERING
512 + cb->input_vlan_present = key.vlan_present != 0;
513 + cb->input_vlan_tag = key.vlan_tag;
514 + cb->input_ifindex = p->dev->ifindex;
519 + if (flow->fdb_in->dst != p)
522 + dst = flow->fdb_out->dst;
527 +#ifdef CONFIG_BRIDGE_VLAN_FILTERING
528 + if (!flow->vlan_out_present && key.vlan_present) {
529 + __vlan_hwaccel_clear_tag(skb);
530 + } else if (flow->vlan_out_present) {
531 + if (skb_vlan_tag_present(skb) &&
532 + skb->vlan_proto != p->br->vlan_proto) {
533 + /* Protocol-mismatch, empty out vlan_tci for new tag */
534 + skb_push(skb, ETH_HLEN);
535 + skb = vlan_insert_tag_set_proto(skb, skb->vlan_proto,
536 + skb_vlan_tag_get(skb));
537 + if (unlikely(!skb))
540 + skb_pull(skb, ETH_HLEN);
541 + skb_reset_mac_len(skb);
544 + __vlan_hwaccel_put_tag(skb, p->br->vlan_proto,
549 + skb->dev = dst->dev;
550 + skb_push(skb, ETH_HLEN);
552 + if (skb_warn_if_lro(skb) || !is_skb_forwardable(skb->dev, skb)) {
557 + if (now - flow->used >= HZ) {
559 + br_offload_flow_refresh_time(flow);
562 + skb_forward_csum(skb);
563 + dev_queue_xmit(skb);
571 +br_offload_check_gc(struct net_bridge *br)
573 + struct net_bridge_port *p;
575 + spin_lock_bh(&br->lock);
576 + list_for_each_entry(p, &br->port_list, list)
577 + if (br_offload_need_gc(p))
578 + queue_work(system_long_wq, &p->offload.gc_work);
579 + spin_unlock_bh(&br->lock);
583 +int br_offload_set_cache_size(struct net_bridge *br, unsigned long val,
584 + struct netlink_ext_ack *extack)
586 + br->offload_cache_size = val;
587 + br_offload_check_gc(br);
592 +int br_offload_set_cache_reserved(struct net_bridge *br, unsigned long val,
593 + struct netlink_ext_ack *extack)
595 + br->offload_cache_reserved = val;
596 + br_offload_check_gc(br);
601 +int __init br_offload_init(void)
603 + offload_cache = kmem_cache_create("bridge_offload_cache",
604 + sizeof(struct bridge_flow),
605 + 0, SLAB_HWCACHE_ALIGN, NULL);
606 + if (!offload_cache)
612 +void br_offload_fini(void)
614 + kmem_cache_destroy(offload_cache);
616 --- a/net/bridge/br_private.h
617 +++ b/net/bridge/br_private.h
618 @@ -268,7 +268,13 @@ struct net_bridge_fdb_entry {
619 unsigned long updated ____cacheline_aligned_in_smp;
622 - struct rcu_head rcu;
625 + struct hlist_head offload_in;
626 + struct hlist_head offload_out;
628 + struct rcu_head rcu;
632 #define MDB_PG_FLAGS_PERMANENT BIT(0)
633 @@ -343,6 +349,12 @@ struct net_bridge_mdb_entry {
637 +struct net_bridge_port_offload {
638 + struct rhashtable rht;
639 + struct work_struct gc_work;
643 struct net_bridge_port {
644 struct net_bridge *br;
645 struct net_device *dev;
646 @@ -403,6 +415,7 @@ struct net_bridge_port {
647 u16 backup_redirected_cnt;
649 struct bridge_stp_xstats stp_xstats;
650 + struct net_bridge_port_offload offload;
653 #define kobj_to_brport(obj) container_of(obj, struct net_bridge_port, kobj)
654 @@ -519,6 +532,9 @@ struct net_bridge {
655 struct kobject *ifobj;
658 + u32 offload_cache_size;
659 + u32 offload_cache_reserved;
661 #ifdef CONFIG_NET_SWITCHDEV
662 /* Counter used to make sure that hardware domains get unique
663 * identifiers in case a bridge spans multiple switchdev instances.
664 @@ -553,6 +569,10 @@ struct br_input_skb_cb {
665 #ifdef CONFIG_NETFILTER_FAMILY_BRIDGE
666 u8 br_netfilter_broute:1;
669 + u8 input_vlan_present:1;
670 + u16 input_vlan_tag;
673 #ifdef CONFIG_NET_SWITCHDEV
674 /* Set if TX data plane offloading is used towards at least one
676 +++ b/net/bridge/br_private_offload.h
678 +#ifndef __BR_OFFLOAD_H
679 +#define __BR_OFFLOAD_H
681 +bool br_offload_input(struct net_bridge_port *p, struct sk_buff *skb);
682 +void br_offload_output(struct sk_buff *skb);
683 +void br_offload_port_state(struct net_bridge_port *p);
684 +void br_offload_fdb_update(const struct net_bridge_fdb_entry *fdb);
685 +int br_offload_init(void);
686 +void br_offload_fini(void);
687 +int br_offload_set_cache_size(struct net_bridge *br, unsigned long val,
688 + struct netlink_ext_ack *extack);
689 +int br_offload_set_cache_reserved(struct net_bridge *br, unsigned long val,
690 + struct netlink_ext_ack *extack);
692 +static inline void br_offload_skb_disable(struct sk_buff *skb)
694 + struct br_input_skb_cb *cb = (struct br_input_skb_cb *)skb->cb;
701 --- a/net/bridge/br_stp.c
702 +++ b/net/bridge/br_stp.c
705 #include "br_private.h"
706 #include "br_private_stp.h"
707 +#include "br_private_offload.h"
709 /* since time values in bpdu are in jiffies and then scaled (1/256)
710 * before sending, make sure that is at least one STP tick.
711 @@ -52,6 +53,8 @@ void br_set_state(struct net_bridge_port
712 (unsigned int) p->port_no, p->dev->name,
713 br_port_state_names[p->state]);
715 + br_offload_port_state(p);
717 if (p->br->stp_enabled == BR_KERNEL_STP) {
719 case BR_STATE_BLOCKING:
720 --- a/net/bridge/br_sysfs_br.c
721 +++ b/net/bridge/br_sysfs_br.c
723 #include <linux/sched/signal.h>
725 #include "br_private.h"
726 +#include "br_private_offload.h"
728 /* IMPORTANT: new bridge options must be added with netlink support only
729 * please do not add new sysfs entries
730 @@ -930,6 +931,38 @@ static ssize_t vlan_stats_per_port_store
731 static DEVICE_ATTR_RW(vlan_stats_per_port);
734 +static ssize_t offload_cache_size_show(struct device *d,
735 + struct device_attribute *attr,
738 + struct net_bridge *br = to_bridge(d);
739 + return sprintf(buf, "%u\n", br->offload_cache_size);
742 +static ssize_t offload_cache_size_store(struct device *d,
743 + struct device_attribute *attr,
744 + const char *buf, size_t len)
746 + return store_bridge_parm(d, buf, len, br_offload_set_cache_size);
748 +static DEVICE_ATTR_RW(offload_cache_size);
750 +static ssize_t offload_cache_reserved_show(struct device *d,
751 + struct device_attribute *attr,
754 + struct net_bridge *br = to_bridge(d);
755 + return sprintf(buf, "%u\n", br->offload_cache_reserved);
758 +static ssize_t offload_cache_reserved_store(struct device *d,
759 + struct device_attribute *attr,
760 + const char *buf, size_t len)
762 + return store_bridge_parm(d, buf, len, br_offload_set_cache_reserved);
764 +static DEVICE_ATTR_RW(offload_cache_reserved);
766 static struct attribute *bridge_attrs[] = {
767 &dev_attr_forward_delay.attr,
768 &dev_attr_hello_time.attr,
769 @@ -984,6 +1017,8 @@ static struct attribute *bridge_attrs[]
770 &dev_attr_vlan_stats_enabled.attr,
771 &dev_attr_vlan_stats_per_port.attr,
773 + &dev_attr_offload_cache_size.attr,
774 + &dev_attr_offload_cache_reserved.attr,
778 --- a/net/bridge/br_sysfs_if.c
779 +++ b/net/bridge/br_sysfs_if.c
780 @@ -241,6 +241,7 @@ BRPORT_ATTR_FLAG(broadcast_flood, BR_BCA
781 BRPORT_ATTR_FLAG(neigh_suppress, BR_NEIGH_SUPPRESS);
782 BRPORT_ATTR_FLAG(isolated, BR_ISOLATED);
783 BRPORT_ATTR_FLAG(bpdu_filter, BR_BPDU_FILTER);
784 +BRPORT_ATTR_FLAG(offload, BR_OFFLOAD);
786 #ifdef CONFIG_BRIDGE_IGMP_SNOOPING
787 static ssize_t show_multicast_router(struct net_bridge_port *p, char *buf)
788 @@ -295,6 +296,7 @@ static const struct brport_attribute *br
789 &brport_attr_isolated,
790 &brport_attr_bpdu_filter,
791 &brport_attr_backup_port,
792 + &brport_attr_offload,
796 --- a/net/bridge/br_vlan_tunnel.c
797 +++ b/net/bridge/br_vlan_tunnel.c
800 #include "br_private.h"
801 #include "br_private_tunnel.h"
802 +#include "br_private_offload.h"
804 static inline int br_vlan_tunid_cmp(struct rhashtable_compare_arg *arg,
806 @@ -180,6 +181,7 @@ void br_handle_ingress_vlan_tunnel(struc
809 __vlan_hwaccel_put_tag(skb, p->br->vlan_proto, vlan->vid);
810 + br_offload_skb_disable(skb);
813 int br_handle_egress_vlan_tunnel(struct sk_buff *skb,
814 @@ -201,6 +203,7 @@ int br_handle_egress_vlan_tunnel(struct
818 + br_offload_skb_disable(skb);
819 tunnel_dst = rcu_dereference(vlan->tinfo.tunnel_dst);
820 if (tunnel_dst && dst_hold_safe(&tunnel_dst->dst))
821 skb_dst_set(skb, &tunnel_dst->dst);