2019-05-27 08:55:01 +02:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-05-06 00:48:24 -07:00
|
|
|
|
2005-12-21 18:51:49 -08:00
|
|
|
|
2005-12-21 19:00:58 -08:00
|
|
|
|
2010-05-06 00:48:24 -07:00
|
|
|
|
2010-04-15 12:14:51 +02:00
|
|
|
|
2005-12-21 18:51:49 -08:00
|
|
|
|
2016-12-24 11:46:01 -08:00
|
|
|
|
2025-03-07 10:30:06 -08:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2013-05-22 07:49:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-03-10 10:27:18 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-07-27 08:26:30 +00:00
|
|
|
|
2009-08-31 19:50:41 +00:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2024-05-13 13:34:19 +03:00
|
|
|
|
2021-07-19 20:06:28 +03:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2021-07-19 20:06:25 +03:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2010-02-27 19:41:48 +00:00
|
|
|
|
2015-03-10 10:27:18 +01:00
|
|
|
|
2020-01-24 13:40:22 +02:00
|
|
|
|
2021-07-19 20:06:28 +03:00
|
|
|
|
2017-07-13 16:09:10 +03:00
|
|
|
|
2013-02-13 12:00:14 +00:00
|
|
|
|
2010-03-02 13:32:09 +00:00
|
|
|
|
2024-05-13 13:34:19 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-31 19:26:16 +03:00
|
|
|
|
skbuff: bridge: Add layer 2 miss indication
For EVPN non-DF (Designated Forwarder) filtering we need to be able to
prevent decapsulated traffic from being flooded to a multi-homed host.
Filtering of multicast and broadcast traffic can be achieved using the
following flower filter:
# tc filter add dev bond0 egress pref 1 proto all flower indev vxlan0 dst_mac 01:00:00:00:00:00/01:00:00:00:00:00 action drop
Unlike broadcast and multicast traffic, it is not currently possible to
filter unknown unicast traffic. The classification into unknown unicast
is performed by the bridge driver, but is not visible to other layers
such as tc.
Solve this by adding a new 'l2_miss' bit to the tc skb extension. Clear
the bit whenever a packet enters the bridge (received from a bridge port
or transmitted via the bridge) and set it if the packet did not match an
FDB or MDB entry. If there is no skb extension and the bit needs to be
cleared, then do not allocate one as no extension is equivalent to the
bit being cleared. The bit is not set for broadcast packets as they
never perform a lookup and therefore never incur a miss.
A bit that is set for every flooded packet would also work for the
current use case, but it does not allow us to differentiate between
registered and unregistered multicast traffic, which might be useful in
the future.
To keep the performance impact to a minimum, the marking of packets is
guarded by the 'tc_skb_ext_tc' static key. When 'false', the skb is not
touched and an skb extension is not allocated. Instead, only a
5 bytes nop is executed, as demonstrated below for the call site in
br_handle_frame().
Before the patch:
```
memset(skb->cb, 0, sizeof(struct br_input_skb_cb));
c37b09: 49 c7 44 24 28 00 00 movq $0x0,0x28(%r12)
c37b10: 00 00
p = br_port_get_rcu(skb->dev);
c37b12: 49 8b 44 24 10 mov 0x10(%r12),%rax
memset(skb->cb, 0, sizeof(struct br_input_skb_cb));
c37b17: 49 c7 44 24 30 00 00 movq $0x0,0x30(%r12)
c37b1e: 00 00
c37b20: 49 c7 44 24 38 00 00 movq $0x0,0x38(%r12)
c37b27: 00 00
```
After the patch (when static key is disabled):
```
memset(skb->cb, 0, sizeof(struct br_input_skb_cb));
c37c29: 49 c7 44 24 28 00 00 movq $0x0,0x28(%r12)
c37c30: 00 00
c37c32: 49 8d 44 24 28 lea 0x28(%r12),%rax
c37c37: 48 c7 40 08 00 00 00 movq $0x0,0x8(%rax)
c37c3e: 00
c37c3f: 48 c7 40 10 00 00 00 movq $0x0,0x10(%rax)
c37c46: 00
#ifdef CONFIG_HAVE_JUMP_LABEL_HACK
static __always_inline bool arch_static_branch(struct static_key *key, bool branch)
{
asm_volatile_goto("1:"
c37c47: 0f 1f 44 00 00 nopl 0x0(%rax,%rax,1)
br_tc_skb_miss_set(skb, false);
p = br_port_get_rcu(skb->dev);
c37c4c: 49 8b 44 24 10 mov 0x10(%r12),%rax
```
Subsequent patches will extend the flower classifier to be able to match
on the new 'l2_miss' bit and enable / disable the static key when
filters that match on it are added / deleted.
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Acked-by: Nikolay Aleksandrov <razor@blackwall.org>
Acked-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-05-29 14:48:28 +03:00
|
|
|
|
2020-07-31 19:26:16 +03:00
|
|
|
|
2012-08-14 08:19:33 -07:00
|
|
|
|
2015-03-10 10:27:18 +01:00
|
|
|
|
|
|
|
|
|
2012-08-14 08:19:33 -07:00
|
|
|
|
2010-04-15 12:14:51 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-11-20 12:22:23 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2017-09-03 17:44:13 +03:00
|
|
|
|
2010-02-27 19:41:42 +00:00
|
|
|
|
netfilter: bridge: add connection tracking system
This patch adds basic connection tracking support for the bridge,
including initial IPv4 support.
This patch register two hooks to deal with the bridge forwarding path,
one from the bridge prerouting hook to call nf_conntrack_in(); and
another from the bridge postrouting hook to confirm the entry.
The conntrack bridge prerouting hook defragments packets before passing
them to nf_conntrack_in() to look up for an existing entry, otherwise a
new entry is allocated and it is attached to the skbuff. The conntrack
bridge postrouting hook confirms new conntrack entries, ie. if this is
the first packet seen, then it adds the entry to the hashtable and (if
needed) it refragments the skbuff into the original fragments, leaving
the geometry as is if possible. Exceptions are linearized skbuffs, eg.
skbuffs that are passed up to nfqueue and conntrack helpers, as well as
cloned skbuff for the local delivery (eg. tcpdump), also in case of
bridge port flooding (cloned skbuff too).
The packet defragmentation is done through the ip_defrag() call. This
forces us to save the bridge control buffer, reset the IP control buffer
area and then restore it after call. This function also bumps the IP
fragmentation statistics, it would be probably desiderable to have
independent statistics for the bridge defragmentation/refragmentation.
The maximum fragment length is stored in the control buffer and it is
used to refragment the skbuff from the postrouting path.
The new fraglist splitter and fragment transformer APIs are used to
implement the bridge refragmentation code. The br_ip_fragment() function
drops the packet in case the maximum fragment size seen is larger than
the output port MTU.
This patchset follows the principle that conntrack should not drop
packets, so users can do it through policy via invalid state matching.
Like br_netfilter, there is no refragmentation for packets that are
passed up for local delivery, ie. prerouting -> input path. There are
calls to nf_reset() already in several spots in the stack since time ago
already, eg. af_packet, that show that skbuff fraglist handling from the
netif_rx path is supported already.
The helpers are called from the postrouting hook, before confirmation,
from there we may see packet floods to bridge ports. Then, although
unlikely, this may result in exercising the helpers many times for each
clone. It would be good to explore how to pass all the packets in a list
to the conntrack hook to do this handle only once for this case.
Thanks to Florian Westphal for handing me over an initial patchset
version to add support for conntrack bridge.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-05-29 13:25:37 +02:00
|
|
|
|
2010-02-27 19:41:42 +00:00
|
|
|
|
2007-03-19 15:30:44 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2021-07-19 20:06:28 +03:00
|
|
|
|
|
|
|
|
|
2014-03-27 21:46:55 +09:00
|
|
|
|
|
|
|
|
|
2017-10-06 22:12:38 -07:00
|
|
|
|
2020-02-24 18:46:22 +02:00
|
|
|
|
|
|
|
|
|
2018-09-26 17:01:05 +03:00
|
|
|
|
2017-10-06 22:12:38 -07:00
|
|
|
|
2017-10-06 22:12:39 -07:00
|
|
|
|
|
|
|
|
|
2018-09-26 17:01:05 +03:00
|
|
|
|
2017-10-06 22:12:39 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-10-06 22:12:38 -07:00
|
|
|
|
|
|
|
|
|
2017-07-13 16:09:10 +03:00
|
|
|
|
2016-07-14 06:10:02 +03:00
|
|
|
|
2023-04-19 18:34:53 +03:00
|
|
|
|
2016-07-14 06:10:02 +03:00
|
|
|
|
2010-06-10 16:12:50 +00:00
|
|
|
|
2023-04-19 18:34:53 +03:00
|
|
|
|
2010-06-10 16:12:50 +00:00
|
|
|
|
|
|
|
|
|
2021-07-19 20:06:28 +03:00
|
|
|
|
2010-07-29 01:12:31 +00:00
|
|
|
|
2010-02-27 19:41:48 +00:00
|
|
|
|
2010-07-29 01:12:31 +00:00
|
|
|
|
2010-02-27 19:41:48 +00:00
|
|
|
|
2023-10-25 15:30:11 +03:00
|
|
|
|
2013-08-01 01:06:20 +02:00
|
|
|
|
2021-07-19 20:06:25 +03:00
|
|
|
|
|
|
|
|
|
2010-02-27 19:41:48 +00:00
|
|
|
|
2023-04-19 18:34:53 +03:00
|
|
|
|
2017-02-13 14:59:09 +01:00
|
|
|
|
2016-07-14 06:10:02 +03:00
|
|
|
|
|
|
|
|
|
2023-04-19 18:34:53 +03:00
|
|
|
|
2016-07-14 06:10:02 +03:00
|
|
|
|
2010-02-27 19:41:48 +00:00
|
|
|
|
2010-07-27 08:26:30 +00:00
|
|
|
|
2009-06-23 06:03:08 +00:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2011-04-04 14:03:32 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-10-03 11:29:18 -04:00
|
|
|
|
2011-04-04 14:03:32 +00:00
|
|
|
|
2017-12-12 16:02:50 +02:00
|
|
|
|
2024-02-27 10:23:36 -08:00
|
|
|
|
2017-12-12 16:02:50 +02:00
|
|
|
|
|
|
|
|
|
2018-12-05 15:14:24 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-10-03 11:29:18 -04:00
|
|
|
|
2016-06-28 16:57:06 +02:00
|
|
|
|
2018-12-05 15:14:24 +02:00
|
|
|
|
2017-12-12 16:02:50 +02:00
|
|
|
|
2016-06-28 16:57:06 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-12-05 15:14:24 +02:00
|
|
|
|
2017-12-12 16:02:50 +02:00
|
|
|
|
2024-02-27 10:23:37 -08:00
|
|
|
|
2016-06-28 16:57:06 +02:00
|
|
|
|
2014-10-03 11:29:18 -04:00
|
|
|
|
2024-02-12 14:06:59 +00:00
|
|
|
|
2024-02-27 10:23:37 -08:00
|
|
|
|
2011-04-04 14:03:32 +00:00
|
|
|
|
|
|
|
|
|
2017-04-10 14:59:27 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-04-25 22:58:37 +08:00
|
|
|
|
2017-04-10 14:59:27 +03:00
|
|
|
|
|
|
|
|
|
2018-12-05 15:14:24 +02:00
|
|
|
|
2017-12-12 16:02:50 +02:00
|
|
|
|
2017-04-10 14:59:27 +03:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2005-05-29 14:15:17 -07:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2011-04-22 06:31:16 +00:00
|
|
|
|
2005-05-29 14:15:17 -07:00
|
|
|
|
|
|
|
|
|
2010-02-28 00:49:38 -08:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2020-12-04 18:56:28 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-05-16 09:59:20 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2010-02-28 00:49:38 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
2020-12-04 18:56:28 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-07-30 16:27:55 -07:00
|
|
|
|
2018-03-30 13:46:18 +03:00
|
|
|
|
2024-05-06 10:28:12 +00:00
|
|
|
|
2008-07-30 16:27:55 -07:00
|
|
|
|
2018-03-30 13:46:19 +03:00
|
|
|
|
2018-09-26 17:01:06 +03:00
|
|
|
|
2014-09-18 11:29:03 +02:00
|
|
|
|
2008-07-30 16:27:55 -07:00
|
|
|
|
2010-12-08 21:16:57 -08:00
|
|
|
|
2008-07-30 16:27:55 -07:00
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-04-09 11:49:58 -07:00
|
|
|
|
2005-12-21 18:51:49 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-04-09 11:49:58 -07:00
|
|
|
|
|
|
|
|
|
2012-02-21 02:07:52 +00:00
|
|
|
|
2005-12-21 18:51:49 -08:00
|
|
|
|
2019-12-03 16:48:06 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-12-21 18:51:49 -08:00
|
|
|
|
bridge: Convert compare_ether_addr to ether_addr_equal
Use the new bool function ether_addr_equal to add
some clarity and reduce the likelihood for misuse
of compare_ether_addr for sorting.
Done via cocci script:
$ cat compare_ether_addr.cocci
@@
expression a,b;
@@
- !compare_ether_addr(a, b)
+ ether_addr_equal(a, b)
@@
expression a,b;
@@
- compare_ether_addr(a, b)
+ !ether_addr_equal(a, b)
@@
expression a,b;
@@
- !ether_addr_equal(a, b) == 0
+ ether_addr_equal(a, b)
@@
expression a,b;
@@
- !ether_addr_equal(a, b) != 0
+ !ether_addr_equal(a, b)
@@
expression a,b;
@@
- ether_addr_equal(a, b) == 0
+ !ether_addr_equal(a, b)
@@
expression a,b;
@@
- ether_addr_equal(a, b) != 0
+ ether_addr_equal(a, b)
@@
expression a,b;
@@
- !!ether_addr_equal(a, b)
+ ether_addr_equal(a, b)
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-05-08 18:56:49 +00:00
|
|
|
|
2014-02-07 16:48:20 +09:00
|
|
|
|
2011-12-08 07:17:49 +00:00
|
|
|
|
|
|
|
|
|
2005-12-21 18:51:49 -08:00
|
|
|
|
|
|
|
|
|
2007-04-09 11:49:58 -07:00
|
|
|
|
2005-12-21 18:51:49 -08:00
|
|
|
|
|
|
|
|
|
2005-12-21 19:00:58 -08:00
|
|
|
|
|
|
|
|
|
2022-08-18 23:02:12 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-12-21 19:00:58 -08:00
|
|
|
|
|
|
|
|
|
2019-11-12 22:12:25 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-11-15 15:29:55 +00:00
|
|
|
|
|
|
|
|
|
2005-12-21 19:00:58 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-04-22 06:31:16 +00:00
|
|
|
|
2010-10-20 13:56:08 +00:00
|
|
|
|
|
|
|
|
|
2010-05-06 00:48:24 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-06-10 16:12:50 +00:00
|
|
|
|
2010-05-06 00:48:24 -07:00
|
|
|
|
2010-05-10 09:31:08 +00:00
|
|
|
|
2012-08-10 01:24:44 +00:00
|
|
|
|
2010-05-06 00:48:24 -07:00
|
|
|
|
2012-08-10 01:24:44 +00:00
|
|
|
|
2010-06-10 16:12:50 +00:00
|
|
|
|
2010-05-06 00:48:24 -07:00
|
|
|
|
|
|
|
|
|
2014-03-27 15:36:38 -07:00
|
|
|
|
2010-05-10 09:31:08 +00:00
|
|
|
|
2010-06-10 16:12:50 +00:00
|
|
|
|
2013-07-24 11:51:41 -07:00
|
|
|
|
|
|
|
|
|
2026-02-21 16:37:42 -08:00
|
|
|
|
2010-06-10 16:12:50 +00:00
|
|
|
|
2013-07-24 11:51:41 -07:00
|
|
|
|
2010-06-10 16:12:50 +00:00
|
|
|
|
2014-03-27 15:36:38 -07:00
|
|
|
|
2010-06-10 16:12:50 +00:00
|
|
|
|
|
|
|
|
|
2013-07-24 11:51:41 -07:00
|
|
|
|
2010-05-10 09:31:08 +00:00
|
|
|
|
2010-06-10 16:12:50 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-03-27 15:36:38 -07:00
|
|
|
|
2014-02-06 15:00:52 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-03-27 15:36:38 -07:00
|
|
|
|
2014-02-06 15:00:52 -08:00
|
|
|
|
|
|
|
|
|
2024-10-18 05:21:08 +00:00
|
|
|
|
2014-02-06 15:00:52 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-03-27 15:36:38 -07:00
|
|
|
|
2014-02-06 15:00:52 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-06-10 16:12:50 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-10-18 11:18:26 -04:00
|
|
|
|
2010-05-06 00:48:24 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-10-04 17:48:46 -07:00
|
|
|
|
|
|
|
|
|
2011-02-13 09:33:42 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-10-04 17:48:50 -07:00
|
|
|
|
2011-02-13 09:33:42 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-03-24 02:30:34 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-03-24 02:30:35 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-04-23 18:53:26 +08:00
|
|
|
|
2021-03-24 02:30:34 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-03-24 02:30:35 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-03-24 02:30:34 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-03-24 02:30:35 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-03-24 02:30:48 +01:00
|
|
|
|
2021-03-24 02:30:35 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-03-24 02:30:34 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2008-11-19 21:49:00 -08:00
|
|
|
|
2019-11-12 22:12:25 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-12-21 19:00:58 -08:00
|
|
|
|
|
|
|
|
|
2008-11-19 21:49:00 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-04-04 14:03:32 +00:00
|
|
|
|
2017-04-10 14:59:27 +03:00
|
|
|
|
2008-11-20 20:14:53 -08:00
|
|
|
|
2020-11-20 12:22:23 +01:00
|
|
|
|
2008-11-20 20:14:53 -08:00
|
|
|
|
2011-08-16 06:29:01 +00:00
|
|
|
|
2014-05-16 09:59:20 -04:00
|
|
|
|
2008-11-20 20:14:53 -08:00
|
|
|
|
2021-07-27 15:44:51 +02:00
|
|
|
|
2010-05-06 00:48:24 -07:00
|
|
|
|
2010-06-10 16:12:50 +00:00
|
|
|
|
2010-05-06 00:48:24 -07:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-02-13 09:33:42 +00:00
|
|
|
|
|
|
|
|
|
2011-04-22 06:31:16 +00:00
|
|
|
|
2012-04-15 06:43:56 +00:00
|
|
|
|
|
|
|
|
|
2022-04-13 13:51:58 +03:00
|
|
|
|
2012-04-15 06:43:56 +00:00
|
|
|
|
2018-12-15 22:35:09 -08:00
|
|
|
|
2023-03-15 15:11:47 +02:00
|
|
|
|
|
|
|
|
|
2023-12-17 10:32:40 +02:00
|
|
|
|
2023-03-15 15:11:47 +02:00
|
|
|
|
2023-10-25 15:30:16 +03:00
|
|
|
|
2012-10-24 08:12:57 +00:00
|
|
|
|
|
|
|
|
|
2013-02-13 12:00:12 +00:00
|
|
|
|
2015-07-31 15:03:26 +09:00
|
|
|
|
2021-03-24 02:30:34 +01:00
|
|
|
|
2008-11-19 21:49:00 -08:00
|
|
|
|
|
|
|
|
|
2024-02-17 17:13:25 -03:00
|
|
|
|
2011-04-04 14:03:32 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2011-04-04 14:03:32 +00:00
|
|
|
|
|
|
|
|
|
2012-02-15 06:45:40 +00:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|
|
|
|
|
|
2008-11-19 21:49:00 -08:00
|
|
|
|
net: Fix inconsistent teardown and release of private netdev state.
Network devices can allocate reasources and private memory using
netdev_ops->ndo_init(). However, the release of these resources
can occur in one of two different places.
Either netdev_ops->ndo_uninit() or netdev->destructor().
The decision of which operation frees the resources depends upon
whether it is necessary for all netdev refs to be released before it
is safe to perform the freeing.
netdev_ops->ndo_uninit() presumably can occur right after the
NETDEV_UNREGISTER notifier completes and the unicast and multicast
address lists are flushed.
netdev->destructor(), on the other hand, does not run until the
netdev references all go away.
Further complicating the situation is that netdev->destructor()
almost universally does also a free_netdev().
This creates a problem for the logic in register_netdevice().
Because all callers of register_netdevice() manage the freeing
of the netdev, and invoke free_netdev(dev) if register_netdevice()
fails.
If netdev_ops->ndo_init() succeeds, but something else fails inside
of register_netdevice(), it does call ndo_ops->ndo_uninit(). But
it is not able to invoke netdev->destructor().
This is because netdev->destructor() will do a free_netdev() and
then the caller of register_netdevice() will do the same.
However, this means that the resources that would normally be released
by netdev->destructor() will not be.
Over the years drivers have added local hacks to deal with this, by
invoking their destructor parts by hand when register_netdevice()
fails.
Many drivers do not try to deal with this, and instead we have leaks.
Let's close this hole by formalizing the distinction between what
private things need to be freed up by netdev->destructor() and whether
the driver needs unregister_netdevice() to perform the free_netdev().
netdev->priv_destructor() performs all actions to free up the private
resources that used to be freed by netdev->destructor(), except for
free_netdev().
netdev->needs_free_netdev is a boolean that indicates whether
free_netdev() should be done at the end of unregister_netdevice().
Now, register_netdevice() can sanely release all resources after
ndo_ops->ndo_init() succeeds, by invoking both ndo_ops->ndo_uninit()
and netdev->priv_destructor().
And at the end of unregister_netdevice(), we invoke
netdev->priv_destructor() and optionally call free_netdev().
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-05-08 12:52:56 -04:00
|
|
|
|
2014-05-11 00:12:32 +00:00
|
|
|
|
2011-04-04 14:03:32 +00:00
|
|
|
|
2015-08-18 10:30:37 +02:00
|
|
|
|
2024-08-29 14:33:37 +02:00
|
|
|
|
2025-02-28 11:20:56 +01:00
|
|
|
|
2005-12-21 19:00:58 -08:00
|
|
|
|
2024-08-29 14:33:38 +02:00
|
|
|
|
|
|
|
|
|
2014-06-10 20:59:22 +09:00
|
|
|
|
|
|
|
|
|
2013-05-22 07:49:34 +00:00
|
|
|
|
2024-02-27 10:23:36 -08:00
|
|
|
|
2011-04-04 14:03:32 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-12-12 16:02:50 +02:00
|
|
|
|
2020-10-27 10:02:42 +00:00
|
|
|
|
2020-04-26 15:22:07 +02:00
|
|
|
|
2020-11-06 22:50:49 +01:00
|
|
|
|
2020-10-27 10:02:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-04-26 15:22:07 +02:00
|
|
|
|
2011-04-04 14:03:32 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-11-02 10:36:48 +01:00
|
|
|
|
2011-04-04 14:03:32 +00:00
|
|
|
|
|
|
|
|
|
2011-10-03 18:14:46 +00:00
|
|
|
|
2014-06-10 20:59:24 +09:00
|
|
|
|
2011-10-03 18:14:46 +00:00
|
|
|
|
2011-04-04 14:03:32 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-12-10 13:44:29 -05:00
|
|
|
|
net: use core MTU range checking in core net infra
geneve:
- Merge __geneve_change_mtu back into geneve_change_mtu, set max_mtu
- This one isn't quite as straight-forward as others, could use some
closer inspection and testing
macvlan:
- set min/max_mtu
tun:
- set min/max_mtu, remove tun_net_change_mtu
vxlan:
- Merge __vxlan_change_mtu back into vxlan_change_mtu
- Set max_mtu to IP_MAX_MTU and retain dynamic MTU range checks in
change_mtu function
- This one is also not as straight-forward and could use closer inspection
and testing from vxlan folks
bridge:
- set max_mtu of IP_MAX_MTU and retain dynamic MTU range checks in
change_mtu function
openvswitch:
- set min/max_mtu, remove internal_dev_change_mtu
- note: max_mtu wasn't checked previously, it's been set to 65535, which
is the largest possible size supported
sch_teql:
- set min/max_mtu (note: max_mtu previously unchecked, used max of 65535)
macsec:
- min_mtu = 0, max_mtu = 65535
macvlan:
- min_mtu = 0, max_mtu = 65535
ntb_netdev:
- min_mtu = 0, max_mtu = 65535
veth:
- min_mtu = 68, max_mtu = 65535
8021q:
- min_mtu = 0, max_mtu = 65535
CC: netdev@vger.kernel.org
CC: Nicolas Dichtel <nicolas.dichtel@6wind.com>
CC: Hannes Frederic Sowa <hannes@stressinduktion.org>
CC: Tom Herbert <tom@herbertland.com>
CC: Daniel Borkmann <daniel@iogearbox.net>
CC: Alexander Duyck <alexander.h.duyck@intel.com>
CC: Paolo Abeni <pabeni@redhat.com>
CC: Jiri Benc <jbenc@redhat.com>
CC: WANG Cong <xiyou.wangcong@gmail.com>
CC: Roopa Prabhu <roopa@cumulusnetworks.com>
CC: Pravin B Shelar <pshelar@ovn.org>
CC: Sabrina Dubroca <sd@queasysnail.net>
CC: Patrick McHardy <kaber@trash.net>
CC: Stephen Hemminger <stephen@networkplumber.org>
CC: Pravin Shelar <pshelar@nicira.com>
CC: Maxim Krasnyansky <maxk@qti.qualcomm.com>
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-10-20 13:55:20 -04:00
|
|
|
|
2011-04-04 14:03:32 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-04 18:05:07 +01:00
|
|
|
|
2005-04-16 15:20:36 -07:00
|
|
|
|