Skip to contentSkip to conversation

net: fib_rules: Add port mask support

PATCH Applied Ido Schimmel 5 participants 15 messages Feb 17, 2025 – Feb 20, 2025

Subsystems (5)
lore
Share & tools
lore

Ido Schimmel

author maintainer
#0 lore raw

cover net: fib_rules: Add port mask support

In some deployments users would like to encode path information into certain bits of the IPv6 flow label, the UDP source port and the DSCP field and use this information to route packets accordingly.

Redirecting traffic to a routing table based on specific bits in the UDP source port is not currently possible. Only exact match and range are currently supported by FIB rules.

This patchset extends FIB rules to match on layer 4 ports with an optional mask. The mask is not supported when matching on a range. A future patchset will add support for matching on the DSCP field with an optional mask.

Patches #1-#6 gradually extend FIB rules to match on layer 4 ports with an optional mask.

Patches #7-#8 add test cases for FIB rule port matching.

iproute2 support can be found here [1].

[1] https://github.com/idosch/iproute2/tree/submit/fib_rule_mask_v1

Ido Schimmel (8):
net: fib_rules: Add port mask attributes
net: fib_rules: Add port mask support
ipv4: fib_rules: Add port mask matching
ipv6: fib_rules: Add port mask matching
net: fib_rules: Enable port mask usage
netlink: specs: Add FIB rule port mask attributes
selftests: fib_rule_tests: Add port range match tests
selftests: fib_rule_tests: Add port mask match tests

 Documentation/netlink/specs/rt_rule.yaml      | 10 +++
 include/net/fib_rules.h                       | 19 +++++
 include/uapi/linux/fib_rules.h                |  2 +
 net/core/fib_rules.c                          | 69 ++++++++++++++++++-
 net/ipv4/fib_rules.c                          |  8 +--
 net/ipv6/fib6_rules.c                         |  8 +--
 tools/testing/selftests/net/fib_rule_tests.sh | 36 ++++++++++
 7 files changed, 143 insertions(+), 9 deletions(-)
Signature · 1 line
2.48.1
author maintainer
#1 lore raw

PATCH 1/8 net: fib_rules: Add port mask attributes

Add attributes that allow matching on source and destination ports with a mask. Matching on the source port with a mask is needed in deployments where users encode path information into certain bits of the UDP source port.

Temporarily set the type of the attributes to 'NLA_REJECT' while support is being added.

---
 include/uapi/linux/fib_rules.h | 2 ++
 net/core/fib_rules.c           | 2 ++
 2 files changed, 4 insertions(+)
include/uapi/linux/fib_rules.h +2 -0
index 00e9890ca3c0..95ec01b15c65 100644
@@ -70,6 +70,8 @@ enum {
 	FRA_DSCP,	/* dscp */
 	FRA_FLOWLABEL,	/* flowlabel */
 	FRA_FLOWLABEL_MASK,	/* flowlabel mask */
+	FRA_SPORT_MASK,	/* sport mask */
+	FRA_DPORT_MASK,	/* dport mask */
 	__FRA_MAX
 };
 
