diff options
author | Jakub Kicinski <jakub.kicinski@netronome.com> | 2018-11-12 14:58:09 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-11-14 08:51:27 -0800 |
commit | 4f5681d088ba01f12f63160fa843c915e1ce1358 (patch) | |
tree | 85026fd19f447d937fce4b47c277b69dca2162ed /drivers/net/ethernet/netronome/nfp/abm/main.h | |
parent | 6666f545e9e19bb6b4836b6c5215ceba47d58d3e (diff) | |
download | linux-4f5681d088ba01f12f63160fa843c915e1ce1358.tar.bz2 |
nfp: abm: track all offload-enabled qdiscs
Allocate an object corresponding to any offloaded qdisc we are
informed about by the kernel. Not only the qdiscs we have a
chance of offloading.
The count of created objects will be used to decide whether
the ethtool TC offload can be disabled, since otherwise we may
miss destroy commands.
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: John Hurley <john.hurley@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/netronome/nfp/abm/main.h')
-rw-r--r-- | drivers/net/ethernet/netronome/nfp/abm/main.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/net/ethernet/netronome/nfp/abm/main.h b/drivers/net/ethernet/netronome/nfp/abm/main.h index 15732ad7c202..64cb5ebcf80e 100644 --- a/drivers/net/ethernet/netronome/nfp/abm/main.h +++ b/drivers/net/ethernet/netronome/nfp/abm/main.h @@ -5,6 +5,7 @@ #define __NFP_ABM_H__ 1 #include <linux/bits.h> +#include <linux/radix-tree.h> #include <net/devlink.h> #include <net/pkt_cls.h> @@ -71,6 +72,26 @@ struct nfp_alink_xstats { u64 pdrop; }; +enum nfp_qdisc_type { + NFP_QDISC_NONE = 0, + NFP_QDISC_MQ, + NFP_QDISC_RED, +}; + +/** + * struct nfp_qdisc - tracked TC Qdisc + * @netdev: netdev on which Qdisc was created + * @type: Qdisc type + * @handle: handle of this Qdisc + * @parent_handle: handle of the parent (unreliable if Qdisc was grafted) + */ +struct nfp_qdisc { + struct net_device *netdev; + enum nfp_qdisc_type type; + u32 handle; + u32 parent_handle; +}; + /** * struct nfp_red_qdisc - representation of single RED Qdisc * @handle: handle of currently offloaded RED Qdisc @@ -95,6 +116,7 @@ struct nfp_red_qdisc { * @parent: handle of expected parent, i.e. handle of MQ, or TC_H_ROOT * @num_qdiscs: number of currently used qdiscs * @red_qdiscs: array of qdiscs + * @qdiscs: all qdiscs recorded by major part of the handle */ struct nfp_abm_link { struct nfp_abm *abm; @@ -105,6 +127,7 @@ struct nfp_abm_link { u32 parent; unsigned int num_qdiscs; struct nfp_red_qdisc *red_qdiscs; + struct radix_tree_root qdiscs; }; int nfp_abm_setup_tc_red(struct net_device *netdev, struct nfp_abm_link *alink, |