Message ID | f48335504a05b3587e0081a9b4511e0761571ca5.1730292157.git.gnault@redhat.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 0c30d6eedd1ec0c1382bcab9576d26413cd278a3 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net-next] ipvlan: Prepare ipvlan_process_v4_outbound() to future .flowi4_tos conversion. | expand |
On Wed, Oct 30, 2024 at 01:43:11PM +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>
Hello: This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <kuba@kernel.org>: On Wed, 30 Oct 2024 13:43:11 +0100 you 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> > > [...] Here is the summary with links: - [net-next] ipvlan: Prepare ipvlan_process_v4_outbound() to future .flowi4_tos conversion. https://git.kernel.org/netdev/net-next/c/0c30d6eedd1e You are awesome, thank you!
diff --git a/drivers/net/ipvlan/ipvlan_core.c b/drivers/net/ipvlan/ipvlan_core.c index b1afcb8740de..fd591ddb3884 100644 --- a/drivers/net/ipvlan/ipvlan_core.c +++ b/drivers/net/ipvlan/ipvlan_core.c @@ -3,6 +3,7 @@ */ #include <net/inet_dscp.h> +#include <net/ip.h> #include "ipvlan.h" @@ -422,7 +423,7 @@ static noinline_for_stack int ipvlan_process_v4_outbound(struct sk_buff *skb) int err, ret = NET_XMIT_DROP; struct flowi4 fl4 = { .flowi4_oif = dev->ifindex, - .flowi4_tos = ip4h->tos & INET_DSCP_MASK, + .flowi4_tos = inet_dscp_to_dsfield(ip4h_dscp(ip4h)), .flowi4_flags = FLOWI_FLAG_ANYSRC, .flowi4_mark = skb->mark, .daddr = ip4h->daddr,
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> --- drivers/net/ipvlan/ipvlan_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)