* [PATCH net-next 0/2] ipv4: Prepare bpf helpers to .flowi4_tos conversion.
@ 2024-11-08 16:47 Guillaume Nault
2024-11-08 16:47 ` [PATCH net-next 1/2] bpf: ipv4: Prepare __bpf_redirect_neigh_v4() to future " Guillaume Nault
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Guillaume Nault @ 2024-11-08 16:47 UTC (permalink / raw)
To: David Miller, Jakub Kicinski, Paolo Abeni, Eric Dumazet
Cc: netdev, Simon Horman, Martin KaFai Lau, Daniel Borkmann,
John Fastabend, Alexei Starovoitov, Andrii Nakryiko,
Eduard Zingerman, Song Liu, Yonghong Song, KP Singh,
Stanislav Fomichev, Hao Luo, Jiri Olsa, Ido Schimmel, bpf
Continue the process of making a dscp_t variable available when setting
.flowi4_tos. This series focuses on the BPF helpers that initialise a
struct flowi4 manually.
The objective is to eventually convert .flowi4_tos to dscp_t, (to get
type annotation and prevent ECN bits from interfering with DSCP).
Guillaume Nault (2):
ipv4: Prepare __bpf_redirect_neigh_v4() to future .flowi4_tos
conversion.
ipv4: Prepare bpf_lwt_xmit_reroute() to future .flowi4_tos conversion.
net/core/filter.c | 2 +-
net/core/lwt_bpf.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
--
2.39.2
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH net-next 1/2] bpf: ipv4: Prepare __bpf_redirect_neigh_v4() to future .flowi4_tos conversion.
2024-11-08 16:47 [PATCH net-next 0/2] ipv4: Prepare bpf helpers to .flowi4_tos conversion Guillaume Nault
@ 2024-11-08 16:47 ` Guillaume Nault
2024-11-10 14:21 ` Ido Schimmel
2024-11-08 16:47 ` [PATCH net-next 2/2] bpf: lwtunnel: Prepare bpf_lwt_xmit_reroute() " Guillaume Nault
` (2 subsequent siblings)
3 siblings, 1 reply; 7+ messages in thread
From: Guillaume Nault @ 2024-11-08 16:47 UTC (permalink / raw)
To: David Miller, Jakub Kicinski, Paolo Abeni, Eric Dumazet
Cc: netdev, Simon Horman, Martin KaFai Lau, Daniel Borkmann,
John Fastabend, Alexei Starovoitov, Andrii Nakryiko,
Eduard Zingerman, Song Liu, Yonghong Song, KP Singh,
Stanislav Fomichev, Hao Luo, Jiri Olsa, Ido Schimmel, bpf
Use ip4h_dscp() to get the DSCP from the IPv4 header, then convert the
dscp_t value to __u8 with inet_dscp_to_dsfield().
Then, when we'll convert .flowi4_tos to dscp_t, we'll just have to drop
the inet_dscp_to_dsfield() call.
Signed-off-by: Guillaume Nault <gnault@redhat.com>
---
net/core/filter.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/core/filter.c b/net/core/filter.c
index 82f92ed0dc72..c3a722134ca1 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -2355,7 +2355,7 @@ static int __bpf_redirect_neigh_v4(struct sk_buff *skb, struct net_device *dev,
struct flowi4 fl4 = {
.flowi4_flags = FLOWI_FLAG_ANYSRC,
.flowi4_mark = skb->mark,
- .flowi4_tos = ip4h->tos & INET_DSCP_MASK,
+ .flowi4_tos = inet_dscp_to_dsfield(ip4h_dscp(ip4h)),
.flowi4_oif = dev->ifindex,
.flowi4_proto = ip4h->protocol,
.daddr = ip4h->daddr,
--
2.39.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH net-next 2/2] bpf: lwtunnel: Prepare bpf_lwt_xmit_reroute() to future .flowi4_tos conversion.
2024-11-08 16:47 [PATCH net-next 0/2] ipv4: Prepare bpf helpers to .flowi4_tos conversion Guillaume Nault
2024-11-08 16:47 ` [PATCH net-next 1/2] bpf: ipv4: Prepare __bpf_redirect_neigh_v4() to future " Guillaume Nault
@ 2024-11-08 16:47 ` Guillaume Nault
2024-11-10 14:22 ` Ido Schimmel
2024-11-12 3:04 ` [PATCH net-next 0/2] ipv4: Prepare bpf helpers to " Jakub Kicinski
2024-11-15 3:30 ` patchwork-bot+netdevbpf
3 siblings, 1 reply; 7+ messages in thread
From: Guillaume Nault @ 2024-11-08 16:47 UTC (permalink / raw)
To: David Miller, Jakub Kicinski, Paolo Abeni, Eric Dumazet
Cc: netdev, Simon Horman, Martin KaFai Lau, Daniel Borkmann,
John Fastabend, Alexei Starovoitov, Andrii Nakryiko,
Eduard Zingerman, Song Liu, Yonghong Song, KP Singh,
Stanislav Fomichev, Hao Luo, Jiri Olsa, Ido Schimmel, bpf
Use ip4h_dscp() to get the DSCP from the IPv4 header, then convert the
dscp_t value to __u8 with inet_dscp_to_dsfield().
Then, when we'll convert .flowi4_tos to dscp_t, we'll just have to drop
the inet_dscp_to_dsfield() call.
Signed-off-by: Guillaume Nault <gnault@redhat.com>
---
net/core/lwt_bpf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/core/lwt_bpf.c b/net/core/lwt_bpf.c
index e0ca24a58810..6655af5c267d 100644
--- a/net/core/lwt_bpf.c
+++ b/net/core/lwt_bpf.c
@@ -207,7 +207,7 @@ static int bpf_lwt_xmit_reroute(struct sk_buff *skb)
fl4.flowi4_oif = oif;
fl4.flowi4_mark = skb->mark;
fl4.flowi4_uid = sock_net_uid(net, sk);
- fl4.flowi4_tos = iph->tos & INET_DSCP_MASK;
+ fl4.flowi4_tos = inet_dscp_to_dsfield(ip4h_dscp(iph));
fl4.flowi4_flags = FLOWI_FLAG_ANYSRC;
fl4.flowi4_proto = iph->protocol;
fl4.daddr = iph->daddr;
--
2.39.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH net-next 1/2] bpf: ipv4: Prepare __bpf_redirect_neigh_v4() to future .flowi4_tos conversion.
2024-11-08 16:47 ` [PATCH net-next 1/2] bpf: ipv4: Prepare __bpf_redirect_neigh_v4() to future " Guillaume Nault
@ 2024-11-10 14:21 ` Ido Schimmel
0 siblings, 0 replies; 7+ messages in thread
From: Ido Schimmel @ 2024-11-10 14:21 UTC (permalink / raw)
To: Guillaume Nault
Cc: David Miller, Jakub Kicinski, Paolo Abeni, Eric Dumazet, netdev,
Simon Horman, Martin KaFai Lau, Daniel Borkmann, John Fastabend,
Alexei Starovoitov, Andrii Nakryiko, Eduard Zingerman, Song Liu,
Yonghong Song, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
bpf
On Fri, Nov 08, 2024 at 05:47:12PM +0100, Guillaume Nault wrote:
> Use ip4h_dscp() to get the DSCP from the IPv4 header, then convert the
> dscp_t value to __u8 with inet_dscp_to_dsfield().
>
> Then, when we'll convert .flowi4_tos to dscp_t, we'll just have to drop
> the inet_dscp_to_dsfield() call.
>
> Signed-off-by: Guillaume Nault <gnault@redhat.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH net-next 2/2] bpf: lwtunnel: Prepare bpf_lwt_xmit_reroute() to future .flowi4_tos conversion.
2024-11-08 16:47 ` [PATCH net-next 2/2] bpf: lwtunnel: Prepare bpf_lwt_xmit_reroute() " Guillaume Nault
@ 2024-11-10 14:22 ` Ido Schimmel
0 siblings, 0 replies; 7+ messages in thread
From: Ido Schimmel @ 2024-11-10 14:22 UTC (permalink / raw)
To: Guillaume Nault
Cc: David Miller, Jakub Kicinski, Paolo Abeni, Eric Dumazet, netdev,
Simon Horman, Martin KaFai Lau, Daniel Borkmann, John Fastabend,
Alexei Starovoitov, Andrii Nakryiko, Eduard Zingerman, Song Liu,
Yonghong Song, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
bpf
On Fri, Nov 08, 2024 at 05:47:15PM +0100, Guillaume Nault wrote:
> Use ip4h_dscp() to get the DSCP from the IPv4 header, then convert the
> dscp_t value to __u8 with inet_dscp_to_dsfield().
>
> Then, when we'll convert .flowi4_tos to dscp_t, we'll just have to drop
> the inet_dscp_to_dsfield() call.
>
> Signed-off-by: Guillaume Nault <gnault@redhat.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH net-next 0/2] ipv4: Prepare bpf helpers to .flowi4_tos conversion.
2024-11-08 16:47 [PATCH net-next 0/2] ipv4: Prepare bpf helpers to .flowi4_tos conversion Guillaume Nault
2024-11-08 16:47 ` [PATCH net-next 1/2] bpf: ipv4: Prepare __bpf_redirect_neigh_v4() to future " Guillaume Nault
2024-11-08 16:47 ` [PATCH net-next 2/2] bpf: lwtunnel: Prepare bpf_lwt_xmit_reroute() " Guillaume Nault
@ 2024-11-12 3:04 ` Jakub Kicinski
2024-11-15 3:30 ` patchwork-bot+netdevbpf
3 siblings, 0 replies; 7+ messages in thread
From: Jakub Kicinski @ 2024-11-12 3:04 UTC (permalink / raw)
To: Daniel Borkmann
Cc: Guillaume Nault, David Miller, Paolo Abeni, Eric Dumazet, netdev,
Simon Horman, Martin KaFai Lau, John Fastabend,
Alexei Starovoitov, Andrii Nakryiko, Eduard Zingerman, Song Liu,
Yonghong Song, KP Singh, Stanislav Fomichev, Hao Luo, Jiri Olsa,
Ido Schimmel, bpf
On Fri, 8 Nov 2024 17:47:09 +0100 Guillaume Nault wrote:
> Continue the process of making a dscp_t variable available when setting
> .flowi4_tos. This series focuses on the BPF helpers that initialise a
> struct flowi4 manually.
>
> The objective is to eventually convert .flowi4_tos to dscp_t, (to get
> type annotation and prevent ECN bits from interfering with DSCP).
Daniel, feel free to take this or we can take with your ack..
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH net-next 0/2] ipv4: Prepare bpf helpers to .flowi4_tos conversion.
2024-11-08 16:47 [PATCH net-next 0/2] ipv4: Prepare bpf helpers to .flowi4_tos conversion Guillaume Nault
` (2 preceding siblings ...)
2024-11-12 3:04 ` [PATCH net-next 0/2] ipv4: Prepare bpf helpers to " Jakub Kicinski
@ 2024-11-15 3:30 ` patchwork-bot+netdevbpf
3 siblings, 0 replies; 7+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-11-15 3:30 UTC (permalink / raw)
To: Guillaume Nault
Cc: davem, kuba, pabeni, edumazet, netdev, horms, martin.lau, daniel,
john.fastabend, ast, andrii, eddyz87, song, yonghong.song,
kpsingh, sdf, haoluo, jolsa, idosch, bpf
Hello:
This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Fri, 8 Nov 2024 17:47:09 +0100 you wrote:
> Continue the process of making a dscp_t variable available when setting
> .flowi4_tos. This series focuses on the BPF helpers that initialise a
> struct flowi4 manually.
>
> The objective is to eventually convert .flowi4_tos to dscp_t, (to get
> type annotation and prevent ECN bits from interfering with DSCP).
>
> [...]
Here is the summary with links:
- [net-next,1/2] bpf: ipv4: Prepare __bpf_redirect_neigh_v4() to future .flowi4_tos conversion.
https://git.kernel.org/netdev/net-next/c/bfe086be5c4c
- [net-next,2/2] bpf: lwtunnel: Prepare bpf_lwt_xmit_reroute() to future .flowi4_tos conversion.
https://git.kernel.org/netdev/net-next/c/dab9c6307161
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-11-15 3:30 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-08 16:47 [PATCH net-next 0/2] ipv4: Prepare bpf helpers to .flowi4_tos conversion Guillaume Nault
2024-11-08 16:47 ` [PATCH net-next 1/2] bpf: ipv4: Prepare __bpf_redirect_neigh_v4() to future " Guillaume Nault
2024-11-10 14:21 ` Ido Schimmel
2024-11-08 16:47 ` [PATCH net-next 2/2] bpf: lwtunnel: Prepare bpf_lwt_xmit_reroute() " Guillaume Nault
2024-11-10 14:22 ` Ido Schimmel
2024-11-12 3:04 ` [PATCH net-next 0/2] ipv4: Prepare bpf helpers to " Jakub Kicinski
2024-11-15 3:30 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).