2019-05-27 08:55:01 +02:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ipv4: Convert ->flowi4_tos to dscp_t.
Convert the ->flowic_tos field of struct flowi_common from __u8 to
dscp_t, rename it ->flowic_dscp and propagate these changes to struct
flowi and struct flowi4.
We've had several bugs in the past where ECN bits could interfere with
IPv4 routing, because these bits were not properly cleared when setting
->flowi4_tos. These bugs should be fixed now and the dscp_t type has
been introduced to ensure that variables carrying DSCP values don't
accidentally have any ECN bits set. Several variables and structure
fields have been converted to dscp_t already, but the main IPv4 routing
structure, struct flowi4, is still using a __u8. To avoid any future
regression, this patch converts it to dscp_t.
There are many users to convert at once. Fortunately, around half of
->flowi4_tos users already have a dscp_t value at hand, which they
currently convert to __u8 using inet_dscp_to_dsfield(). For all of
these users, we just need to drop that conversion.
But, although we try to do the __u8 <-> dscp_t conversions at the
boundaries of the network or of user space, some places still store
TOS/DSCP variables as __u8 in core networking code. Those can hardly be
converted either because the data structure is part of UAPI or because
the same variable or field is also used for handling ECN in other parts
of the code. In all of these cases where we don't have a dscp_t
variable at hand, we need to use inet_dsfield_to_dscp() when
interacting with ->flowi4_dscp.
Changes since v1:
* Fix space alignment in __bpf_redirect_neigh_v4() (Ido).
Signed-off-by: Guillaume Nault <gnault@redhat.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Link: https://patch.msgid.link/29acecb45e911d17446b9a3dbdb1ab7b821ea371.1756128932.git.gnault@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-08-25 15:37:43 +02:00
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
2025-01-16 14:39:38 +01:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:11:58 +02:00
|
|
|
|
|
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
2024-05-07 01:11:58 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
2024-05-07 01:11:58 +02:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
2017-03-09 17:43:02 +01:00
|
|
|
|
2017-03-09 17:42:59 +01:00
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-09 17:42:56 +01:00
|
|
|
|
|
|
|
|
|
2022-03-04 17:40:42 +01:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
2022-03-04 17:40:42 +01:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
2017-03-24 23:23:21 +01:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-04 17:40:43 +01:00
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
2022-03-04 17:40:44 +01:00
|
|
|
|
2024-05-07 01:11:58 +02:00
|
|
|
|
2022-03-04 17:40:44 +01:00
|
|
|
|
2024-05-07 01:11:58 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-04 17:40:44 +01:00
|
|
|
|
|
|
|
|
|
netns: make struct pernet_operations::id unsigned int
Make struct pernet_operations::id unsigned.
There are 2 reasons to do so:
1)
This field is really an index into an zero based array and
thus is unsigned entity. Using negative value is out-of-bound
access by definition.
2)
On x86_64 unsigned 32-bit data which are mixed with pointers
via array indexing or offsets added or subtracted to pointers
are preffered to signed 32-bit data.
"int" being used as an array index needs to be sign-extended
to 64-bit before being used.
void f(long *p, int i)
{
g(p[i]);
}
roughly translates to
movsx rsi, esi
mov rdi, [rsi+...]
call g
MOVSX is 3 byte instruction which isn't necessary if the variable is
unsigned because x86_64 is zero extending by default.
Now, there is net_generic() function which, you guessed it right, uses
"int" as an array index:
static inline void *net_generic(const struct net *net, int id)
{
...
ptr = ng->ptr[id - 1];
...
}
And this function is used a lot, so those sign extensions add up.
Patch snipes ~1730 bytes on allyesconfig kernel (without all junk
messing with code generation):
add/remove: 0/0 grow/shrink: 70/598 up/down: 396/-2126 (-1730)
Unfortunately some functions actually grow bigger.
This is a semmingly random artefact of code generation with register
allocator being used differently. gcc decides that some variable
needs to live in new r8+ registers and every access now requires REX
prefix. Or it is shifted into r12, so [r12+0] addressing mode has to be
used which is longer than [r8]
However, overall balance is in negative direction:
add/remove: 0/0 grow/shrink: 70/598 up/down: 396/-2126 (-1730)
function old new delta
nfsd4_lock 3886 3959 +73
tipc_link_build_proto_msg 1096 1140 +44
mac80211_hwsim_new_radio 2776 2808 +32
tipc_mon_rcv 1032 1058 +26
svcauth_gss_legacy_init 1413 1429 +16
tipc_bcbase_select_primary 379 392 +13
nfsd4_exchange_id 1247 1260 +13
nfsd4_setclientid_confirm 782 793 +11
...
put_client_renew_locked 494 480 -14
ip_set_sockfn_get 730 716 -14
geneve_sock_add 829 813 -16
nfsd4_sequence_done 721 703 -18
nlmclnt_lookup_host 708 686 -22
nfsd4_lockt 1085 1063 -22
nfs_get_client 1077 1050 -27
tcf_bpf_init 1106 1076 -30
nfsd4_encode_fattr 5997 5930 -67
Total: Before=154856051, After=154854321, chg -0.00%
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-11-17 04:58:21 +03:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-04 17:40:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-09 17:43:01 +01:00
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
|
|
|
|
|
2024-05-07 01:12:21 +02:00
|
|
|
|
|
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
2024-05-07 01:14:00 +02:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:14:00 +02:00
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:14:00 +02:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:14:00 +02:00
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:11:58 +02:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:12:21 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:12:21 +02:00
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-24 23:23:21 +01:00
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-12-15 22:35:52 +01:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
2017-03-24 23:23:21 +01:00
|
|
|
|
2024-05-07 01:11:58 +02:00
|
|
|
|
2017-03-24 23:23:21 +01:00
|
|
|
|
2024-05-07 01:11:58 +02:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:12:36 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
2024-05-07 01:12:21 +02:00
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
2024-05-07 01:12:21 +02:00
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
|
|
|
|
|
2024-05-07 01:12:21 +02:00
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
|
|
|
|
|
2017-03-24 23:23:21 +01:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
2017-03-24 23:23:21 +01:00
|
|
|
|
2024-05-07 01:13:46 +02:00
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
2024-05-07 01:13:46 +02:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
2017-03-24 23:23:21 +01:00
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:13:46 +02:00
|
|
|
|
|
|
|
|
|
2017-03-09 17:42:59 +01:00
|
|
|
|
2024-05-07 01:13:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:14:00 +02:00
|
|
|
|
2024-05-07 01:13:46 +02:00
|
|
|
|
|
|
|
|
|
2021-02-03 08:07:59 +01:00
|
|
|
|
|
|
|
|
|
2017-03-09 17:42:59 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:13:46 +02:00
|
|
|
|
2021-02-03 08:08:05 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-09 17:42:59 +01:00
|
|
|
|
2021-02-03 08:07:59 +01:00
|
|
|
|
2017-03-09 17:42:59 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-06-25 15:33:23 +02:00
|
|
|
|
2017-03-09 17:42:59 +01:00
|
|
|
|
2021-02-03 08:07:59 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-09 17:42:59 +01:00
|
|
|
|
2022-02-12 00:38:38 +01:00
|
|
|
|
2017-03-09 17:42:59 +01:00
|
|
|
|
2021-02-03 08:08:05 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-09 17:42:59 +01:00
|
|
|
|
|
|
|
|
|
2022-03-04 17:40:43 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ipv4: Convert ->flowi4_tos to dscp_t.
Convert the ->flowic_tos field of struct flowi_common from __u8 to
dscp_t, rename it ->flowic_dscp and propagate these changes to struct
flowi and struct flowi4.
We've had several bugs in the past where ECN bits could interfere with
IPv4 routing, because these bits were not properly cleared when setting
->flowi4_tos. These bugs should be fixed now and the dscp_t type has
been introduced to ensure that variables carrying DSCP values don't
accidentally have any ECN bits set. Several variables and structure
fields have been converted to dscp_t already, but the main IPv4 routing
structure, struct flowi4, is still using a __u8. To avoid any future
regression, this patch converts it to dscp_t.
There are many users to convert at once. Fortunately, around half of
->flowi4_tos users already have a dscp_t value at hand, which they
currently convert to __u8 using inet_dscp_to_dsfield(). For all of
these users, we just need to drop that conversion.
But, although we try to do the __u8 <-> dscp_t conversions at the
boundaries of the network or of user space, some places still store
TOS/DSCP variables as __u8 in core networking code. Those can hardly be
converted either because the data structure is part of UAPI or because
the same variable or field is also used for handling ECN in other parts
of the code. In all of these cases where we don't have a dscp_t
variable at hand, we need to use inet_dsfield_to_dscp() when
interacting with ->flowi4_dscp.
Changes since v1:
* Fix space alignment in __bpf_redirect_neigh_v4() (Ido).
Signed-off-by: Guillaume Nault <gnault@redhat.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Link: https://patch.msgid.link/29acecb45e911d17446b9a3dbdb1ab7b821ea371.1756128932.git.gnault@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-08-25 15:37:43 +02:00
|
|
|
|
2023-07-17 15:53:30 +02:00
|
|
|
|
2022-03-04 17:40:43 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-04 17:40:43 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-04 17:40:44 +01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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
2017-03-09 17:43:02 +01:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-03 08:07:59 +01:00
|
|
|
|
2024-05-07 01:14:00 +02:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-04 17:40:43 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-04 17:40:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-03 08:07:59 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:14:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-03 08:07:59 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:14:00 +02:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
2022-03-04 17:40:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-11-03 14:05:04 +08:00
|
|
|
|
2022-03-04 17:40:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-03 08:07:59 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:14:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-05-10 21:33:38 +02:00
|
|
|
|
|
|
|
|
|
2024-05-07 01:14:00 +02:00
|
|
|
|
|
|
|
|
|
2021-02-03 08:07:59 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:11:47 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:14:00 +02:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
2019-07-03 00:22:25 +09:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-07-03 00:20:51 +09:00
|
|
|
|
|
|
|
|
|
2017-03-09 17:42:57 +01:00
|
|
|
|
2019-07-03 00:22:25 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2023-09-12 09:17:28 +00:00
|
|
|
|
2017-03-09 17:42:57 +01:00
|
|
|
|
2023-06-22 14:32:31 -07:00
|
|
|
|
2017-03-09 17:42:57 +01:00
|
|
|
|
2023-06-22 14:32:31 -07:00
|
|
|
|
2017-03-09 17:42:57 +01:00
|
|
|
|
2019-07-03 00:20:51 +09:00
|
|
|
|
2017-03-09 17:42:57 +01:00
|
|
|
|
|
|
|
|
|
2019-07-03 00:22:25 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-09 17:42:57 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-07-03 00:22:25 +09:00
|
|
|
|
2017-03-09 17:42:57 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-04 17:40:42 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-09 17:42:59 +01:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-03 08:07:59 +01:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
2023-09-12 09:17:28 +00:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
2017-03-09 17:43:02 +01:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-09 17:43:02 +01:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-09 17:42:59 +01:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-09 17:42:59 +01:00
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
2017-03-09 17:42:59 +01:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
networking: make skb_push & __skb_push return void pointers
It seems like a historic accident that these return unsigned char *,
and in many places that means casts are required, more often than not.
Make these functions return void * and remove all the casts across
the tree, adding a (u8 *) cast only where the unsigned char pointer
was used directly, all done with the following spatch:
@@
expression SKB, LEN;
typedef u8;
identifier fn = { skb_push, __skb_push, skb_push_rcsum };
@@
- *(fn(SKB, LEN))
+ *(u8 *)fn(SKB, LEN)
@@
expression E, SKB, LEN;
identifier fn = { skb_push, __skb_push, skb_push_rcsum };
type T;
@@
- E = ((T *)(fn(SKB, LEN)))
+ E = fn(SKB, LEN)
@@
expression SKB, LEN;
identifier fn = { skb_push, __skb_push, skb_push_rcsum };
@@
- fn(SKB, LEN)[0]
+ *(u8 *)fn(SKB, LEN)
Note that the last part there converts from push(...)[0] to the
more idiomatic *(u8 *)push(...).
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-16 14:29:23 +02:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-03 08:07:59 +01:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
networking: make skb_push & __skb_push return void pointers
It seems like a historic accident that these return unsigned char *,
and in many places that means casts are required, more often than not.
Make these functions return void * and remove all the casts across
the tree, adding a (u8 *) cast only where the unsigned char pointer
was used directly, all done with the following spatch:
@@
expression SKB, LEN;
typedef u8;
identifier fn = { skb_push, __skb_push, skb_push_rcsum };
@@
- *(fn(SKB, LEN))
+ *(u8 *)fn(SKB, LEN)
@@
expression E, SKB, LEN;
identifier fn = { skb_push, __skb_push, skb_push_rcsum };
type T;
@@
- E = ((T *)(fn(SKB, LEN)))
+ E = fn(SKB, LEN)
@@
expression SKB, LEN;
identifier fn = { skb_push, __skb_push, skb_push_rcsum };
@@
- fn(SKB, LEN)[0]
+ *(u8 *)fn(SKB, LEN)
Note that the last part there converts from push(...)[0] to the
more idiomatic *(u8 *)push(...).
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-16 14:29:23 +02:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-12-15 22:35:53 +01:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-12-15 22:35:53 +01:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
2021-02-03 08:07:59 +01:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
2021-06-01 22:16:25 +08:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-01-09 23:00:21 -08:00
|
|
|
|
2021-02-03 08:07:59 +01:00
|
|
|
|
2024-05-07 01:11:58 +02:00
|
|
|
|
|
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
2024-05-07 01:11:58 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
2024-05-07 01:11:58 +02:00
|
|
|
|
2021-02-03 08:07:59 +01:00
|
|
|
|
|
|
|
|
|
2024-05-07 01:13:04 +02:00
|
|
|
|
2021-02-03 08:07:59 +01:00
|
|
|
|
2021-01-09 23:00:21 -08:00
|
|
|
|
|
|
|
|
|
2021-02-03 08:07:59 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
2024-05-07 01:13:04 +02:00
|
|
|
|
2021-02-03 08:07:59 +01:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:13:04 +02:00
|
|
|
|
2021-02-03 08:07:59 +01:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
2024-05-07 01:13:04 +02:00
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:13:04 +02:00
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:13:18 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-03 08:07:59 +01:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
2024-05-07 01:11:58 +02:00
|
|
|
|
2022-03-04 17:40:43 +01:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
2021-02-03 08:07:59 +01:00
|
|
|
|
2024-05-07 01:11:58 +02:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-03 08:07:59 +01:00
|
|
|
|
2024-05-07 01:11:58 +02:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:13:18 +02:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-03 08:07:59 +01:00
|
|
|
|
2016-05-09 00:55:48 +02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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:13:18 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:13:46 +02:00
|
|
|
|
2024-05-07 01:13:18 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:13:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:13:18 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:13:04 +02:00
|
|
|
|
2024-05-07 01:13:32 +02:00
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:13:04 +02:00
|
|
|
|
2024-05-07 01:13:32 +02:00
|
|
|
|
2024-05-07 01:13:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:13:32 +02:00
|
|
|
|
|
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
2024-05-07 01:12:50 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
2021-02-03 08:07:59 +01:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-08-08 13:24:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-03 08:07:59 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-03 08:07:59 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:13:46 +02:00
|
|
|
|
|
|
|
|
|
2021-02-03 08:07:59 +01:00
|
|
|
|
|
|
|
|
|
2024-05-07 01:13:04 +02:00
|
|
|
|
2021-02-03 08:07:59 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-03 08:08:02 +01:00
|
|
|
|
|
|
|
|
|
2025-06-17 00:44:09 +02:00
|
|
|
|
2021-02-03 08:07:59 +01:00
|
|
|
|
2024-05-07 01:13:46 +02:00
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:13:04 +02:00
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-06-17 00:44:14 +02:00
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-03 08:07:59 +01:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-03 08:08:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:11:58 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
2024-03-05 04:15:23 -08:00
|
|
|
|
2021-02-03 08:08:00 +01:00
|
|
|
|
2016-05-09 00:55:48 +02: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
|
|
|
|
2021-02-03 08:08:04 +01:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:11:58 +02:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-03-05 04:15:21 -08:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
2024-08-29 14:33:37 +02:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
2024-05-07 01:11:58 +02:00
|
|
|
|
2024-03-05 04:15:23 -08:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-03 08:07:59 +01:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
2019-12-11 08:23:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-04 17:40:42 +01:00
|
|
|
|
|
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
2022-03-04 17:40:42 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-04 17:40:42 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
|
|
|
|
|
2022-03-04 17:40:42 +01:00
|
|
|
|
2024-05-07 01:11:28 +02:00
|
|
|
|
|
|
|
|
|
2022-03-04 17:40:42 +01:00
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
2022-03-04 17:40:42 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
2022-03-04 17:40:42 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rtnetlink: Pack newlink() params into struct
There are 4 net namespaces involved when creating links:
- source netns - where the netlink socket resides,
- target netns - where to put the device being created,
- link netns - netns associated with the device (backend),
- peer netns - netns of peer device.
Currently, two nets are passed to newlink() callback - "src_net"
parameter and "dev_net" (implicitly in net_device). They are set as
follows, depending on netlink attributes in the request.
+------------+-------------------+---------+---------+
| peer netns | IFLA_LINK_NETNSID | src_net | dev_net |
+------------+-------------------+---------+---------+
| | absent | source | target |
| absent +-------------------+---------+---------+
| | present | link | link |
+------------+-------------------+---------+---------+
| | absent | peer | target |
| present +-------------------+---------+---------+
| | present | peer | link |
+------------+-------------------+---------+---------+
When IFLA_LINK_NETNSID is present, the device is created in link netns
first and then moved to target netns. This has some side effects,
including extra ifindex allocation, ifname validation and link events.
These could be avoided if we create it in target netns from
the beginning.
On the other hand, the meaning of src_net parameter is ambiguous. It
varies depending on how parameters are passed. It is the effective
link (or peer netns) by design, but some drivers ignore it and use
dev_net instead.
To provide more netns context for drivers, this patch packs existing
newlink() parameters, along with the source netns, link netns and peer
netns, into a struct. The old "src_net" is renamed to "net" to avoid
confusion with real source netns, and will be deprecated later. The use
of src_net are converted to params->net trivially.
Signed-off-by: Xiao Liang <shaw.leon@gmail.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Link: https://patch.msgid.link/20250219125039.18024-3-shaw.leon@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-02-19 20:50:28 +08:00
|
|
|
|
|
|
|
|
|
2017-06-25 23:55:59 +02:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
2025-02-19 20:50:29 +08:00
|
|
|
|
rtnetlink: Pack newlink() params into struct
There are 4 net namespaces involved when creating links:
- source netns - where the netlink socket resides,
- target netns - where to put the device being created,
- link netns - netns associated with the device (backend),
- peer netns - netns of peer device.
Currently, two nets are passed to newlink() callback - "src_net"
parameter and "dev_net" (implicitly in net_device). They are set as
follows, depending on netlink attributes in the request.
+------------+-------------------+---------+---------+
| peer netns | IFLA_LINK_NETNSID | src_net | dev_net |
+------------+-------------------+---------+---------+
| | absent | source | target |
| absent +-------------------+---------+---------+
| | present | link | link |
+------------+-------------------+---------+---------+
| | absent | peer | target |
| present +-------------------+---------+---------+
| | present | peer | link |
+------------+-------------------+---------+---------+
When IFLA_LINK_NETNSID is present, the device is created in link netns
first and then moved to target netns. This has some side effects,
including extra ifindex allocation, ifname validation and link events.
These could be avoided if we create it in target netns from
the beginning.
On the other hand, the meaning of src_net parameter is ambiguous. It
varies depending on how parameters are passed. It is the effective
link (or peer netns) by design, but some drivers ignore it and use
dev_net instead.
To provide more netns context for drivers, this patch packs existing
newlink() parameters, along with the source netns, link netns and peer
netns, into a struct. The old "src_net" is renamed to "net" to avoid
confusion with real source netns, and will be deprecated later. The use
of src_net are converted to params->net trivially.
Signed-off-by: Xiao Liang <shaw.leon@gmail.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Link: https://patch.msgid.link/20250219125039.18024-3-shaw.leon@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-02-19 20:50:28 +08:00
|
|
|
|
2022-03-04 17:40:42 +01:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
2017-03-09 17:42:57 +01:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
2019-12-11 08:23:48 +00:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
2019-12-11 08:23:48 +00:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
2019-12-11 08:23:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
2022-03-04 17:40:42 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-11-08 11:41:45 +01:00
|
|
|
|
|
|
|
|
|
2022-03-04 17:40:43 +01:00
|
|
|
|
2025-02-19 20:50:29 +08:00
|
|
|
|
2022-03-04 17:40:42 +01:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
2020-10-27 20:48:46 +09:00
|
|
|
|
|
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-04 17:40:42 +01:00
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
|
|
|
|
|
2020-10-27 20:48:46 +09:00
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-27 20:48:46 +09:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
2025-02-19 20:50:29 +08:00
|
|
|
|
2025-01-10 10:47:52 +09:00
|
|
|
|
2019-12-11 08:23:34 +00:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
2021-02-03 08:07:59 +01:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-10-27 20:48:46 +09:00
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
2019-12-11 08:23:34 +00:00
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-04-22 05:39:30 -04:00
|
|
|
|
2019-12-11 08:23:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-04-22 05:39:30 -04:00
|
|
|
|
2019-12-11 08:23:34 +00:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
2025-01-10 10:47:52 +09:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-24 23:23:21 +01:00
|
|
|
|
2022-03-04 17:40:42 +01:00
|
|
|
|
2022-03-04 17:40:43 +01:00
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
2017-06-25 23:56:01 +02:00
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-03 08:08:01 +01:00
|
|
|
|
2022-03-04 17:40:43 +01:00
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-03 08:08:01 +01:00
|
|
|
|
|
|
|
|
|
2022-03-04 17:40:43 +01:00
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
treewide: Replace kmalloc with kmalloc_obj for non-scalar types
This is the result of running the Coccinelle script from
scripts/coccinelle/api/kmalloc_objs.cocci. The script is designed to
avoid scalar types (which need careful case-by-case checking), and
instead replace kmalloc-family calls that allocate struct or union
object instances:
Single allocations: kmalloc(sizeof(TYPE), ...)
are replaced with: kmalloc_obj(TYPE, ...)
Array allocations: kmalloc_array(COUNT, sizeof(TYPE), ...)
are replaced with: kmalloc_objs(TYPE, COUNT, ...)
Flex array allocations: kmalloc(struct_size(PTR, FAM, COUNT), ...)
are replaced with: kmalloc_flex(*PTR, FAM, COUNT, ...)
(where TYPE may also be *VAR)
The resulting allocations no longer return "void *", instead returning
"TYPE *".
Signed-off-by: Kees Cook <kees@kernel.org>
2026-02-20 23:49:23 -08:00
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
treewide: Replace kmalloc with kmalloc_obj for non-scalar types
This is the result of running the Coccinelle script from
scripts/coccinelle/api/kmalloc_objs.cocci. The script is designed to
avoid scalar types (which need careful case-by-case checking), and
instead replace kmalloc-family calls that allocate struct or union
object instances:
Single allocations: kmalloc(sizeof(TYPE), ...)
are replaced with: kmalloc_obj(TYPE, ...)
Array allocations: kmalloc_array(COUNT, sizeof(TYPE), ...)
are replaced with: kmalloc_objs(TYPE, COUNT, ...)
Flex array allocations: kmalloc(struct_size(PTR, FAM, COUNT), ...)
are replaced with: kmalloc_flex(*PTR, FAM, COUNT, ...)
(where TYPE may also be *VAR)
The resulting allocations no longer return "void *", instead returning
"TYPE *".
Signed-off-by: Kees Cook <kees@kernel.org>
2026-02-20 23:49:23 -08:00
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-03 08:07:59 +01:00
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
2021-02-03 08:07:59 +01:00
|
|
|
|
2017-03-09 17:42:57 +01:00
|
|
|
|
2021-02-03 08:07:59 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-08-25 12:16:38 -07:00
|
|
|
|
2021-02-03 08:07:59 +01:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
2020-01-21 23:17:14 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-03 08:07:59 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-01-21 23:17:14 -08:00
|
|
|
|
|
|
|
|
|
2021-02-03 08:07:59 +01:00
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
2017-03-09 17:42:57 +01:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
2017-03-09 17:42:57 +01:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-09 17:42:57 +01:00
|
|
|
|
2021-02-03 08:07:59 +01:00
|
|
|
|
|
|
|
|
|
2019-07-03 00:20:51 +09:00
|
|
|
|
2021-02-03 08:07:59 +01:00
|
|
|
|
2021-01-09 23:00:21 -08:00
|
|
|
|
2021-02-03 08:07:59 +01:00
|
|
|
|
2021-01-09 23:00:21 -08:00
|
|
|
|
|
|
|
|
|
2021-02-03 08:07:59 +01:00
|
|
|
|
2017-03-09 17:42:57 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-04 17:40:42 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-09 17:42:57 +01:00
|
|
|
|
|
|
|
|
|
2024-10-22 16:48:25 +02:00
|
|
|
|
2017-03-09 17:42:57 +01:00
|
|
|
|
2024-10-22 16:48:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-09 17:42:57 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-10-22 16:48:25 +02:00
|
|
|
|
2017-03-09 17:42:57 +01:00
|
|
|
|
2024-10-22 16:48:25 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-09 17:42:57 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-09 17:42:57 +01:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
2017-03-09 17:42:58 +01:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
2017-03-09 17:42:58 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
2017-03-09 17:42:58 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-05-23 18:18:37 -05:00
|
|
|
|
2017-03-09 17:42:58 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:13:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
|
|
|
|
|
2024-05-07 01:13:46 +02:00
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:12:21 +02:00
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
2024-05-07 01:13:46 +02:00
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
2024-05-07 01:12:21 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
2024-05-07 01:12:21 +02:00
|
|
|
|
|
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
|
|
|
|
|
2020-08-27 14:19:23 +02:00
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
2019-12-11 08:23:00 +00:00
|
|
|
|
2017-03-09 17:42:58 +01:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
2019-12-11 08:23:00 +00:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
2019-12-11 08:23:00 +00:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
2024-11-08 11:41:45 +01:00
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:13:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:13:46 +02:00
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:13:46 +02:00
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-12-11 08:23:00 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:14:00 +02:00
|
|
|
|
|
|
|
|
|
2019-12-11 08:23:00 +00:00
|
|
|
|
|
|
|
|
|
2024-05-07 01:14:00 +02:00
|
|
|
|
|
|
|
|
|
2019-12-11 08:23:00 +00:00
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-08-27 14:19:23 +02:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
2020-08-27 14:19:23 +02:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
2019-12-11 08:23:00 +00:00
|
|
|
|
2020-08-27 14:19:23 +02:00
|
|
|
|
2019-12-11 08:23:00 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:12:21 +02:00
|
|
|
|
|
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-08-27 14:19:23 +02:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
treewide: Replace kmalloc with kmalloc_obj for non-scalar types
This is the result of running the Coccinelle script from
scripts/coccinelle/api/kmalloc_objs.cocci. The script is designed to
avoid scalar types (which need careful case-by-case checking), and
instead replace kmalloc-family calls that allocate struct or union
object instances:
Single allocations: kmalloc(sizeof(TYPE), ...)
are replaced with: kmalloc_obj(TYPE, ...)
Array allocations: kmalloc_array(COUNT, sizeof(TYPE), ...)
are replaced with: kmalloc_objs(TYPE, COUNT, ...)
Flex array allocations: kmalloc(struct_size(PTR, FAM, COUNT), ...)
are replaced with: kmalloc_flex(*PTR, FAM, COUNT, ...)
(where TYPE may also be *VAR)
The resulting allocations no longer return "void *", instead returning
"TYPE *".
Signed-off-by: Kees Cook <kees@kernel.org>
2026-02-20 23:49:23 -08:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
2020-08-27 14:19:23 +02:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
2017-03-09 17:43:02 +01:00
|
|
|
|
|
|
|
|
|
2017-03-09 17:42:59 +01:00
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:13:46 +02:00
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:13:46 +02:00
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:12:21 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:11:58 +02:00
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:11:58 +02:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-08-27 14:19:23 +02:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
2017-03-09 17:43:02 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-09 17:43:01 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-09 17:43:02 +01:00
|
|
|
|
2017-03-09 17:43:01 +01:00
|
|
|
|
|
|
|
|
|
2020-08-28 15:30:56 +02:00
|
|
|
|
2020-08-27 14:19:23 +02:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
2017-03-09 17:43:02 +01:00
|
|
|
|
2020-08-27 14:19:23 +02:00
|
|
|
|
2017-03-09 17:42:58 +01:00
|
|
|
|
2017-03-09 17:43:02 +01:00
|
|
|
|
2017-03-09 17:42:58 +01:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
2017-03-09 17:43:02 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-07-03 00:22:25 +09:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
2017-03-09 17:42:58 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-05-12 17:16:31 +02:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
2017-03-09 17:43:02 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-08-27 14:19:23 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-08-28 15:30:56 +02:00
|
|
|
|
2020-08-27 14:19:23 +02:00
|
|
|
|
|
|
|
|
|
2017-03-09 17:42:58 +01:00
|
|
|
|
|
|
|
|
|
2019-07-03 00:22:25 +09:00
|
|
|
|
2017-03-09 17:42:58 +01:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
2017-03-09 17:43:00 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:14:00 +02:00
|
|
|
|
|
|
|
|
|
2024-11-08 11:41:45 +01:00
|
|
|
|
2017-03-09 17:43:00 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:14:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-09 17:43:00 +01:00
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:14:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:12:21 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
2017-03-09 17:43:00 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:14:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-09 17:43:00 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-09 17:42:58 +01:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
2017-03-09 17:43:00 +01:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
2017-03-09 17:42:58 +01:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
2017-03-09 17:43:00 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-09 17:42:58 +01:00
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
2017-03-09 17:43:00 +01:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
2017-03-09 17:43:00 +01:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
2020-08-28 15:30:56 +02:00
|
|
|
|
2017-03-09 17:43:01 +01:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
2017-03-09 17:42:58 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-04-30 14:01:36 +09:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-04-30 14:01:36 +09:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-08-25 14:59:40 +02:00
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
|
|
|
|
|
2024-05-07 01:13:46 +02:00
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:13:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-08-28 15:30:56 +02:00
|
|
|
|
2020-08-27 14:19:23 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-08-28 15:30:56 +02:00
|
|
|
|
2020-08-27 14:19:23 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-09 17:43:00 +01:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-09 17:42:58 +01:00
|
|
|
|
2017-03-09 17:43:00 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-04-30 14:01:36 +09:00
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-12-11 08:23:17 +00:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
2025-01-10 10:47:52 +09:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-12-11 08:23:17 +00:00
|
|
|
|
2025-01-10 10:47:52 +09:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-12-11 08:23:17 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-04-30 14:01:36 +09:00
|
|
|
|
2019-12-11 08:23:17 +00:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
2019-12-11 08:23:17 +00:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-12-11 08:23:17 +00:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
2019-12-11 08:23:17 +00:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
2019-12-11 08:23:17 +00:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-12-11 08:23:17 +00:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-04 17:40:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-14 17:41:37 +01:00
|
|
|
|
2022-03-04 17:40:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ipv4: Convert ->flowi4_tos to dscp_t.
Convert the ->flowic_tos field of struct flowi_common from __u8 to
dscp_t, rename it ->flowic_dscp and propagate these changes to struct
flowi and struct flowi4.
We've had several bugs in the past where ECN bits could interfere with
IPv4 routing, because these bits were not properly cleared when setting
->flowi4_tos. These bugs should be fixed now and the dscp_t type has
been introduced to ensure that variables carrying DSCP values don't
accidentally have any ECN bits set. Several variables and structure
fields have been converted to dscp_t already, but the main IPv4 routing
structure, struct flowi4, is still using a __u8. To avoid any future
regression, this patch converts it to dscp_t.
There are many users to convert at once. Fortunately, around half of
->flowi4_tos users already have a dscp_t value at hand, which they
currently convert to __u8 using inet_dscp_to_dsfield(). For all of
these users, we just need to drop that conversion.
But, although we try to do the __u8 <-> dscp_t conversions at the
boundaries of the network or of user space, some places still store
TOS/DSCP variables as __u8 in core networking code. Those can hardly be
converted either because the data structure is part of UAPI or because
the same variable or field is also used for handling ECN in other parts
of the code. In all of these cases where we don't have a dscp_t
variable at hand, we need to use inet_dsfield_to_dscp() when
interacting with ->flowi4_dscp.
Changes since v1:
* Fix space alignment in __bpf_redirect_neigh_v4() (Ido).
Signed-off-by: Guillaume Nault <gnault@redhat.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Link: https://patch.msgid.link/29acecb45e911d17446b9a3dbdb1ab7b821ea371.1756128932.git.gnault@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-08-25 15:37:43 +02:00
|
|
|
|
2022-03-04 17:40:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-06-17 00:44:09 +02:00
|
|
|
|
2022-03-04 17:40:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2018-07-18 09:32:44 -07:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-03-24 23:23:20 +01:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-05-07 01:12:08 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
2020-10-02 14:49:54 -07:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
2019-04-26 14:07:31 +02:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-04-26 14:07:31 +02:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-04-26 14:07:31 +02:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-04 17:40:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
2016-10-24 14:40:05 +02:00
|
|
|
|
2016-10-24 14:40:03 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
genetlink: make policy common to family
Since maxattr is common, the policy can't really differ sanely,
so make it common as well.
The only user that did in fact manage to make a non-common policy
is taskstats, which has to be really careful about it (since it's
still using a common maxattr!). This is no longer supported, but
we can fake it using pre_doit.
This reduces the size of e.g. nl80211.o (which has lots of commands):
text data bss dec hex filename
398745 14323 2240 415308 6564c net/wireless/nl80211.o (before)
397913 14331 2240 414484 65314 net/wireless/nl80211.o (after)
--------------------------------
-832 +8 0 -824
Which is obviously just 8 bytes for each command, and an added 8
bytes for the new policy pointer. I'm not sure why the ops list is
counted as .text though.
Most of the code transformations were done using the following spatch:
@ops@
identifier OPS;
expression POLICY;
@@
struct genl_ops OPS[] = {
...,
{
- .policy = POLICY,
},
...
};
@@
identifier ops.OPS;
expression ops.POLICY;
identifier fam;
expression M;
@@
struct genl_family fam = {
.ops = OPS,
.maxattr = M,
+ .policy = POLICY,
...
};
This also gets rid of devlink_nl_cmd_region_read_dumpit() accessing
the cb->data as ops, which we want to change in a later genl patch.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-03-21 22:51:02 +01:00
|
|
|
|
2016-10-24 14:40:03 +02:00
|
|
|
|
|
|
|
|
|
2020-10-02 14:49:54 -07:00
|
|
|
|
|
|
|
|
|
2022-08-24 17:18:30 -07:00
|
|
|
|
2020-08-27 14:19:23 +02:00
|
|
|
|
|
|
|
|
|
2016-10-24 14:40:03 +02:00
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-04-11 13:52:40 -07:00
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
2025-04-11 13:52:40 -07:00
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
2025-04-11 13:52:40 -07:00
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-04-11 13:52:40 -07:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-28 14:47:03 +03:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-28 14:47:03 +03:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
2024-02-28 14:47:03 +03:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
2024-02-14 19:27:33 +03:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
2024-02-28 14:47:03 +03:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
2021-02-03 08:07:59 +01:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-02-28 14:47:03 +03:00
|
|
|
|
|
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-07-03 00:23:42 +09:00
|
|
|
|
2016-05-09 00:55:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-27 10:40:56 +01:00
|
|
|
|