summaryrefslogtreecommitdiff
path: root/include/net
diff options
context:
space:
mode:
authorNogah Frankel <nogahf@mellanox.com>2017-11-06 09:23:41 +0300
committerDavid S. Miller <davem@davemloft.net>2017-11-08 06:23:37 +0300
commit602f3baf22188aad24b9a58be3209ab774b97d74 (patch)
treef8cffb1dc6ee8f0cb6695cf886daacab55463707 /include/net
parentaaf151b9e68101b03ba42d581e8a424bdd0110fe (diff)
downloadlinux-602f3baf22188aad24b9a58be3209ab774b97d74.tar.xz
net_sch: red: Add offload ability to RED qdisc
Add the ability to offload RED qdisc by using ndo_setup_tc. There are four commands for RED offloading: * TC_RED_SET: handles set and change. * TC_RED_DESTROY: handle qdisc destroy. * TC_RED_STATS: update the qdiscs counters (given as reference) * TC_RED_XSTAT: returns red xstats. Whether RED is being offloaded is being determined every time dump action is being called because parent change of this qdisc could change its offload state but doesn't require any RED function to be called. Signed-off-by: Nogah Frankel <nogahf@mellanox.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Reviewed-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/pkt_cls.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
index 98fef3221227..03c208d3c922 100644
--- a/include/net/pkt_cls.h
+++ b/include/net/pkt_cls.h
@@ -703,4 +703,34 @@ struct tc_cookie {
u8 *data;
u32 len;
};
+
+enum tc_red_command {
+ TC_RED_REPLACE,
+ TC_RED_DESTROY,
+ TC_RED_STATS,
+ TC_RED_XSTATS,
+};
+
+struct tc_red_qopt_offload_params {
+ u32 min;
+ u32 max;
+ u32 probability;
+ bool is_ecn;
+};
+struct tc_red_qopt_offload_stats {
+ struct gnet_stats_basic_packed *bstats;
+ struct gnet_stats_queue *qstats;
+};
+
+struct tc_red_qopt_offload {
+ enum tc_red_command command;
+ u32 handle;
+ u32 parent;
+ union {
+ struct tc_red_qopt_offload_params set;
+ struct tc_red_qopt_offload_stats stats;
+ struct red_stats *xstats;
+ };
+};
+
#endif