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)
Mon, Nov 4, 11:04 AM
Unknown Object (File)
Tue, Oct 22, 12:24 AM
Unknown Object (File)
Sat, Oct 19, 2:53 AM
Unknown Object (File)
Thu, Oct 10, 12:22 PM
Unknown Object (File)
Oct 2 2024, 6:22 AM
Unknown Object (File)
Sep 27 2024, 8:56 AM
Unknown Object (File)
Sep 26 2024, 5:09 PM
Unknown Object (File)
Sep 24 2024, 10:40 AM

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 Not Applicable
Unit
Tests Not Applicable

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.