|
@@ -1,6 +1,6 @@
|
|
--- a/include/linux/if_bridge.h
|
|
--- a/include/linux/if_bridge.h
|
|
+++ b/include/linux/if_bridge.h
|
|
+++ b/include/linux/if_bridge.h
|
|
-@@ -57,6 +57,7 @@ struct br_ip_list {
|
|
|
|
|
|
+@@ -59,6 +59,7 @@ struct br_ip_list {
|
|
#define BR_MRP_LOST_IN_CONT BIT(19)
|
|
#define BR_MRP_LOST_IN_CONT BIT(19)
|
|
#define BR_TX_FWD_OFFLOAD BIT(20)
|
|
#define BR_TX_FWD_OFFLOAD BIT(20)
|
|
#define BR_BPDU_FILTER BIT(21)
|
|
#define BR_BPDU_FILTER BIT(21)
|
|
@@ -29,7 +29,7 @@
|
|
|
|
|
|
/*
|
|
/*
|
|
* Handle changes in state of network devices enslaved to a bridge.
|
|
* Handle changes in state of network devices enslaved to a bridge.
|
|
-@@ -332,6 +333,10 @@ static int __init br_init(void)
|
|
|
|
|
|
+@@ -381,6 +382,10 @@ static int __init br_init(void)
|
|
if (err)
|
|
if (err)
|
|
goto err_out;
|
|
goto err_out;
|
|
|
|
|
|
@@ -40,7 +40,7 @@
|
|
err = register_pernet_subsys(&br_net_ops);
|
|
err = register_pernet_subsys(&br_net_ops);
|
|
if (err)
|
|
if (err)
|
|
goto err_out1;
|
|
goto err_out1;
|
|
-@@ -375,6 +380,8 @@ err_out3:
|
|
|
|
|
|
+@@ -430,6 +435,8 @@ err_out3:
|
|
err_out2:
|
|
err_out2:
|
|
unregister_pernet_subsys(&br_net_ops);
|
|
unregister_pernet_subsys(&br_net_ops);
|
|
err_out1:
|
|
err_out1:
|
|
@@ -49,7 +49,7 @@
|
|
br_fdb_fini();
|
|
br_fdb_fini();
|
|
err_out:
|
|
err_out:
|
|
stp_proto_unregister(&br_stp_proto);
|
|
stp_proto_unregister(&br_stp_proto);
|
|
-@@ -396,6 +403,7 @@ static void __exit br_deinit(void)
|
|
|
|
|
|
+@@ -452,6 +459,7 @@ static void __exit br_deinit(void)
|
|
#if IS_ENABLED(CONFIG_ATM_LANE)
|
|
#if IS_ENABLED(CONFIG_ATM_LANE)
|
|
br_fdb_test_addr_hook = NULL;
|
|
br_fdb_test_addr_hook = NULL;
|
|
#endif
|
|
#endif
|
|
@@ -59,7 +59,7 @@
|
|
|
|
|
|
--- a/net/bridge/br_device.c
|
|
--- a/net/bridge/br_device.c
|
|
+++ b/net/bridge/br_device.c
|
|
+++ b/net/bridge/br_device.c
|
|
-@@ -529,6 +529,8 @@ void br_dev_setup(struct net_device *dev
|
|
|
|
|
|
+@@ -524,6 +524,8 @@ void br_dev_setup(struct net_device *dev
|
|
br->bridge_hello_time = br->hello_time = 2 * HZ;
|
|
br->bridge_hello_time = br->hello_time = 2 * HZ;
|
|
br->bridge_forward_delay = br->forward_delay = 15 * HZ;
|
|
br->bridge_forward_delay = br->forward_delay = 15 * HZ;
|
|
br->bridge_ageing_time = br->ageing_time = BR_DEFAULT_AGEING_TIME;
|
|
br->bridge_ageing_time = br->ageing_time = BR_DEFAULT_AGEING_TIME;
|
|
@@ -78,7 +78,7 @@
|
|
|
|
|
|
static const struct rhashtable_params br_fdb_rht_params = {
|
|
static const struct rhashtable_params br_fdb_rht_params = {
|
|
.head_offset = offsetof(struct net_bridge_fdb_entry, rhnode),
|
|
.head_offset = offsetof(struct net_bridge_fdb_entry, rhnode),
|
|
-@@ -513,6 +514,8 @@ static struct net_bridge_fdb_entry *fdb_
|
|
|
|
|
|
+@@ -518,6 +519,8 @@ static struct net_bridge_fdb_entry *fdb_
|
|
fdb->key.vlan_id = vid;
|
|
fdb->key.vlan_id = vid;
|
|
fdb->flags = flags;
|
|
fdb->flags = flags;
|
|
fdb->updated = fdb->used = jiffies;
|
|
fdb->updated = fdb->used = jiffies;
|
|
@@ -87,7 +87,7 @@
|
|
if (rhashtable_lookup_insert_fast(&br->fdb_hash_tbl,
|
|
if (rhashtable_lookup_insert_fast(&br->fdb_hash_tbl,
|
|
&fdb->rhnode,
|
|
&fdb->rhnode,
|
|
br_fdb_rht_params)) {
|
|
br_fdb_rht_params)) {
|
|
-@@ -734,6 +737,8 @@ static void fdb_notify(struct net_bridge
|
|
|
|
|
|
+@@ -794,6 +797,8 @@ static void fdb_notify(struct net_bridge
|
|
struct sk_buff *skb;
|
|
struct sk_buff *skb;
|
|
int err = -ENOBUFS;
|
|
int err = -ENOBUFS;
|
|
|
|
|
|
@@ -125,7 +125,7 @@
|
|
|
|
|
|
/*
|
|
/*
|
|
* Determine initial path cost based on speed.
|
|
* Determine initial path cost based on speed.
|
|
-@@ -427,7 +428,7 @@ static struct net_bridge_port *new_nbp(s
|
|
|
|
|
|
+@@ -428,7 +429,7 @@ static struct net_bridge_port *new_nbp(s
|
|
p->path_cost = port_cost(dev);
|
|
p->path_cost = port_cost(dev);
|
|
p->priority = 0x8000 >> BR_PORT_BITS;
|
|
p->priority = 0x8000 >> BR_PORT_BITS;
|
|
p->port_no = index;
|
|
p->port_no = index;
|
|
@@ -134,7 +134,7 @@
|
|
br_init_port(p);
|
|
br_init_port(p);
|
|
br_set_state(p, BR_STATE_DISABLED);
|
|
br_set_state(p, BR_STATE_DISABLED);
|
|
br_stp_port_timer_init(p);
|
|
br_stp_port_timer_init(p);
|
|
-@@ -777,6 +778,9 @@ void br_port_flags_change(struct net_bri
|
|
|
|
|
|
+@@ -771,6 +772,9 @@ void br_port_flags_change(struct net_bri
|
|
|
|
|
|
if (mask & BR_NEIGH_SUPPRESS)
|
|
if (mask & BR_NEIGH_SUPPRESS)
|
|
br_recalculate_neigh_suppress_enabled(br);
|
|
br_recalculate_neigh_suppress_enabled(br);
|
|
@@ -154,7 +154,7 @@
|
|
|
|
|
|
static int
|
|
static int
|
|
br_netif_receive_skb(struct net *net, struct sock *sk, struct sk_buff *skb)
|
|
br_netif_receive_skb(struct net *net, struct sock *sk, struct sk_buff *skb)
|
|
-@@ -162,6 +163,7 @@ int br_handle_frame_finish(struct net *n
|
|
|
|
|
|
+@@ -164,6 +165,7 @@ int br_handle_frame_finish(struct net *n
|
|
dst->used = now;
|
|
dst->used = now;
|
|
br_forward(dst->dst, skb, local_rcv, false);
|
|
br_forward(dst->dst, skb, local_rcv, false);
|
|
} else {
|
|
} else {
|
|
@@ -162,7 +162,7 @@
|
|
if (!mcast_hit)
|
|
if (!mcast_hit)
|
|
br_flood(br, skb, pkt_type, local_rcv, false);
|
|
br_flood(br, skb, pkt_type, local_rcv, false);
|
|
else
|
|
else
|
|
-@@ -280,6 +282,9 @@ static rx_handler_result_t br_handle_fra
|
|
|
|
|
|
+@@ -297,6 +299,9 @@ static rx_handler_result_t br_handle_fra
|
|
memset(skb->cb, 0, sizeof(struct br_input_skb_cb));
|
|
memset(skb->cb, 0, sizeof(struct br_input_skb_cb));
|
|
|
|
|
|
p = br_port_get_rcu(skb->dev);
|
|
p = br_port_get_rcu(skb->dev);
|
|
@@ -170,7 +170,7 @@
|
|
+ return RX_HANDLER_CONSUMED;
|
|
+ return RX_HANDLER_CONSUMED;
|
|
+
|
|
+
|
|
if (p->flags & BR_VLAN_TUNNEL)
|
|
if (p->flags & BR_VLAN_TUNNEL)
|
|
- br_handle_ingress_vlan_tunnel(skb, p, nbp_vlan_group_rcu(p))
|
|
|
|
|
|
+ br_handle_ingress_vlan_tunnel(skb, p, nbp_vlan_group_rcu(p));
|
|
|
|
|
|
--- /dev/null
|
|
--- /dev/null
|
|
+++ b/net/bridge/br_offload.c
|
|
+++ b/net/bridge/br_offload.c
|
|
@@ -615,7 +615,7 @@
|
|
+}
|
|
+}
|
|
--- a/net/bridge/br_private.h
|
|
--- a/net/bridge/br_private.h
|
|
+++ b/net/bridge/br_private.h
|
|
+++ b/net/bridge/br_private.h
|
|
-@@ -207,7 +207,13 @@ struct net_bridge_fdb_entry {
|
|
|
|
|
|
+@@ -268,7 +268,13 @@ struct net_bridge_fdb_entry {
|
|
unsigned long updated ____cacheline_aligned_in_smp;
|
|
unsigned long updated ____cacheline_aligned_in_smp;
|
|
unsigned long used;
|
|
unsigned long used;
|
|
|
|
|
|
@@ -630,7 +630,7 @@
|
|
};
|
|
};
|
|
|
|
|
|
#define MDB_PG_FLAGS_PERMANENT BIT(0)
|
|
#define MDB_PG_FLAGS_PERMANENT BIT(0)
|
|
-@@ -280,6 +286,12 @@ struct net_bridge_mdb_entry {
|
|
|
|
|
|
+@@ -343,6 +349,12 @@ struct net_bridge_mdb_entry {
|
|
struct rcu_head rcu;
|
|
struct rcu_head rcu;
|
|
};
|
|
};
|
|
|
|
|
|
@@ -643,7 +643,7 @@
|
|
struct net_bridge_port {
|
|
struct net_bridge_port {
|
|
struct net_bridge *br;
|
|
struct net_bridge *br;
|
|
struct net_device *dev;
|
|
struct net_device *dev;
|
|
-@@ -337,6 +349,7 @@ struct net_bridge_port {
|
|
|
|
|
|
+@@ -403,6 +415,7 @@ struct net_bridge_port {
|
|
u16 backup_redirected_cnt;
|
|
u16 backup_redirected_cnt;
|
|
|
|
|
|
struct bridge_stp_xstats stp_xstats;
|
|
struct bridge_stp_xstats stp_xstats;
|
|
@@ -651,7 +651,7 @@
|
|
};
|
|
};
|
|
|
|
|
|
#define kobj_to_brport(obj) container_of(obj, struct net_bridge_port, kobj)
|
|
#define kobj_to_brport(obj) container_of(obj, struct net_bridge_port, kobj)
|
|
-@@ -475,6 +488,9 @@ struct net_bridge {
|
|
|
|
|
|
+@@ -519,6 +532,9 @@ struct net_bridge {
|
|
struct kobject *ifobj;
|
|
struct kobject *ifobj;
|
|
u32 auto_cnt;
|
|
u32 auto_cnt;
|
|
|
|
|
|
@@ -661,7 +661,7 @@
|
|
#ifdef CONFIG_NET_SWITCHDEV
|
|
#ifdef CONFIG_NET_SWITCHDEV
|
|
/* Counter used to make sure that hardware domains get unique
|
|
/* Counter used to make sure that hardware domains get unique
|
|
* identifiers in case a bridge spans multiple switchdev instances.
|
|
* identifiers in case a bridge spans multiple switchdev instances.
|
|
-@@ -501,6 +517,10 @@ struct br_input_skb_cb {
|
|
|
|
|
|
+@@ -553,6 +569,10 @@ struct br_input_skb_cb {
|
|
#ifdef CONFIG_NETFILTER_FAMILY_BRIDGE
|
|
#ifdef CONFIG_NETFILTER_FAMILY_BRIDGE
|
|
u8 br_netfilter_broute:1;
|
|
u8 br_netfilter_broute:1;
|
|
#endif
|
|
#endif
|
|
@@ -725,9 +725,9 @@
|
|
#include "br_private.h"
|
|
#include "br_private.h"
|
|
+#include "br_private_offload.h"
|
|
+#include "br_private_offload.h"
|
|
|
|
|
|
- #define to_bridge(cd) ((struct net_bridge *)netdev_priv(to_net_dev(cd)))
|
|
|
|
-
|
|
|
|
-@@ -842,6 +843,38 @@ static ssize_t vlan_stats_per_port_store
|
|
|
|
|
|
+ /* IMPORTANT: new bridge options must be added with netlink support only
|
|
|
|
+ * please do not add new sysfs entries
|
|
|
|
+@@ -930,6 +931,38 @@ static ssize_t vlan_stats_per_port_store
|
|
static DEVICE_ATTR_RW(vlan_stats_per_port);
|
|
static DEVICE_ATTR_RW(vlan_stats_per_port);
|
|
#endif
|
|
#endif
|
|
|
|
|
|
@@ -766,7 +766,7 @@
|
|
static struct attribute *bridge_attrs[] = {
|
|
static struct attribute *bridge_attrs[] = {
|
|
&dev_attr_forward_delay.attr,
|
|
&dev_attr_forward_delay.attr,
|
|
&dev_attr_hello_time.attr,
|
|
&dev_attr_hello_time.attr,
|
|
-@@ -896,6 +929,8 @@ static struct attribute *bridge_attrs[]
|
|
|
|
|
|
+@@ -984,6 +1017,8 @@ static struct attribute *bridge_attrs[]
|
|
&dev_attr_vlan_stats_enabled.attr,
|
|
&dev_attr_vlan_stats_enabled.attr,
|
|
&dev_attr_vlan_stats_per_port.attr,
|
|
&dev_attr_vlan_stats_per_port.attr,
|
|
#endif
|
|
#endif
|
|
@@ -777,7 +777,7 @@
|
|
|
|
|
|
--- a/net/bridge/br_sysfs_if.c
|
|
--- a/net/bridge/br_sysfs_if.c
|
|
+++ b/net/bridge/br_sysfs_if.c
|
|
+++ b/net/bridge/br_sysfs_if.c
|
|
-@@ -234,6 +234,7 @@ BRPORT_ATTR_FLAG(broadcast_flood, BR_BCA
|
|
|
|
|
|
+@@ -241,6 +241,7 @@ BRPORT_ATTR_FLAG(broadcast_flood, BR_BCA
|
|
BRPORT_ATTR_FLAG(neigh_suppress, BR_NEIGH_SUPPRESS);
|
|
BRPORT_ATTR_FLAG(neigh_suppress, BR_NEIGH_SUPPRESS);
|
|
BRPORT_ATTR_FLAG(isolated, BR_ISOLATED);
|
|
BRPORT_ATTR_FLAG(isolated, BR_ISOLATED);
|
|
BRPORT_ATTR_FLAG(bpdu_filter, BR_BPDU_FILTER);
|
|
BRPORT_ATTR_FLAG(bpdu_filter, BR_BPDU_FILTER);
|
|
@@ -785,7 +785,7 @@
|
|
|
|
|
|
#ifdef CONFIG_BRIDGE_IGMP_SNOOPING
|
|
#ifdef CONFIG_BRIDGE_IGMP_SNOOPING
|
|
static ssize_t show_multicast_router(struct net_bridge_port *p, char *buf)
|
|
static ssize_t show_multicast_router(struct net_bridge_port *p, char *buf)
|
|
-@@ -288,6 +289,7 @@ static const struct brport_attribute *br
|
|
|
|
|
|
+@@ -295,6 +296,7 @@ static const struct brport_attribute *br
|
|
&brport_attr_isolated,
|
|
&brport_attr_isolated,
|
|
&brport_attr_bpdu_filter,
|
|
&brport_attr_bpdu_filter,
|
|
&brport_attr_backup_port,
|
|
&brport_attr_backup_port,
|
|
@@ -803,7 +803,7 @@
|
|
|
|
|
|
static inline int br_vlan_tunid_cmp(struct rhashtable_compare_arg *arg,
|
|
static inline int br_vlan_tunid_cmp(struct rhashtable_compare_arg *arg,
|
|
const void *ptr)
|
|
const void *ptr)
|
|
-@@ -180,6 +181,7 @@ int br_handle_ingress_vlan_tunnel(struct
|
|
|
|
|
|
+@@ -180,6 +181,7 @@ void br_handle_ingress_vlan_tunnel(struc
|
|
skb_dst_drop(skb);
|
|
skb_dst_drop(skb);
|
|
|
|
|
|
__vlan_hwaccel_put_tag(skb, p->br->vlan_proto, vlan->vid);
|
|
__vlan_hwaccel_put_tag(skb, p->br->vlan_proto, vlan->vid);
|
|
@@ -811,7 +811,7 @@
|
|
}
|
|
}
|
|
|
|
|
|
int br_handle_egress_vlan_tunnel(struct sk_buff *skb,
|
|
int br_handle_egress_vlan_tunnel(struct sk_buff *skb,
|
|
-@@ -203,6 +205,7 @@ int br_handle_egress_vlan_tunnel(struct
|
|
|
|
|
|
+@@ -201,6 +203,7 @@ int br_handle_egress_vlan_tunnel(struct
|
|
if (err)
|
|
if (err)
|
|
return err;
|
|
return err;
|
|
|
|
|