diff options
author | Jakub Kicinski <jakub.kicinski@netronome.com> | 2018-11-19 15:21:49 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-11-19 18:53:46 -0800 |
commit | 174ab544e3bc0b0c944b8e642618203dd0c2ecdf (patch) | |
tree | 6b0274584d6569cb73905b2942f6c6132c6990a5 /drivers/net/ethernet/netronome/nfp/abm/main.h | |
parent | 6a80240571800ba4ea2487f0531553424b6922e0 (diff) |
nfp: abm: add cls_u32 offload for simple band classification
Use offload of very simple u32 filters to direct packets to GRED
bands based on the DSCP marking. No u32 hashing is supported,
just plain simple filters matching on ToS or Priority with
appropriate mask device can support.
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 | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/net/ethernet/netronome/nfp/abm/main.h b/drivers/net/ethernet/netronome/nfp/abm/main.h index bc378b464f2c..9352992ab386 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/list.h> #include <linux/radix-tree.h> #include <net/devlink.h> #include <net/pkt_cls.h> @@ -34,7 +35,9 @@ struct nfp_net; * @thresholds: current threshold configuration * @threshold_undef: bitmap of thresholds which have not been set * @num_thresholds: number of @thresholds and bits in @threshold_undef + * * @prio_map_len: computed length of FW priority map (in bytes) + * @dscp_mask: mask FW will apply on DSCP field * * @eswitch_mode: devlink eswitch mode, advanced functions only visible * in switchdev mode @@ -53,7 +56,9 @@ struct nfp_abm { u32 *thresholds; unsigned long *threshold_undef; size_t num_thresholds; + unsigned int prio_map_len; + u8 dscp_mask; enum devlink_eswitch_mode eswitch_mode; @@ -170,7 +175,11 @@ struct nfp_qdisc { * * @last_stats_update: ktime of last stats update * + * @prio_map: current map of priorities + * @has_prio: @prio_map is valid + * * @def_band: default band to use + * @dscp_map: list of DSCP to band mappings * * @root_qdisc: pointer to the current root of the Qdisc hierarchy * @qdiscs: all qdiscs recorded by major part of the handle @@ -184,7 +193,11 @@ struct nfp_abm_link { u64 last_stats_update; + u32 *prio_map; + bool has_prio; + u8 def_band; + struct list_head dscp_map; struct nfp_qdisc *root_qdisc; struct radix_tree_root qdiscs; @@ -204,6 +217,8 @@ int nfp_abm_setup_tc_mq(struct net_device *netdev, struct nfp_abm_link *alink, struct tc_mq_qopt_offload *opt); int nfp_abm_setup_tc_gred(struct net_device *netdev, struct nfp_abm_link *alink, struct tc_gred_qopt_offload *opt); +int nfp_abm_setup_cls_block(struct net_device *netdev, struct nfp_repr *repr, + struct tc_block_offload *opt); int nfp_abm_ctrl_read_params(struct nfp_abm_link *alink); int nfp_abm_ctrl_find_addrs(struct nfp_abm *abm); @@ -220,5 +235,6 @@ u64 nfp_abm_ctrl_stat_non_sto(struct nfp_abm_link *alink, unsigned int i); u64 nfp_abm_ctrl_stat_sto(struct nfp_abm_link *alink, unsigned int i); int nfp_abm_ctrl_qm_enable(struct nfp_abm *abm); int nfp_abm_ctrl_qm_disable(struct nfp_abm *abm); +void nfp_abm_prio_map_update(struct nfp_abm *abm); int nfp_abm_ctrl_prio_map_update(struct nfp_abm_link *alink, u32 *packed); #endif |