diff mbox series

[net-next] net: fib_rules: do not flow dissect local packets

Message ID 20190705184643.249884-1-ppenkov@google.com
State Accepted
Delegated to: David Miller
Headers show
Series [net-next] net: fib_rules: do not flow dissect local packets | expand

Commit Message

Petar Penkov July 5, 2019, 6:46 p.m. UTC
Rules matching on loopback iif do not need early flow dissection as the
packet originates from the host. Stop counting such rules in
fib_rule_requires_fldissect

Signed-off-by: Petar Penkov <ppenkov@google.com>
---
 include/net/fib_rules.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

David Miller July 8, 2019, 11:12 p.m. UTC | #1
From: Petar Penkov <ppenkov@google.com>
Date: Fri,  5 Jul 2019 11:46:43 -0700

> Rules matching on loopback iif do not need early flow dissection as the
> packet originates from the host. Stop counting such rules in
> fib_rule_requires_fldissect
> 
> Signed-off-by: Petar Penkov <ppenkov@google.com>

Roopa, please review.
David Miller July 11, 2019, 9:23 p.m. UTC | #2
From: Petar Penkov <ppenkov@google.com>
Date: Fri,  5 Jul 2019 11:46:43 -0700

> Rules matching on loopback iif do not need early flow dissection as the
> packet originates from the host. Stop counting such rules in
> fib_rule_requires_fldissect
> 
> Signed-off-by: Petar Penkov <ppenkov@google.com>

Applied, thank you.
Roopa Prabhu July 12, 2019, 4:13 a.m. UTC | #3
On Mon, Jul 8, 2019 at 4:12 PM David Miller <davem@davemloft.net> wrote:
>
> From: Petar Penkov <ppenkov@google.com>
> Date: Fri,  5 Jul 2019 11:46:43 -0700
>
> > Rules matching on loopback iif do not need early flow dissection as the
> > packet originates from the host. Stop counting such rules in
> > fib_rule_requires_fldissect
> >
> > Signed-off-by: Petar Penkov <ppenkov@google.com>
>
> Roopa, please review.

sorry about the delay. I was traveling the last few days.

looks ok to me. thanks.
diff mbox series

Patch

diff --git a/include/net/fib_rules.h b/include/net/fib_rules.h
index eba8465e1d86..20dcadd8eed9 100644
--- a/include/net/fib_rules.h
+++ b/include/net/fib_rules.h
@@ -180,9 +180,9 @@  static inline bool fib_rule_port_range_compare(struct fib_rule_port_range *a,
 
 static inline bool fib_rule_requires_fldissect(struct fib_rule *rule)
 {
-	return rule->ip_proto ||
+	return rule->iifindex != LOOPBACK_IFINDEX && (rule->ip_proto ||
 		fib_rule_port_range_set(&rule->sport_range) ||
-		fib_rule_port_range_set(&rule->dport_range);
+		fib_rule_port_range_set(&rule->dport_range));
 }
 
 struct fib_rules_ops *fib_rules_register(const struct fib_rules_ops *,