5252#include "wq.h"
5353#include "mlx5_core.h"
5454#include "en_stats.h"
55+ #include "en/fs.h"
5556
5657struct page_pool ;
5758
@@ -626,152 +627,12 @@ struct mlx5e_channel_stats {
626627 struct mlx5e_xdpsq_stats xdpsq ;
627628} ____cacheline_aligned_in_smp ;
628629
629- enum mlx5e_traffic_types {
630- MLX5E_TT_IPV4_TCP ,
631- MLX5E_TT_IPV6_TCP ,
632- MLX5E_TT_IPV4_UDP ,
633- MLX5E_TT_IPV6_UDP ,
634- MLX5E_TT_IPV4_IPSEC_AH ,
635- MLX5E_TT_IPV6_IPSEC_AH ,
636- MLX5E_TT_IPV4_IPSEC_ESP ,
637- MLX5E_TT_IPV6_IPSEC_ESP ,
638- MLX5E_TT_IPV4 ,
639- MLX5E_TT_IPV6 ,
640- MLX5E_TT_ANY ,
641- MLX5E_NUM_TT ,
642- MLX5E_NUM_INDIR_TIRS = MLX5E_TT_ANY ,
643- };
644-
645- enum mlx5e_tunnel_types {
646- MLX5E_TT_IPV4_GRE ,
647- MLX5E_TT_IPV6_GRE ,
648- MLX5E_NUM_TUNNEL_TT ,
649- };
650-
651630enum {
652631 MLX5E_STATE_ASYNC_EVENTS_ENABLED ,
653632 MLX5E_STATE_OPENED ,
654633 MLX5E_STATE_DESTROYING ,
655634};
656635
657- struct mlx5e_l2_rule {
658- u8 addr [ETH_ALEN + 2 ];
659- struct mlx5_flow_handle * rule ;
660- };
661-
662- struct mlx5e_flow_table {
663- int num_groups ;
664- struct mlx5_flow_table * t ;
665- struct mlx5_flow_group * * g ;
666- };
667-
668- #define MLX5E_L2_ADDR_HASH_SIZE BIT(BITS_PER_BYTE)
669-
670- struct mlx5e_tc_table {
671- struct mlx5_flow_table * t ;
672-
673- struct rhashtable ht ;
674-
675- DECLARE_HASHTABLE (mod_hdr_tbl , 8 );
676- DECLARE_HASHTABLE (hairpin_tbl , 8 );
677- };
678-
679- struct mlx5e_vlan_table {
680- struct mlx5e_flow_table ft ;
681- DECLARE_BITMAP (active_cvlans , VLAN_N_VID );
682- DECLARE_BITMAP (active_svlans , VLAN_N_VID );
683- struct mlx5_flow_handle * active_cvlans_rule [VLAN_N_VID ];
684- struct mlx5_flow_handle * active_svlans_rule [VLAN_N_VID ];
685- struct mlx5_flow_handle * untagged_rule ;
686- struct mlx5_flow_handle * any_cvlan_rule ;
687- struct mlx5_flow_handle * any_svlan_rule ;
688- bool cvlan_filter_disabled ;
689- };
690-
691- struct mlx5e_l2_table {
692- struct mlx5e_flow_table ft ;
693- struct hlist_head netdev_uc [MLX5E_L2_ADDR_HASH_SIZE ];
694- struct hlist_head netdev_mc [MLX5E_L2_ADDR_HASH_SIZE ];
695- struct mlx5e_l2_rule broadcast ;
696- struct mlx5e_l2_rule allmulti ;
697- struct mlx5e_l2_rule promisc ;
698- bool broadcast_enabled ;
699- bool allmulti_enabled ;
700- bool promisc_enabled ;
701- };
702-
703- /* L3/L4 traffic type classifier */
704- struct mlx5e_ttc_table {
705- struct mlx5e_flow_table ft ;
706- struct mlx5_flow_handle * rules [MLX5E_NUM_TT ];
707- struct mlx5_flow_handle * tunnel_rules [MLX5E_NUM_TUNNEL_TT ];
708- };
709-
710- #define ARFS_HASH_SHIFT BITS_PER_BYTE
711- #define ARFS_HASH_SIZE BIT(BITS_PER_BYTE)
712- struct arfs_table {
713- struct mlx5e_flow_table ft ;
714- struct mlx5_flow_handle * default_rule ;
715- struct hlist_head rules_hash [ARFS_HASH_SIZE ];
716- };
717-
718- enum arfs_type {
719- ARFS_IPV4_TCP ,
720- ARFS_IPV6_TCP ,
721- ARFS_IPV4_UDP ,
722- ARFS_IPV6_UDP ,
723- ARFS_NUM_TYPES ,
724- };
725-
726- struct mlx5e_arfs_tables {
727- struct arfs_table arfs_tables [ARFS_NUM_TYPES ];
728- /* Protect aRFS rules list */
729- spinlock_t arfs_lock ;
730- struct list_head rules ;
731- int last_filter_id ;
732- struct workqueue_struct * wq ;
733- };
734-
735- /* NIC prio FTS */
736- enum {
737- MLX5E_VLAN_FT_LEVEL = 0 ,
738- MLX5E_L2_FT_LEVEL ,
739- MLX5E_TTC_FT_LEVEL ,
740- MLX5E_INNER_TTC_FT_LEVEL ,
741- MLX5E_ARFS_FT_LEVEL
742- };
743-
744- enum {
745- MLX5E_TC_FT_LEVEL = 0 ,
746- MLX5E_TC_TTC_FT_LEVEL ,
747- };
748-
749- struct mlx5e_ethtool_table {
750- struct mlx5_flow_table * ft ;
751- int num_rules ;
752- };
753-
754- #define ETHTOOL_NUM_L3_L4_FTS 7
755- #define ETHTOOL_NUM_L2_FTS 4
756-
757- struct mlx5e_ethtool_steering {
758- struct mlx5e_ethtool_table l3_l4_ft [ETHTOOL_NUM_L3_L4_FTS ];
759- struct mlx5e_ethtool_table l2_ft [ETHTOOL_NUM_L2_FTS ];
760- struct list_head rules ;
761- int tot_num_rules ;
762- };
763-
764- struct mlx5e_flow_steering {
765- struct mlx5_flow_namespace * ns ;
766- struct mlx5e_ethtool_steering ethtool ;
767- struct mlx5e_tc_table tc ;
768- struct mlx5e_vlan_table vlan ;
769- struct mlx5e_l2_table l2 ;
770- struct mlx5e_ttc_table ttc ;
771- struct mlx5e_ttc_table inner_ttc ;
772- struct mlx5e_arfs_tables arfs ;
773- };
774-
775636struct mlx5e_rqt {
776637 u32 rqtn ;
777638 bool enabled ;
@@ -905,23 +766,10 @@ mlx5e_skb_from_cqe_nonlinear(struct mlx5e_rq *rq, struct mlx5_cqe64 *cqe,
905766
906767void mlx5e_update_stats (struct mlx5e_priv * priv );
907768
908- int mlx5e_create_flow_steering (struct mlx5e_priv * priv );
909- void mlx5e_destroy_flow_steering (struct mlx5e_priv * priv );
910769void mlx5e_init_l2_addr (struct mlx5e_priv * priv );
911- void mlx5e_destroy_flow_table (struct mlx5e_flow_table * ft );
912770int mlx5e_self_test_num (struct mlx5e_priv * priv );
913771void mlx5e_self_test (struct net_device * ndev , struct ethtool_test * etest ,
914772 u64 * buf );
915- int mlx5e_ethtool_get_flow (struct mlx5e_priv * priv , struct ethtool_rxnfc * info ,
916- int location );
917- int mlx5e_ethtool_get_all_flows (struct mlx5e_priv * priv ,
918- struct ethtool_rxnfc * info , u32 * rule_locs );
919- int mlx5e_ethtool_flow_replace (struct mlx5e_priv * priv ,
920- struct ethtool_rx_flow_spec * fs );
921- int mlx5e_ethtool_flow_remove (struct mlx5e_priv * priv ,
922- int location );
923- void mlx5e_ethtool_init_steering (struct mlx5e_priv * priv );
924- void mlx5e_ethtool_cleanup_steering (struct mlx5e_priv * priv );
925773void mlx5e_set_rx_mode_work (struct work_struct * work );
926774
927775int mlx5e_hwstamp_set (struct mlx5e_priv * priv , struct ifreq * ifr );
@@ -932,8 +780,6 @@ int mlx5e_vlan_rx_add_vid(struct net_device *dev, __always_unused __be16 proto,
932780 u16 vid );
933781int mlx5e_vlan_rx_kill_vid (struct net_device * dev , __always_unused __be16 proto ,
934782 u16 vid );
935- void mlx5e_enable_cvlan_filter (struct mlx5e_priv * priv );
936- void mlx5e_disable_cvlan_filter (struct mlx5e_priv * priv );
937783void mlx5e_timestamp_init (struct mlx5e_priv * priv );
938784
939785struct mlx5e_redirect_rqt_param {
@@ -1050,32 +896,6 @@ void mlx5e_dcbnl_init_app(struct mlx5e_priv *priv);
1050896void mlx5e_dcbnl_delete_app (struct mlx5e_priv * priv );
1051897#endif
1052898
1053- #ifndef CONFIG_RFS_ACCEL
1054- static inline int mlx5e_arfs_create_tables (struct mlx5e_priv * priv )
1055- {
1056- return 0 ;
1057- }
1058-
1059- static inline void mlx5e_arfs_destroy_tables (struct mlx5e_priv * priv ) {}
1060-
1061- static inline int mlx5e_arfs_enable (struct mlx5e_priv * priv )
1062- {
1063- return - EOPNOTSUPP ;
1064- }
1065-
1066- static inline int mlx5e_arfs_disable (struct mlx5e_priv * priv )
1067- {
1068- return - EOPNOTSUPP ;
1069- }
1070- #else
1071- int mlx5e_arfs_create_tables (struct mlx5e_priv * priv );
1072- void mlx5e_arfs_destroy_tables (struct mlx5e_priv * priv );
1073- int mlx5e_arfs_enable (struct mlx5e_priv * priv );
1074- int mlx5e_arfs_disable (struct mlx5e_priv * priv );
1075- int mlx5e_rx_flow_steer (struct net_device * dev , const struct sk_buff * skb ,
1076- u16 rxq_index , u32 flow_id );
1077- #endif
1078-
1079899int mlx5e_create_tir (struct mlx5_core_dev * mdev ,
1080900 struct mlx5e_tir * tir , u32 * in , int inlen );
1081901void mlx5e_destroy_tir (struct mlx5_core_dev * mdev ,
@@ -1096,27 +916,6 @@ int mlx5e_create_direct_tirs(struct mlx5e_priv *priv);
1096916void mlx5e_destroy_direct_tirs (struct mlx5e_priv * priv );
1097917void mlx5e_destroy_rqt (struct mlx5e_priv * priv , struct mlx5e_rqt * rqt );
1098918
1099- struct ttc_params {
1100- struct mlx5_flow_table_attr ft_attr ;
1101- u32 any_tt_tirn ;
1102- u32 indir_tirn [MLX5E_NUM_INDIR_TIRS ];
1103- struct mlx5e_ttc_table * inner_ttc ;
1104- };
1105-
1106- void mlx5e_set_ttc_basic_params (struct mlx5e_priv * priv , struct ttc_params * ttc_params );
1107- void mlx5e_set_ttc_ft_params (struct ttc_params * ttc_params );
1108- void mlx5e_set_inner_ttc_ft_params (struct ttc_params * ttc_params );
1109-
1110- int mlx5e_create_ttc_table (struct mlx5e_priv * priv , struct ttc_params * params ,
1111- struct mlx5e_ttc_table * ttc );
1112- void mlx5e_destroy_ttc_table (struct mlx5e_priv * priv ,
1113- struct mlx5e_ttc_table * ttc );
1114-
1115- int mlx5e_create_inner_ttc_table (struct mlx5e_priv * priv , struct ttc_params * params ,
1116- struct mlx5e_ttc_table * ttc );
1117- void mlx5e_destroy_inner_ttc_table (struct mlx5e_priv * priv ,
1118- struct mlx5e_ttc_table * ttc );
1119-
1120919int mlx5e_create_tis (struct mlx5_core_dev * mdev , int tc ,
1121920 u32 underlay_qpn , u32 * tisn );
1122921void mlx5e_destroy_tis (struct mlx5_core_dev * mdev , u32 tisn );
0 commit comments