Page MenuHomeFreeBSD

net: Introduce IPV6_DSCP(), IPV6_ECN() and IPV6_TRAFFIC_CLASS() macros
ClosedPublic

Authored by kp on Mar 4 2021, 12:33 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 11, 1:31 PM
Unknown Object (File)
Thu, Apr 11, 1:31 PM
Unknown Object (File)
Sun, Mar 31, 12:22 PM
Unknown Object (File)
Mar 17 2024, 12:35 AM
Unknown Object (File)
Mar 5 2024, 4:53 AM
Unknown Object (File)
Feb 26 2024, 10:06 PM
Unknown Object (File)
Feb 9 2024, 3:47 PM
Unknown Object (File)
Jan 30 2024, 9:47 PM

Details

Summary

Introduce convenience macros to retrieve the DSCP, ECN or traffic class
bits from an IPv6 header.

Use them where appropriate.

MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

kp requested review of this revision.Mar 4 2021, 12:33 PM
This revision is now accepted and ready to land.Mar 4 2021, 12:43 PM

there are siimilar constructs in the tcp stack, when checking for ECN (extracting the "common, legacy" TOS byte first:

tcp_input.c:692: iptos = (ntohl(ip6->ip6_flow) >> 20) & 0xff;
tcp_lro.c:1549: iptos = (ntohl(ip6->ip6_flow) >> 20) & 0xff;

perhaps replace those with
iptos = IPV6_DSCP(ip6) | IPV6_ECN(ipv6);
in this patch too?

sys/netinet6/ip6_output.c
661

typo?

kp retitled this revision from net: Introduce IPV6_DSCP() and IPV6_ECN() macros to net: Introduce IPV6_DSCP(), IPV6_ECN() and IPV6_TRAFFIC_CLASS() macros.
kp edited the summary of this revision. (Show Details)
This revision now requires review to proceed.Mar 4 2021, 1:18 PM
kp marked an inline comment as done.Mar 4 2021, 1:20 PM

perhaps replace those with
iptos = IPV6_DSCP(ip6) | IPV6_ECN(ipv6);
in this patch too?

We may as well, while we're at it.
I've introduced IPV6_TRAFFIC_CLASS() for that (IPV6_TCLASS already exists), and I found a few more places where it would be suitable.

sys/netinet6/ip6_output.c
661

Whoops. Good catch. I really should have caught that myself.

This revision is now accepted and ready to land.Mar 4 2021, 1:27 PM
This revision was automatically updated to reflect the committed changes.
kp marked an inline comment as done.