summaryrefslogtreecommitdiffstats
path: root/include/uapi/linux/rtnetlink.h
diff options
context:
space:
mode:
authorJiri Pirko2018-01-17 11:46:51 +0100
committerDavid S. Miller2018-01-17 20:53:57 +0100
commit7960d1daf278cbe23bb48974fe6ae6a1e44c3c15 (patch)
tree8372dff3b1b3c49916b48db78c56b93fd6dfe611 /include/uapi/linux/rtnetlink.h
parentnet: sched: keep track of offloaded filters and check tc offload feature (diff)
downloadkernel-qcow2-linux-7960d1daf278cbe23bb48974fe6ae6a1e44c3c15.tar.gz
kernel-qcow2-linux-7960d1daf278cbe23bb48974fe6ae6a1e44c3c15.tar.xz
kernel-qcow2-linux-7960d1daf278cbe23bb48974fe6ae6a1e44c3c15.zip
net: sched: use block index as a handle instead of qdisc when block is shared
As the tcm_ifindex with value TCM_IFINDEX_MAGIC_BLOCK is invalid ifindex, use it to indicate that we work with block, instead of qdisc. So if tcm_ifindex is set to TCM_IFINDEX_MAGIC_BLOCK, tcm_parent is used to carry block_index. If the block is set to be shared between at least 2 qdiscs, it is forbidden to use the qdisc handle to add/delete filters. In that case, userspace has to pass block_index. Also, for dump of the filters, in case the block is shared in between at least 2 qdiscs, the each filter is dumped with tcm_ifindex value TCM_IFINDEX_MAGIC_BLOCK and tcm_parent set to block_index. That gives the user clear indication, that the filter belongs to a shared block and not only to one qdisc under which it is dumped. Suggested-by: David Ahern <dsahern@gmail.com> Signed-off-by: Jiri Pirko <jiri@mellanox.com> Acked-by: Jamal Hadi Salim <jhs@mojatatu.com> Acked-by: David Ahern <dsahern@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/uapi/linux/rtnetlink.h')
-rw-r--r--include/uapi/linux/rtnetlink.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/uapi/linux/rtnetlink.h b/include/uapi/linux/rtnetlink.h
index 843e29aa3cac..da878f2e7c39 100644
--- a/include/uapi/linux/rtnetlink.h
+++ b/include/uapi/linux/rtnetlink.h
@@ -541,9 +541,19 @@ struct tcmsg {
int tcm_ifindex;
__u32 tcm_handle;
__u32 tcm_parent;
+/* tcm_block_index is used instead of tcm_parent
+ * in case tcm_ifindex == TCM_IFINDEX_MAGIC_BLOCK
+ */
+#define tcm_block_index tcm_parent
__u32 tcm_info;
};
+/* For manipulation of filters in shared block, tcm_ifindex is set to
+ * TCM_IFINDEX_MAGIC_BLOCK, and tcm_parent is aliased to tcm_block_index
+ * which is the block index.
+ */
+#define TCM_IFINDEX_MAGIC_BLOCK (0xFFFFFFFFU)
+
enum {
TCA_UNSPEC,
TCA_KIND,