Thread (29 messages) 29 messages, 5 authors, 2020-03-02
STALE2292d

[patch net-next 04/10] net: extend tc_cls_can_offload_basic() to check HW stats type

From: Jiri Pirko <jiri@resnulli.us>
Date: 2020-02-21 09:56:55
Subsystem: networking [general], tc subsystem, the rest · Maintainers: "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Jamal Hadi Salim, Jiri Pirko, Linus Torvalds

From: Jiri Pirko <redacted>

As the default type of HW stats is "any", extend
tc_cls_can_offload_basic() helper to check for it and don't allow any
other type to be handled by the drivers.

Signed-off-by: Jiri Pirko <redacted>
---
 include/net/pkt_cls.h | 5 +++++
 1 file changed, 5 insertions(+)
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
index 779364ed080a..d3d90f714a66 100644
--- a/include/net/pkt_cls.h
+++ b/include/net/pkt_cls.h
@@ -594,6 +594,11 @@ tc_cls_can_offload_basic(const struct net_device *dev,
 			       "Driver supports only offload of chain 0");
 		return false;
 	}
+	if (common->hw_stats_type != FLOW_CLS_HW_STATS_TYPE_ANY) {
+		NL_SET_ERR_MSG(common->extack,
+			       "Driver supports only default HW stats type \"any\"");
+		return false;
+	}
 	return true;
 }
 
-- 
2.21.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help