Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH net-next] cxgb4: insert IPv6 filter rules in next free region
@ 2020-08-20 11:01 Rahul Kundu
  2020-08-20 19:03 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Rahul Kundu @ 2020-08-20 11:01 UTC (permalink / raw)
  To: netdev, davem; +Cc: vishal, rahul.lakkireddy, dt, rahul.kundu

IPv6 filters can occupy up to 4 slots and will exhaust HPFILTER
region much sooner. So, continue searching for free slots in the
HASH or NORMAL filter regions, as long as the rule's priority does
not conflict with existing rules in those regions.

Signed-off-by: Rahul Kundu <rahul.kundu@chelsio.com>
---
 .../net/ethernet/chelsio/cxgb4/cxgb4_filter.c   | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c
index 650db92cb11c..f6c1ec140e09 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c
@@ -604,17 +604,14 @@ int cxgb4_get_free_ftid(struct net_device *dev, u8 family, bool hash_en,
 			/* If the new rule wants to get inserted into
 			 * HPFILTER region, but its prio is greater
 			 * than the rule with the highest prio in HASH
-			 * region, then reject the rule.
-			 */
-			if (t->tc_hash_tids_max_prio &&
-			    tc_prio > t->tc_hash_tids_max_prio)
-				break;
-
-			/* If there's not enough slots available
-			 * in HPFILTER region, then move on to
-			 * normal FILTER region immediately.
+			 * region, or if there's not enough slots
+			 * available in HPFILTER region, then skip
+			 * trying to insert this rule into HPFILTER
+			 * region and directly go to the next region.
 			 */
-			if (ftid + n > t->nhpftids) {
+			if ((t->tc_hash_tids_max_prio &&
+			     tc_prio > t->tc_hash_tids_max_prio) ||
+			     (ftid + n) > t->nhpftids) {
 				ftid = t->nhpftids;
 				continue;
 			}
-- 
2.18.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] cxgb4: insert IPv6 filter rules in next free region
  2020-08-20 11:01 [PATCH net-next] cxgb4: insert IPv6 filter rules in next free region Rahul Kundu
@ 2020-08-20 19:03 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-08-20 19:03 UTC (permalink / raw)
  To: rahul.kundu; +Cc: netdev, vishal, rahul.lakkireddy, dt

From: Rahul Kundu <rahul.kundu@chelsio.com>
Date: Thu, 20 Aug 2020 16:31:36 +0530

> IPv6 filters can occupy up to 4 slots and will exhaust HPFILTER
> region much sooner. So, continue searching for free slots in the
> HASH or NORMAL filter regions, as long as the rule's priority does
> not conflict with existing rules in those regions.
> 
> Signed-off-by: Rahul Kundu <rahul.kundu@chelsio.com>

Applied, thank you.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-08-20 19:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-20 11:01 [PATCH net-next] cxgb4: insert IPv6 filter rules in next free region Rahul Kundu
2020-08-20 19:03 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).