net/core/fib_rules.c +2 -0
index 424b4cd4e9e5..f5b1900770ec 100644
@@ -784,6 +784,8 @@ static const struct nla_policy fib_rule_policy[FRA_MAX + 1] = {
 	[FRA_DSCP]	= NLA_POLICY_MAX(NLA_U8, INET_DSCP_MASK >> 2),
 	[FRA_FLOWLABEL] = { .type = NLA_BE32 },
 	[FRA_FLOWLABEL_MASK] = { .type = NLA_BE32 },
+	[FRA_SPORT_MASK] = { .type = NLA_REJECT },
+	[FRA_DPORT_MASK] = { .type = NLA_REJECT },
 };
 
 int fib_newrule(struct net *net, struct sk_buff *skb, struct nlmsghdr *nlh,
Signature · 1 line
2.48.1
author maintainer
#2 lore raw

PATCH 2/8 net: fib_rules: Add port mask support

In reply to Ido Schimmel

Add support for configuring and deleting rules that match on source and destination ports using a mask as well as support for dumping such rules to user space.

---
 include/net/fib_rules.h |  8 +++++
 net/core/fib_rules.c    | 67 ++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 74 insertions(+), 1 deletion(-)
include/net/fib_rules.h +8 -0
index 710caacad9da..cfeb2fd0f5db 100644
@@ -43,6 +43,8 @@ struct fib_rule {
 	struct fib_kuid_range	uid_range;
 	struct fib_rule_port_range	sport_range;
 	struct fib_rule_port_range	dport_range;
+	u16			sport_mask;
+	u16			dport_mask;
 	struct rcu_head		rcu;
 };
 
@@ -159,6 +161,12 @@ static inline bool fib_rule_port_range_compare(struct fib_rule_port_range *a,
 		a->end == b->end;
 }
 
+static inline bool
+fib_rule_port_is_range(const struct fib_rule_port_range *range)
+{
+	return range->start != range->end;
+}
+
 static inline bool fib_rule_requires_fldissect(struct fib_rule *rule)
 {
 	return rule->iifindex != LOOPBACK_IFINDEX && (rule->ip_proto ||
net/core/fib_rules.c +66 -1

120 lines not on this page · raw message

Signature · 1 line
2.48.1
author maintainer
#3 lore raw

PATCH 3/8 ipv4: fib_rules: Add port mask matching

In reply to Ido Schimmel

Extend IPv4 FIB rules to match on source and destination ports using a mask. Note that the mask is only set when not matching on a range.

---
 include/net/fib_rules.h | 11 +++++++++++
 net/ipv4/fib_rules.c    |  8 ++++----
 2 files changed, 15 insertions(+), 4 deletions(-)
include/net/fib_rules.h +11 -0
index cfeb2fd0f5db..5927910ec06e 100644
@@ -148,6 +148,17 @@ static inline bool fib_rule_port_inrange(const struct fib_rule_port_range *a,
 		ntohs(port) <= a->end;
 }
 
+static inline bool fib_rule_port_match(const struct fib_rule_port_range *range,
+				       u16 port_mask, __be16 port)
+{
+	if ((range->start ^ ntohs(port)) & port_mask)
+		return false;
+	if (!port_mask && fib_rule_port_range_set(range) &&
+	    !fib_rule_port_inrange(range, port))
+		return false;
+	return true;
+}
+
 static inline bool fib_rule_port_range_valid(const struct fib_rule_port_range *a)
 {
 	return a->start != 0 && a->end != 0 && a->end < 0xffff &&
net/ipv4/fib_rules.c +4 -4
index 041c46787d94..6b3d6a957822 100644
@@ -201,12 +201,12 @@ INDIRECT_CALLABLE_SCOPE int fib4_rule_match(struct fib_rule *rule,
 	if (rule->ip_proto && (rule->ip_proto != fl4->flowi4_proto))
 		return 0;
 
-	if (fib_rule_port_range_set(&rule->sport_range) &&
-	    !fib_rule_port_inrange(&rule->sport_range, fl4->fl4_sport))
+	if (!fib_rule_port_match(&rule->sport_range, rule->sport_mask,
+				 fl4->fl4_sport))
 		return 0;
 
-	if (fib_rule_port_range_set(&rule->dport_range) &&
-	    !fib_rule_port_inrange(&rule->dport_range, fl4->fl4_dport))
+	if (!fib_rule_port_match(&rule->dport_range, rule->dport_mask,
+				 fl4->fl4_dport))
 		return 0;
 
 	return 1;
Signature · 1 line
2.48.1
author maintainer
#4 lore raw

PATCH 4/8 ipv6: fib_rules: Add port mask matching

In reply to Ido Schimmel

Extend IPv6 FIB rules to match on source and destination ports using a mask. Note that the mask is only set when not matching on a range.

---
 net/ipv6/fib6_rules.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
net/ipv6/fib6_rules.c +4 -4
index 40af8fd6efa7..0144d01417d9 100644
@@ -340,12 +340,12 @@ INDIRECT_CALLABLE_SCOPE int fib6_rule_match(struct fib_rule *rule,
 	if (rule->ip_proto && (rule->ip_proto != fl6->flowi6_proto))
 		return 0;
 
-	if (fib_rule_port_range_set(&rule->sport_range) &&
-	    !fib_rule_port_inrange(&rule->sport_range, fl6->fl6_sport))
+	if (!fib_rule_port_match(&rule->sport_range, rule->sport_mask,
+				 fl6->fl6_sport))
 		return 0;
 
-	if (fib_rule_port_range_set(&rule->dport_range) &&
-	    !fib_rule_port_inrange(&rule->dport_range, fl6->fl6_dport))
+	if (!fib_rule_port_match(&rule->dport_range, rule->dport_mask,
+				 fl6->fl6_dport))
 		return 0;
 
 	return 1;
Signature · 1 line
2.48.1
author maintainer
#5 lore raw

PATCH 5/8 net: fib_rules: Enable port mask usage

In reply to Ido Schimmel

Allow user space to configure FIB rules that match on the source and destination ports with a mask, now that support has been added to the FIB rule core and the IPv4 and IPv6 address families.

---
 net/core/fib_rules.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
net/core/fib_rules.c +2 -2
index ba6beaa63f44..5ddd34cbe7f6 100644
@@ -843,8 +843,8 @@ static const struct nla_policy fib_rule_policy[FRA_MAX + 1] = {
 	[FRA_DSCP]	= NLA_POLICY_MAX(NLA_U8, INET_DSCP_MASK >> 2),
 	[FRA_FLOWLABEL] = { .type = NLA_BE32 },
 	[FRA_FLOWLABEL_MASK] = { .type = NLA_BE32 },
-	[FRA_SPORT_MASK] = { .type = NLA_REJECT },
-	[FRA_DPORT_MASK] = { .type = NLA_REJECT },
+	[FRA_SPORT_MASK] = { .type = NLA_U16 },
+	[FRA_DPORT_MASK] = { .type = NLA_U16 },
 };
 
 int fib_newrule(struct net *net, struct sk_buff *skb, struct nlmsghdr *nlh,
Signature · 1 line
2.48.1
#6 lore raw

Re: [PATCH net-next 5/8] net: fib_rules: Enable port mask usage

Quoted 15 lines · On Mon, 17 Feb 2025 15:41:06 +0200 Ido Schimmel <[email protected]> wrote:

Allow user space to configure FIB rules that match on the source and destination ports with a mask, now that support has been added to the FIB rule core and the IPv4 and IPv6 address families.

---
 net/core/fib_rules.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
net/core/fib_rules.c +0 -0
index ba6beaa63f44..5ddd34cbe7f6 100644

net/core/fib_rules.c static const struct nla_policy fib_rule_policy[FRA_MAX + · line 848

Quoted 8 lines
net/core/fib_rules.c +2 -2
@@ -843,8 +843,8 @@ static const struct nla_policy fib_rule_policy[FRA_MAX +
 1] = { [FRA_DSCP]	= NLA_POLICY_MAX(NLA_U8, INET_DSCP_MASK >> 2),
 	[FRA_FLOWLABEL] = { .type = NLA_BE32 },
 	[FRA_FLOWLABEL_MASK] = { .type = NLA_BE32 },
-	[FRA_SPORT_MASK] = { .type = NLA_REJECT },
-	[FRA_DPORT_MASK] = { .type = NLA_REJECT },
+	[FRA_SPORT_MASK] = { .type = NLA_U16 },
+	[FRA_DPORT_MASK] = { .type = NLA_U16 },
 };

I don't get the purpose of this patch and patch 1.
Couldn't you have patch 3 and 4 first, then patch 2 that adds the netlink and UAPI support?

Signature · 3 lines
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
author maintainer
#7 lore raw

Re: [PATCH net-next 5/8] net: fib_rules: Enable port mask usage

Quoted 22 lines · Kory Maincent
Quoted 19 lines · On Mon, 17 Feb 2025 15:41:06 +0200 Ido Schimmel <[email protected]> wrote:

Allow user space to configure FIB rules that match on the source and destination ports with a mask, now that support has been added to the FIB rule core and the IPv4 and IPv6 address families.

---
 net/core/fib_rules.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
net/core/fib_rules.c +0 -1
index ba6beaa63f44..5ddd34cbe7f6 100644
@@ -843,8 +843,8 @@ static const struct nla_policy fib_rule_policy[FRA_MAX +
 1] = { [FRA_DSCP]	= NLA_POLICY_MAX(NLA_U8, INET_DSCP_MASK >> 2),
 	[FRA_FLOWLABEL] = { .type = NLA_BE32 },
 	[FRA_FLOWLABEL_MASK] = { .type = NLA_BE32 },
-	[FRA_SPORT_MASK] = { .type = NLA_REJECT },
Quoted 8 lines

net/core/fib_rules.c static const struct nla_policy fib_rule_policy[FRA_MAX + 1] = { · line 848

Quoted 4 lines
net/core/fib_rules.c +2 -1
-	[FRA_DPORT_MASK] = { .type = NLA_REJECT },
+	[FRA_SPORT_MASK] = { .type = NLA_U16 },
+	[FRA_DPORT_MASK] = { .type = NLA_U16 },
 };

I don't get the purpose of this patch and patch 1.
Couldn't you have patch 3 and 4 first, then patch 2 that adds the netlink and UAPI support?

Current order is:

1. Add attributes as REJECT.
2. Add support in core.
3. Add support in IPv4.
4. Add support in IPv6.
5. Expose feature to user space.

Looks straight forward and easy to review to me and that's the order I prefer.

Thanks

#8 lore raw

Re: [PATCH net-next 5/8] net: fib_rules: Enable port mask usage

Quoted 34 lines · On Tue, 18 Feb 2025 20:15:49 +0200 Ido Schimmel <[email protected]> wrote:
Quoted 22 lines · Kory Maincent
Quoted 19 lines · On Mon, 17 Feb 2025 15:41:06 +0200 Ido Schimmel <[email protected]> wrote:

Allow user space to configure FIB rules that match on the source and destination ports with a mask, now that support has been added to the FIB rule core and the IPv4 and IPv6 address families.

---
 net/core/fib_rules.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
net/core/fib_rules.c +0 -0
index ba6beaa63f44..5ddd34cbe7f6 100644
@@ -843,8 +843,8 @@ static const struct nla_policy

fib_rule_policy[FRA_MAX + 1] = { [FRA_DSCP] =
NLA_POLICY_MAX(NLA_U8, INET_DSCP_MASK >> 2), [FRA_FLOWLABEL] = { .type = NLA_BE32 }, [FRA_FLOWLABEL_MASK] = { .type = NLA_BE32 },

net/core/fib_rules.c +0 -1
-	[FRA_SPORT_MASK] = { .type = NLA_REJECT },
Quoted 8 lines

net/core/fib_rules.c static const struct nla_policy fib_rule_policy[FRA_MAX + 1] = { · line 848

Quoted 4 lines
net/core/fib_rules.c +2 -1
-	[FRA_DPORT_MASK] = { .type = NLA_REJECT },
+	[FRA_SPORT_MASK] = { .type = NLA_U16 },
+	[FRA_DPORT_MASK] = { .type = NLA_U16 },
 };  

I don't get the purpose of this patch and patch 1.
Couldn't you have patch 3 and 4 first, then patch 2 that adds the netlink and UAPI support?

Current order is:

Quoted 8 lines

1. Add attributes as REJECT.
2. Add support in core.
3. Add support in IPv4.
4. Add support in IPv6.
5. Expose feature to user space.

Looks straight forward and easy to review to me and that's the order I prefer.

Ok, it is surprising to me. If there is an issue in patch 2,3 or 4. git bisect will locate patch 5 and it won't be easy to find the real patch that cause the issue. Having this type of patch series in the git history will harder the issue debugging.
I was not am not a net maintainer so I won't complain more and will let them decide.

Regards,

Signature · 3 lines
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
author maintainer
#9 lore raw

PATCH 6/8 netlink: specs: Add FIB rule port mask attributes

In reply to Ido Schimmel

Add new port mask attributes to the spec. Example:

 # ./tools/net/ynl/cli.py --spec Documentation/netlink/specs/rt_rule.yaml \
	--do newrule \
	--json '{"family": 2, "sport-range": { "start": 12345, "end": 12345 }, "sport-mask": 65535, "action": 1, "table": 1}'
 None
 # ./tools/net/ynl/cli.py --spec Documentation/netlink/specs/rt_rule.yaml \
	--do newrule \
	--json '{"family": 2, "dport-range": { "start": 54321, "end": 54321 }, "dport-mask": 65535, "action": 1, "table": 2}'
 None
 $ ./tools/net/ynl/cli.py --spec Documentation/netlink/specs/rt_rule.yaml \
	--dump getrule --json '{"family": 2}' --output-json | jq '.[]'
 [...]
 {
   "table": 2,
   "suppress-prefixlen": "0xffffffff",
   "protocol": 0,
   "priority": 32764,
   "dport-range": {
     "start": 54321,
     "end": 54321
   },
   "dport-mask": "0xffff",
   "family": 2,
   "dst-len": 0,
   "src-len": 0,
   "tos": 0,
   "action": "to-tbl",
   "flags": 0
 }
 {
   "table": 1,
   "suppress-prefixlen": "0xffffffff",
   "protocol": 0,
   "priority": 32765,
   "sport-range": {
     "start": 12345,
     "end": 12345
   },
   "sport-mask": "0xffff",
   "family": 2,
   "dst-len": 0,
   "src-len": 0,
   "tos": 0,
   "action": "to-tbl",
   "flags": 0
 }
 [...]
---
 Documentation/netlink/specs/rt_rule.yaml | 10 ++++++++++
 1 file changed, 10 insertions(+)
Documentation/netlink/specs/rt_rule.yaml +10 -0
index a9debac3058a..b30c924087fa 100644
@@ -182,6 +182,14 @@ attribute-sets:
         type: u32
         byte-order: big-endian
         display-hint: hex
+      -
+        name: sport-mask
+        type: u16
+        display-hint: hex
+      -
+        name: dport-mask
+        type: u16
+        display-hint: hex
 
 operations:
   enum-model: directional
@@ -215,6 +223,8 @@ operations:
             - dscp
             - flowlabel
             - flowlabel-mask
+            - sport-mask
+            - dport-mask
     -
       name: newrule-ntf
       doc: Notify a rule creation
Signature · 1 line
2.48.1
author maintainer
#10 lore raw

PATCH 7/8 selftests: fib_rule_tests: Add port range match tests

In reply to Ido Schimmel

Currently, only matching on specific ports is tested. Add port range testing to make sure this use case does not regress.

---
 tools/testing/selftests/net/fib_rule_tests.sh | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
tools/testing/selftests/net/fib_rule_tests.sh +16 -0
index 847936363a12..12a6e219d683 100755
@@ -256,6 +256,14 @@ fib_rule6_test()
 		fib_rule6_test_match_n_redirect "$match" "$match" \
 			"$getnomatch" "sport and dport redirect to table" \
 			"sport and dport no redirect to table"
+
+		match="sport 100-200 dport 300-400"
+		getmatch="sport 100 dport 400"
+		getnomatch="sport 100 dport 401"
+		fib_rule6_test_match_n_redirect "$match" "$getmatch" \
+			"$getnomatch" \
+			"sport and dport range redirect to table" \
+			"sport and dport range no redirect to table"
 	fi
 
 	fib_check_iproute_support "ipproto" "ipproto"
@@ -525,6 +533,14 @@ fib_rule4_test()
 		fib_rule4_test_match_n_redirect "$match" "$match" \
 			"$getnomatch" "sport and dport redirect to table" \
 			"sport and dport no redirect to table"
+
+		match="sport 100-200 dport 300-400"
+		getmatch="sport 100 dport 400"
+		getnomatch="sport 100 dport 401"
+		fib_rule4_test_match_n_redirect "$match" "$getmatch" \
+			"$getnomatch" \
+			"sport and dport range redirect to table" \
+			"sport and dport range no redirect to table"
 	fi
 
 	fib_check_iproute_support "ipproto" "ipproto"
Signature · 1 line
2.48.1
author maintainer
#11 lore raw

PATCH 8/8 selftests: fib_rule_tests: Add port mask match tests

In reply to Ido Schimmel

Add tests for FIB rules that match on source and destination ports with a mask. Test both good and bad flows.

 # ./fib_rule_tests.sh
 IPv6 FIB rule tests
 [...]
    TEST: rule6 check: sport and dport redirect to table                [ OK ]
    TEST: rule6 check: sport and dport no redirect to table             [ OK ]
    TEST: rule6 del by pref: sport and dport redirect to table          [ OK ]
    TEST: rule6 check: sport and dport range redirect to table          [ OK ]
    TEST: rule6 check: sport and dport range no redirect to table       [ OK ]
    TEST: rule6 del by pref: sport and dport range redirect to table    [ OK ]
    TEST: rule6 check: sport and dport masked redirect to table         [ OK ]
    TEST: rule6 check: sport and dport masked no redirect to table      [ OK ]
    TEST: rule6 del by pref: sport and dport masked redirect to table   [ OK ]
 [...]

Tests passed: 292
Tests failed: 0

---
 tools/testing/selftests/net/fib_rule_tests.sh | 20 +++++++++++++++++++
 1 file changed, 20 insertions(+)
tools/testing/selftests/net/fib_rule_tests.sh +20 -0
index 12a6e219d683..06c51d7ceb4a 100755
@@ -266,6 +266,16 @@ fib_rule6_test()
 			"sport and dport range no redirect to table"
 	fi
 
+	ip rule help 2>&1 | grep sport | grep -q MASK
+	if [ $? -eq 0 ]; then
+		match="sport 0x0f00/0xff00 dport 0x000f/0x00ff"
+		getmatch="sport 0x0f11 dport 0x220f"
+		getnomatch="sport 0x1f11 dport 0x221f"
+		fib_rule6_test_match_n_redirect "$match" "$getmatch" \
+			"$getnomatch" "sport and dport masked redirect to table" \
+			"sport and dport masked no redirect to table"
+	fi
+
 	fib_check_iproute_support "ipproto" "ipproto"
 	if [ $? -eq 0 ]; then
 		match="ipproto tcp"
@@ -543,6 +553,16 @@ fib_rule4_test()
 			"sport and dport range no redirect to table"
 	fi
 
+	ip rule help 2>&1 | grep sport | grep -q MASK
+	if [ $? -eq 0 ]; then
+		match="sport 0x0f00/0xff00 dport 0x000f/0x00ff"
+		getmatch="sport 0x0f11 dport 0x220f"
+		getnomatch="sport 0x1f11 dport 0x221f"
+		fib_rule4_test_match_n_redirect "$match" "$getmatch" \
+			"$getnomatch" "sport and dport masked redirect to table" \
+			"sport and dport masked no redirect to table"
+	fi
+
 	fib_check_iproute_support "ipproto" "ipproto"
 	if [ $? -eq 0 ]; then
 		match="ipproto tcp"
Signature · 1 line
2.48.1
maintainer Reviewed-by on the v1 series
#13 lore raw
In reply to Ido Schimmel
Quoted 32 lines · Ido Schimmel

In some deployments users would like to encode path information into certain bits of the IPv6 flow label, the UDP source port and the DSCP field and use this information to route packets accordingly.

Redirecting traffic to a routing table based on specific bits in the UDP source port is not currently possible. Only exact match and range are currently supported by FIB rules.

This patchset extends FIB rules to match on layer 4 ports with an optional mask. The mask is not supported when matching on a range. A future patchset will add support for matching on the DSCP field with an optional mask.

Patches #1-#6 gradually extend FIB rules to match on layer 4 ports with an optional mask.

Patches #7-#8 add test cases for FIB rule port matching.

iproute2 support can be found here [1].

[1] https://github.com/idosch/iproute2/tree/submit/fib_rule_mask_v1

Ido Schimmel (8):
net: fib_rules: Add port mask attributes
net: fib_rules: Add port mask support
ipv4: fib_rules: Add port mask matching
ipv6: fib_rules: Add port mask matching
net: fib_rules: Enable port mask usage
netlink: specs: Add FIB rule port mask attributes
selftests: fib_rule_tests: Add port range match tests
selftests: fib_rule_tests: Add port mask match tests

Quoted 9 lines
 Documentation/netlink/specs/rt_rule.yaml      | 10 +++
 include/net/fib_rules.h                       | 19 +++++
 include/uapi/linux/fib_rules.h                |  2 +
 net/core/fib_rules.c                          | 69 ++++++++++++++++++-
 net/ipv4/fib_rules.c                          |  8 +--
 net/ipv6/fib6_rules.c                         |  8 +--
 tools/testing/selftests/net/fib_rule_tests.sh | 36 ++++++++++
 7 files changed, 143 insertions(+), 9 deletions(-)

For the set:

#14 lore raw
In reply to Ido Schimmel
This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 9 lines · On Mon, 17 Feb 2025 15:41:01 +0200 you wrote:

In some deployments users would like to encode path information into certain bits of the IPv6 flow label, the UDP source port and the DSCP field and use this information to route packets accordingly.

Redirecting traffic to a routing table based on specific bits in the UDP source port is not currently possible. Only exact match and range are currently supported by FIB rules.

[...]

Here is the summary with links:
- [net-next,1/8] net: fib_rules: Add port mask attributes

    https://git.kernel.org/netdev/net-next/c/39f970aead3c
  - [net-next,2/8] net: fib_rules: Add port mask support
    https://git.kernel.org/netdev/net-next/c/da7665947b66
  - [net-next,3/8] ipv4: fib_rules: Add port mask matching
    https://git.kernel.org/netdev/net-next/c/79a4e21584b7
  - [net-next,4/8] ipv6: fib_rules: Add port mask matching
    https://git.kernel.org/netdev/net-next/c/fc1266a06164
  - [net-next,5/8] net: fib_rules: Enable port mask usage
    https://git.kernel.org/netdev/net-next/c/34e406a84928
  - [net-next,6/8] netlink: specs: Add FIB rule port mask attributes
    https://git.kernel.org/netdev/net-next/c/ab35ebfabb53
  - [net-next,7/8] selftests: fib_rule_tests: Add port range match tests
    https://git.kernel.org/netdev/net-next/c/94694aa64100
  - [net-next,8/8] selftests: fib_rule_tests: Add port mask match tests
    https://git.kernel.org/netdev/net-next/c/f5d783c08875

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html