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
F102431367: D29056.diff
Tue, Nov 12, 4:38 AM
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)
Oct 10 2024, 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

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.