Lines Matching full:struct

75 struct mlxsw_sp_port;
76 struct mlxsw_sp_rif;
77 struct mlxsw_sp_span_entry;
89 struct mlxsw_sp_router_ops;
91 extern const struct mlxsw_sp_router_ops mlxsw_sp1_router_ops;
92 extern const struct mlxsw_sp_router_ops mlxsw_sp2_router_ops;
94 struct mlxsw_sp_switchdev_ops;
96 extern const struct mlxsw_sp_switchdev_ops mlxsw_sp1_switchdev_ops;
97 extern const struct mlxsw_sp_switchdev_ops mlxsw_sp2_switchdev_ops;
111 struct mlxsw_sp_sb;
112 struct mlxsw_sp_bridge;
113 struct mlxsw_sp_router;
114 struct mlxsw_sp_mr;
115 struct mlxsw_sp_acl;
116 struct mlxsw_sp_counter_pool;
117 struct mlxsw_sp_fid_core;
118 struct mlxsw_sp_kvdl;
119 struct mlxsw_sp_nve;
120 struct mlxsw_sp_kvdl_ops;
121 struct mlxsw_sp_mr_tcam_ops;
122 struct mlxsw_sp_acl_rulei_ops;
123 struct mlxsw_sp_acl_tcam_ops;
124 struct mlxsw_sp_nve_ops;
125 struct mlxsw_sp_sb_ops;
126 struct mlxsw_sp_sb_vals;
127 struct mlxsw_sp_port_type_speed_ops;
128 struct mlxsw_sp_ptp_state;
129 struct mlxsw_sp_ptp_ops;
130 struct mlxsw_sp_span_ops;
131 struct mlxsw_sp_qdisc_state;
132 struct mlxsw_sp_mall_entry;
133 struct mlxsw_sp_pgt;
134 struct mlxsw_sp_lag;
136 struct mlxsw_sp_port_mapping {
144 struct mlxsw_sp_port_mapping_events {
145 struct list_head queue;
147 struct work_struct work;
150 struct mlxsw_sp_parsing {
154 struct mutex lock; /* Protects parsing configuration */
157 struct mlxsw_sp {
158 struct mlxsw_sp_port **ports;
159 struct mlxsw_core *core;
160 const struct mlxsw_bus_info *bus_info;
163 struct mlxsw_sp_lag *lags;
165 struct mlxsw_sp_port_mapping *port_mapping;
166 struct mlxsw_sp_port_mapping_events port_mapping_events;
167 struct rhashtable sample_trigger_ht;
168 struct mlxsw_sp_sb *sb;
169 struct mlxsw_sp_bridge *bridge;
170 struct mlxsw_sp_router *router;
171 struct mlxsw_sp_mr *mr;
172 struct mlxsw_afa *afa;
173 struct mlxsw_sp_acl *acl;
174 struct mlxsw_sp_fid_core *fid_core;
175 struct mlxsw_sp_policer_core *policer_core;
176 struct mlxsw_sp_port_range_core *pr_core;
177 struct mlxsw_sp_kvdl *kvdl;
178 struct mlxsw_sp_nve *nve;
179 struct notifier_block netdevice_nb;
180 struct mlxsw_sp_ptp_clock *clock;
181 struct mlxsw_sp_ptp_state *ptp_state;
182 struct mlxsw_sp_counter_pool *counter_pool;
183 struct mlxsw_sp_span *span;
184 struct mlxsw_sp_trap *trap;
185 struct mlxsw_sp_parsing parsing;
186 const struct mlxsw_sp_switchdev_ops *switchdev_ops;
187 const struct mlxsw_sp_kvdl_ops *kvdl_ops;
188 const struct mlxsw_afa_ops *afa_ops;
189 const struct mlxsw_afk_ops *afk_ops;
190 const struct mlxsw_sp_mr_tcam_ops *mr_tcam_ops;
191 const struct mlxsw_sp_acl_rulei_ops *acl_rulei_ops;
192 const struct mlxsw_sp_acl_tcam_ops *acl_tcam_ops;
193 const struct mlxsw_sp_acl_bf_ops *acl_bf_ops;
194 const struct mlxsw_sp_nve_ops **nve_ops_arr;
195 const struct mlxsw_sp_sb_vals *sb_vals;
196 const struct mlxsw_sp_sb_ops *sb_ops;
197 const struct mlxsw_sp_port_type_speed_ops *port_type_speed_ops;
198 const struct mlxsw_sp_ptp_ops *ptp_ops;
199 const struct mlxsw_sp_span_ops *span_ops;
200 const struct mlxsw_sp_policer_core_ops *policer_core_ops;
201 const struct mlxsw_sp_trap_ops *trap_ops;
202 const struct mlxsw_sp_mall_ops *mall_ops;
203 const struct mlxsw_sp_router_ops *router_ops;
204 const struct mlxsw_listener *listeners;
205 const struct mlxsw_sp_fid_core_ops *fid_core_ops;
208 struct rhashtable ipv6_addr_ht;
209 struct mutex ipv6_addr_ht_lock; /* Protects ipv6_addr_ht */
210 struct mlxsw_sp_pgt *pgt;
215 struct mlxsw_sp_ptp_ops {
216 struct mlxsw_sp_ptp_clock *
217 (*clock_init)(struct mlxsw_sp *mlxsw_sp, struct device *dev);
218 void (*clock_fini)(struct mlxsw_sp_ptp_clock *clock);
220 struct mlxsw_sp_ptp_state *(*init)(struct mlxsw_sp *mlxsw_sp);
221 void (*fini)(struct mlxsw_sp_ptp_state *ptp_state);
226 void (*receive)(struct mlxsw_sp *mlxsw_sp, struct sk_buff *skb,
232 void (*transmitted)(struct mlxsw_sp *mlxsw_sp, struct sk_buff *skb,
235 int (*hwtstamp_get)(struct mlxsw_sp_port *mlxsw_sp_port,
236 struct hwtstamp_config *config);
237 int (*hwtstamp_set)(struct mlxsw_sp_port *mlxsw_sp_port,
238 struct hwtstamp_config *config);
239 void (*shaper_work)(struct work_struct *work);
240 int (*get_ts_info)(struct mlxsw_sp *mlxsw_sp,
241 struct kernel_ethtool_ts_info *info);
244 void (*get_stats)(struct mlxsw_sp_port *mlxsw_sp_port,
246 int (*txhdr_construct)(struct mlxsw_core *mlxsw_core,
247 struct mlxsw_sp_port *mlxsw_sp_port,
248 struct sk_buff *skb,
249 const struct mlxsw_tx_info *tx_info);
252 struct mlxsw_sp_fid_core_ops {
253 int (*init)(struct mlxsw_sp *mlxsw_sp);
254 void (*fini)(struct mlxsw_sp *mlxsw_sp);
257 struct mlxsw_sp_port_pcpu_stats {
262 struct u64_stats_sync syncp;
272 struct mlxsw_sp_sample_trigger {
277 struct mlxsw_sp_sample_params {
278 struct psample_group *psample_group;
284 struct mlxsw_sp_bridge_port;
285 struct mlxsw_sp_fid;
287 struct mlxsw_sp_port_vlan {
288 struct list_head list;
289 struct mlxsw_sp_port *mlxsw_sp_port;
290 struct mlxsw_sp_fid *fid;
292 struct mlxsw_sp_bridge_port *bridge_port;
293 struct list_head bridge_vlan_node;
297 struct mlxsw_sp_port_xstats {
307 struct mlxsw_sp_ptp_port_dir_stats {
312 struct mlxsw_sp_ptp_port_stats {
313 struct mlxsw_sp_ptp_port_dir_stats rx_gcd;
314 struct mlxsw_sp_ptp_port_dir_stats tx_gcd;
317 struct mlxsw_sp_port {
318 struct net_device *dev;
319 struct mlxsw_sp_port_pcpu_stats __percpu *pcpu_stats;
320 struct mlxsw_sp *mlxsw_sp;
327 struct {
332 struct {
333 struct ieee_ets *ets;
334 struct ieee_maxrate *maxrate;
335 struct ieee_pfc *pfc;
338 struct mlxsw_sp_port_mapping mapping; /* mapping is constant during the
343 struct {
345 struct rtnl_link_stats64 stats;
346 struct mlxsw_sp_port_xstats xstats;
347 struct delayed_work update_dw;
349 struct list_head vlans_list;
350 struct mlxsw_sp_port_vlan *default_vlan;
351 struct mlxsw_sp_qdisc_state *qdisc;
353 struct mlxsw_sp_flow_block *ing_flow_block;
354 struct mlxsw_sp_flow_block *eg_flow_block;
355 struct {
356 struct delayed_work shaper_dw;
357 struct hwtstamp_config hwtstamp_config;
360 struct mlxsw_sp_ptp_port_stats stats;
363 struct mlxsw_sp_hdroom *hdroom;
367 struct mlxsw_sp_port_type_speed_ops {
368 void (*from_ptys_supported_port)(struct mlxsw_sp *mlxsw_sp,
370 struct ethtool_link_ksettings *cmd);
371 void (*from_ptys_link)(struct mlxsw_sp *mlxsw_sp, u32 ptys_eth_proto,
373 u32 (*from_ptys_speed)(struct mlxsw_sp *mlxsw_sp, u32 ptys_eth_proto);
374 void (*from_ptys_link_mode)(struct mlxsw_sp *mlxsw_sp,
376 struct ethtool_link_ksettings *cmd);
377 int (*ptys_max_speed)(struct mlxsw_sp_port *mlxsw_sp_port, u32 *p_max_speed);
378 u32 (*to_ptys_advert_link)(struct mlxsw_sp *mlxsw_sp,
379 const struct ethtool_link_ksettings *cmd);
380 u32 (*to_ptys_speed_lanes)(struct mlxsw_sp *mlxsw_sp, u8 width,
381 const struct ethtool_link_ksettings *cmd);
382 void (*reg_ptys_eth_pack)(struct mlxsw_sp *mlxsw_sp, char *payload,
384 void (*reg_ptys_eth_unpack)(struct mlxsw_sp *mlxsw_sp, char *payload,
391 struct mlxsw_sp_ports_bitmap {
397 mlxsw_sp_port_bitmap_init(struct mlxsw_sp *mlxsw_sp, in mlxsw_sp_port_bitmap_init()
398 struct mlxsw_sp_ports_bitmap *ports_bm) in mlxsw_sp_port_bitmap_init()
411 mlxsw_sp_port_bitmap_fini(struct mlxsw_sp_ports_bitmap *ports_bm) in mlxsw_sp_port_bitmap_fini()
430 static inline struct net_device *
431 mlxsw_sp_bridge_vxlan_dev_find(struct net_device *br_dev) in mlxsw_sp_bridge_vxlan_dev_find()
433 struct net_device *dev; in mlxsw_sp_bridge_vxlan_dev_find()
434 struct list_head *iter; in mlxsw_sp_bridge_vxlan_dev_find()
444 static inline bool mlxsw_sp_bridge_has_vxlan(struct net_device *br_dev) in mlxsw_sp_bridge_has_vxlan()
450 mlxsw_sp_vxlan_mapped_vid(const struct net_device *vxlan_dev, u16 *p_vid) in mlxsw_sp_vxlan_mapped_vid()
452 struct bridge_vlan_info vinfo; in mlxsw_sp_vxlan_mapped_vid()
470 mlxsw_sp_port_is_pause_en(const struct mlxsw_sp_port *mlxsw_sp_port) in mlxsw_sp_port_is_pause_en()
475 static inline struct mlxsw_sp_port *
476 mlxsw_sp_port_lagged_get(struct mlxsw_sp *mlxsw_sp, u16 lag_id, u8 port_index) in mlxsw_sp_port_lagged_get()
478 struct mlxsw_sp_port *mlxsw_sp_port; in mlxsw_sp_port_lagged_get()
487 static inline struct mlxsw_sp_port_vlan *
488 mlxsw_sp_port_vlan_find_by_vid(const struct mlxsw_sp_port *mlxsw_sp_port, in mlxsw_sp_port_vlan_find_by_vid()
491 struct mlxsw_sp_port_vlan *mlxsw_sp_port_vlan; in mlxsw_sp_port_vlan_find_by_vid()
512 int mlxsw_sp_port_get_stats_raw(struct net_device *dev, int grp,
514 int mlxsw_sp_port_admin_status_set(struct mlxsw_sp_port *mlxsw_sp_port,
517 mlxsw_sp_port_vlan_classification_set(struct mlxsw_sp_port *mlxsw_sp_port,
521 mlxsw_sp_local_port_is_valid(struct mlxsw_sp *mlxsw_sp, u16 local_port) in mlxsw_sp_local_port_is_valid()
529 struct mlxsw_sp_hdroom_prio {
541 struct mlxsw_sp_hdroom_buf {
556 struct mlxsw_sp_hdroom {
559 struct {
560 struct mlxsw_sp_hdroom_prio prio[IEEE_8021Q_MAX_PRIORITIES];
562 struct {
563 struct mlxsw_sp_hdroom_buf buf[MLXSW_SP_PB_COUNT];
565 struct {
580 int mlxsw_sp_buffers_init(struct mlxsw_sp *mlxsw_sp);
581 void mlxsw_sp_buffers_fini(struct mlxsw_sp *mlxsw_sp);
582 int mlxsw_sp_port_buffers_init(struct mlxsw_sp_port *mlxsw_sp_port);
583 void mlxsw_sp_port_buffers_fini(struct mlxsw_sp_port *mlxsw_sp_port);
584 int mlxsw_sp_sb_pool_get(struct mlxsw_core *mlxsw_core,
586 struct devlink_sb_pool_info *pool_info);
587 int mlxsw_sp_sb_pool_set(struct mlxsw_core *mlxsw_core,
590 struct netlink_ext_ack *extack);
591 int mlxsw_sp_sb_port_pool_get(struct mlxsw_core_port *mlxsw_core_port,
594 int mlxsw_sp_sb_port_pool_set(struct mlxsw_core_port *mlxsw_core_port,
596 u32 threshold, struct netlink_ext_ack *extack);
597 int mlxsw_sp_sb_tc_pool_bind_get(struct mlxsw_core_port *mlxsw_core_port,
601 int mlxsw_sp_sb_tc_pool_bind_set(struct mlxsw_core_port *mlxsw_core_port,
605 struct netlink_ext_ack *extack);
606 int mlxsw_sp_sb_occ_snapshot(struct mlxsw_core *mlxsw_core,
608 int mlxsw_sp_sb_occ_max_clear(struct mlxsw_core *mlxsw_core,
610 int mlxsw_sp_sb_occ_port_pool_get(struct mlxsw_core_port *mlxsw_core_port,
613 int mlxsw_sp_sb_occ_tc_port_bind_get(struct mlxsw_core_port *mlxsw_core_port,
617 u32 mlxsw_sp_cells_bytes(const struct mlxsw_sp *mlxsw_sp, u32 cells);
618 u32 mlxsw_sp_bytes_cells(const struct mlxsw_sp *mlxsw_sp, u32 bytes);
619 void mlxsw_sp_hdroom_prios_reset_buf_idx(struct mlxsw_sp_hdroom *hdroom);
620 void mlxsw_sp_hdroom_bufs_reset_lossiness(struct mlxsw_sp_hdroom *hdroom);
621 void mlxsw_sp_hdroom_bufs_reset_sizes(struct mlxsw_sp_port *mlxsw_sp_port,
622 struct mlxsw_sp_hdroom *hdroom);
623 int mlxsw_sp_hdroom_configure(struct mlxsw_sp_port *mlxsw_sp_port,
624 const struct mlxsw_sp_hdroom *hdroom);
625 struct mlxsw_sp_sample_params *
626 mlxsw_sp_sample_trigger_params_lookup(struct mlxsw_sp *mlxsw_sp,
627 const struct mlxsw_sp_sample_trigger *trigger);
629 mlxsw_sp_sample_trigger_params_set(struct mlxsw_sp *mlxsw_sp,
630 const struct mlxsw_sp_sample_trigger *trigger,
631 const struct mlxsw_sp_sample_params *params,
632 struct netlink_ext_ack *extack);
634 mlxsw_sp_sample_trigger_params_unset(struct mlxsw_sp *mlxsw_sp,
635 const struct mlxsw_sp_sample_trigger *trigger);
636 int mlxsw_sp_ipv6_addr_kvdl_index_get(struct mlxsw_sp *mlxsw_sp,
637 const struct in6_addr *addr6,
640 mlxsw_sp_ipv6_addr_put(struct mlxsw_sp *mlxsw_sp, const struct in6_addr *addr6);
642 extern const struct mlxsw_sp_sb_vals mlxsw_sp1_sb_vals;
643 extern const struct mlxsw_sp_sb_vals mlxsw_sp2_sb_vals;
645 extern const struct mlxsw_sp_sb_ops mlxsw_sp1_sb_ops;
646 extern const struct mlxsw_sp_sb_ops mlxsw_sp2_sb_ops;
647 extern const struct mlxsw_sp_sb_ops mlxsw_sp3_sb_ops;
650 int mlxsw_sp_switchdev_init(struct mlxsw_sp *mlxsw_sp);
651 void mlxsw_sp_switchdev_fini(struct mlxsw_sp *mlxsw_sp);
652 int mlxsw_sp_rif_fdb_op(struct mlxsw_sp *mlxsw_sp, const char *mac, u16 fid,
655 mlxsw_sp_port_vlan_bridge_leave(struct mlxsw_sp_port_vlan *mlxsw_sp_port_vlan);
656 int mlxsw_sp_port_bridge_join(struct mlxsw_sp_port *mlxsw_sp_port,
657 struct net_device *brport_dev,
658 struct net_device *br_dev,
659 struct netlink_ext_ack *extack);
660 void mlxsw_sp_port_bridge_leave(struct mlxsw_sp_port *mlxsw_sp_port,
661 struct net_device *brport_dev,
662 struct net_device *br_dev);
663 bool mlxsw_sp_bridge_device_is_offloaded(const struct mlxsw_sp *mlxsw_sp,
664 const struct net_device *br_dev);
665 int mlxsw_sp_bridge_vxlan_join(struct mlxsw_sp *mlxsw_sp,
666 const struct net_device *br_dev,
667 const struct net_device *vxlan_dev, u16 vid,
668 struct netlink_ext_ack *extack);
669 void mlxsw_sp_bridge_vxlan_leave(struct mlxsw_sp *mlxsw_sp,
670 const struct net_device *vxlan_dev);
671 extern struct notifier_block mlxsw_sp_switchdev_notifier;
674 void mlxsw_sp_rx_listener_no_mark_func(struct sk_buff *skb,
676 void mlxsw_sp_ptp_receive(struct mlxsw_sp *mlxsw_sp, struct sk_buff *skb,
678 int mlxsw_sp_port_speed_get(struct mlxsw_sp_port *mlxsw_sp_port, u32 *speed);
679 int mlxsw_sp_port_ets_set(struct mlxsw_sp_port *mlxsw_sp_port,
682 int mlxsw_sp_port_prio_tc_set(struct mlxsw_sp_port *mlxsw_sp_port,
684 int mlxsw_sp_port_ets_maxrate_set(struct mlxsw_sp_port *mlxsw_sp_port,
688 int mlxsw_sp_port_vid_stp_set(struct mlxsw_sp_port *mlxsw_sp_port, u16 vid,
690 int mlxsw_sp_port_vp_mode_set(struct mlxsw_sp_port *mlxsw_sp_port, bool enable);
691 int mlxsw_sp_port_vid_learning_set(struct mlxsw_sp_port *mlxsw_sp_port, u16 vid,
693 int mlxsw_sp_port_security_set(struct mlxsw_sp_port *mlxsw_sp_port,
696 int mlxsw_sp_port_egress_ethtype_set(struct mlxsw_sp_port *mlxsw_sp_port,
698 int mlxsw_sp_port_pvid_set(struct mlxsw_sp_port *mlxsw_sp_port, u16 vid,
700 struct mlxsw_sp_port_vlan *
701 mlxsw_sp_port_vlan_create(struct mlxsw_sp_port *mlxsw_sp_port, u16 vid);
702 void mlxsw_sp_port_vlan_destroy(struct mlxsw_sp_port_vlan *mlxsw_sp_port_vlan);
703 int mlxsw_sp_port_kill_vid(struct net_device *dev,
705 int mlxsw_sp_port_vlan_set(struct mlxsw_sp_port *mlxsw_sp_port, u16 vid_begin,
707 int mlxsw_sp_flow_counter_get(struct mlxsw_sp *mlxsw_sp,
710 int mlxsw_sp_flow_counter_alloc(struct mlxsw_sp *mlxsw_sp,
712 void mlxsw_sp_flow_counter_free(struct mlxsw_sp *mlxsw_sp,
714 void mlxsw_sp_txhdr_construct(struct sk_buff *skb,
715 const struct mlxsw_tx_info *tx_info);
716 int mlxsw_sp_txhdr_ptp_data_construct(struct mlxsw_core *mlxsw_core,
717 struct mlxsw_sp_port *mlxsw_sp_port,
718 struct sk_buff *skb,
719 const struct mlxsw_tx_info *tx_info);
720 bool mlxsw_sp_port_dev_check(const struct net_device *dev);
721 struct mlxsw_sp *mlxsw_sp_lower_get(struct net_device *dev);
722 struct mlxsw_sp_port *mlxsw_sp_port_dev_lower_find(struct net_device *dev);
723 struct mlxsw_sp_port *mlxsw_sp_port_dev_lower_find_rcu(struct net_device *dev);
724 int mlxsw_sp_parsing_depth_inc(struct mlxsw_sp *mlxsw_sp);
725 void mlxsw_sp_parsing_depth_dec(struct mlxsw_sp *mlxsw_sp);
726 int mlxsw_sp_parsing_vxlan_udp_dport_set(struct mlxsw_sp *mlxsw_sp,
731 int mlxsw_sp_port_dcb_init(struct mlxsw_sp_port *mlxsw_sp_port);
732 void mlxsw_sp_port_dcb_fini(struct mlxsw_sp_port *mlxsw_sp_port);
734 static inline int mlxsw_sp_port_dcb_init(struct mlxsw_sp_port *mlxsw_sp_port) in mlxsw_sp_port_dcb_init()
738 static inline void mlxsw_sp_port_dcb_fini(struct mlxsw_sp_port *mlxsw_sp_port) in mlxsw_sp_port_dcb_fini()
751 struct in6_addr addr6;
754 u16 mlxsw_sp_rif_index(const struct mlxsw_sp_rif *rif);
755 int mlxsw_sp_rif_subport_port(const struct mlxsw_sp_rif *rif,
757 int mlxsw_sp_router_init(struct mlxsw_sp *mlxsw_sp,
758 struct netlink_ext_ack *extack);
759 void mlxsw_sp_router_fini(struct mlxsw_sp *mlxsw_sp);
760 void mlxsw_sp_rif_macvlan_del(struct mlxsw_sp *mlxsw_sp,
761 const struct net_device *macvlan_dev);
763 mlxsw_sp_port_vlan_router_leave(struct mlxsw_sp_port_vlan *mlxsw_sp_port_vlan);
764 void mlxsw_sp_rif_destroy_by_dev(struct mlxsw_sp *mlxsw_sp,
765 struct net_device *dev);
766 bool mlxsw_sp_rif_exists(struct mlxsw_sp *mlxsw_sp,
767 const struct net_device *dev);
768 u16 mlxsw_sp_rif_vid(struct mlxsw_sp *mlxsw_sp, const struct net_device *dev);
769 u16 mlxsw_sp_router_port(const struct mlxsw_sp *mlxsw_sp);
770 int mlxsw_sp_router_nve_promote_decap(struct mlxsw_sp *mlxsw_sp, u32 ul_tb_id,
774 void mlxsw_sp_router_nve_demote_decap(struct mlxsw_sp *mlxsw_sp, u32 ul_tb_id,
777 int mlxsw_sp_router_tb_id_vr_id(struct mlxsw_sp *mlxsw_sp, u32 tb_id,
779 int mlxsw_sp_router_ul_rif_get(struct mlxsw_sp *mlxsw_sp, u32 ul_tb_id,
781 void mlxsw_sp_router_ul_rif_put(struct mlxsw_sp *mlxsw_sp, u16 ul_rif_index);
808 struct mlxsw_sp_kvdl_ops {
810 int (*init)(struct mlxsw_sp *mlxsw_sp, void *priv);
811 void (*fini)(struct mlxsw_sp *mlxsw_sp, void *priv);
812 int (*alloc)(struct mlxsw_sp *mlxsw_sp, void *priv,
815 void (*free)(struct mlxsw_sp *mlxsw_sp, void *priv,
818 int (*alloc_size_query)(struct mlxsw_sp *mlxsw_sp, void *priv,
822 int (*resources_register)(struct mlxsw_sp *mlxsw_sp, void *priv);
825 int mlxsw_sp_kvdl_init(struct mlxsw_sp *mlxsw_sp);
826 void mlxsw_sp_kvdl_fini(struct mlxsw_sp *mlxsw_sp);
827 int mlxsw_sp_kvdl_alloc(struct mlxsw_sp *mlxsw_sp,
830 void mlxsw_sp_kvdl_free(struct mlxsw_sp *mlxsw_sp,
833 int mlxsw_sp_kvdl_alloc_count_query(struct mlxsw_sp *mlxsw_sp,
839 extern const struct mlxsw_sp_kvdl_ops mlxsw_sp1_kvdl_ops;
840 int mlxsw_sp1_kvdl_resources_register(struct mlxsw_core *mlxsw_core);
843 extern const struct mlxsw_sp_kvdl_ops mlxsw_sp2_kvdl_ops;
863 struct mlxsw_sp_acl_rule_info {
865 struct mlxsw_afk_element_values values;
866 struct mlxsw_afa_block *act_block;
879 struct {
886 struct mlxsw_sp_flow_block {
887 struct list_head binding_list;
888 struct {
889 struct list_head list;
893 struct mlxsw_sp_acl_ruleset *ruleset_zero;
894 struct mlxsw_sp *mlxsw_sp;
901 struct net *net;
904 struct mlxsw_sp_flow_block_binding {
905 struct list_head list;
906 struct mlxsw_sp_port *mlxsw_sp_port;
910 static inline struct mlxsw_sp *
911 mlxsw_sp_flow_block_mlxsw_sp(struct mlxsw_sp_flow_block *block) in mlxsw_sp_flow_block_mlxsw_sp()
917 mlxsw_sp_flow_block_rule_count(const struct mlxsw_sp_flow_block *block) in mlxsw_sp_flow_block_rule_count()
923 mlxsw_sp_flow_block_disable_inc(struct mlxsw_sp_flow_block *block) in mlxsw_sp_flow_block_disable_inc()
930 mlxsw_sp_flow_block_disable_dec(struct mlxsw_sp_flow_block *block) in mlxsw_sp_flow_block_disable_dec()
937 mlxsw_sp_flow_block_disabled(const struct mlxsw_sp_flow_block *block) in mlxsw_sp_flow_block_disabled()
943 mlxsw_sp_flow_block_is_egress_bound(const struct mlxsw_sp_flow_block *block) in mlxsw_sp_flow_block_is_egress_bound()
949 mlxsw_sp_flow_block_is_ingress_bound(const struct mlxsw_sp_flow_block *block) in mlxsw_sp_flow_block_is_ingress_bound()
955 mlxsw_sp_flow_block_is_mixed_bound(const struct mlxsw_sp_flow_block *block) in mlxsw_sp_flow_block_is_mixed_bound()
960 struct mlxsw_sp_flow_block *mlxsw_sp_flow_block_create(struct mlxsw_sp *mlxsw_sp,
961 struct net *net);
962 void mlxsw_sp_flow_block_destroy(struct mlxsw_sp_flow_block *block);
963 int mlxsw_sp_setup_tc_block_clsact(struct mlxsw_sp_port *mlxsw_sp_port,
964 struct flow_block_offload *f,
968 struct mlxsw_sp_acl_ruleset;
975 struct mlxsw_afk *mlxsw_sp_acl_afk(struct mlxsw_sp_acl *acl);
976 struct mlxsw_sp_acl_tcam *mlxsw_sp_acl_to_tcam(struct mlxsw_sp_acl *acl);
978 int mlxsw_sp_acl_ruleset_bind(struct mlxsw_sp *mlxsw_sp,
979 struct mlxsw_sp_flow_block *block,
980 struct mlxsw_sp_flow_block_binding *binding);
981 void mlxsw_sp_acl_ruleset_unbind(struct mlxsw_sp *mlxsw_sp,
982 struct mlxsw_sp_flow_block *block,
983 struct mlxsw_sp_flow_block_binding *binding);
984 struct mlxsw_sp_acl_ruleset *
985 mlxsw_sp_acl_ruleset_lookup(struct mlxsw_sp *mlxsw_sp,
986 struct mlxsw_sp_flow_block *block, u32 chain_index,
988 struct mlxsw_sp_acl_ruleset *
989 mlxsw_sp_acl_ruleset_get(struct mlxsw_sp *mlxsw_sp,
990 struct mlxsw_sp_flow_block *block, u32 chain_index,
992 struct mlxsw_afk_element_usage *tmplt_elusage);
993 void mlxsw_sp_acl_ruleset_put(struct mlxsw_sp *mlxsw_sp,
994 struct mlxsw_sp_acl_ruleset *ruleset);
995 u16 mlxsw_sp_acl_ruleset_group_id(struct mlxsw_sp_acl_ruleset *ruleset);
996 void mlxsw_sp_acl_ruleset_prio_get(struct mlxsw_sp_acl_ruleset *ruleset,
1000 struct mlxsw_sp_acl_rule_info *
1001 mlxsw_sp_acl_rulei_create(struct mlxsw_sp_acl *acl,
1002 struct mlxsw_afa_block *afa_block);
1003 void mlxsw_sp_acl_rulei_destroy(struct mlxsw_sp *mlxsw_sp,
1004 struct mlxsw_sp_acl_rule_info *rulei);
1005 int mlxsw_sp_acl_rulei_commit(struct mlxsw_sp_acl_rule_info *rulei);
1006 void mlxsw_sp_acl_rulei_priority(struct mlxsw_sp_acl_rule_info *rulei,
1008 void mlxsw_sp_acl_rulei_keymask_u32(struct mlxsw_sp_acl_rule_info *rulei,
1011 void mlxsw_sp_acl_rulei_keymask_buf(struct mlxsw_sp_acl_rule_info *rulei,
1015 int mlxsw_sp_acl_rulei_act_continue(struct mlxsw_sp_acl_rule_info *rulei);
1016 int mlxsw_sp_acl_rulei_act_jump(struct mlxsw_sp_acl_rule_info *rulei,
1018 int mlxsw_sp_acl_rulei_act_terminate(struct mlxsw_sp_acl_rule_info *rulei);
1019 int mlxsw_sp_acl_rulei_act_drop(struct mlxsw_sp_acl_rule_info *rulei,
1021 const struct flow_action_cookie *fa_cookie,
1022 struct netlink_ext_ack *extack);
1023 int mlxsw_sp_acl_rulei_act_trap(struct mlxsw_sp_acl_rule_info *rulei);
1024 int mlxsw_sp_acl_rulei_act_mirror(struct mlxsw_sp *mlxsw_sp,
1025 struct mlxsw_sp_acl_rule_info *rulei,
1026 struct mlxsw_sp_flow_block *block,
1027 struct net_device *out_dev,
1028 struct netlink_ext_ack *extack);
1029 int mlxsw_sp_acl_rulei_act_fwd(struct mlxsw_sp *mlxsw_sp,
1030 struct mlxsw_sp_acl_rule_info *rulei,
1031 struct net_device *out_dev,
1032 struct netlink_ext_ack *extack);
1033 int mlxsw_sp_acl_rulei_act_vlan(struct mlxsw_sp *mlxsw_sp,
1034 struct mlxsw_sp_acl_rule_info *rulei,
1036 struct netlink_ext_ack *extack);
1037 int mlxsw_sp_acl_rulei_act_priority(struct mlxsw_sp *mlxsw_sp,
1038 struct mlxsw_sp_acl_rule_info *rulei,
1039 u32 prio, struct netlink_ext_ack *extack);
1040 int mlxsw_sp_acl_rulei_act_mangle(struct mlxsw_sp *mlxsw_sp,
1041 struct mlxsw_sp_acl_rule_info *rulei,
1044 struct netlink_ext_ack *extack);
1045 int mlxsw_sp_acl_rulei_act_police(struct mlxsw_sp *mlxsw_sp,
1046 struct mlxsw_sp_acl_rule_info *rulei,
1048 u32 burst, struct netlink_ext_ack *extack);
1049 int mlxsw_sp_acl_rulei_act_count(struct mlxsw_sp *mlxsw_sp,
1050 struct mlxsw_sp_acl_rule_info *rulei,
1051 struct netlink_ext_ack *extack);
1052 int mlxsw_sp_acl_rulei_act_fid_set(struct mlxsw_sp *mlxsw_sp,
1053 struct mlxsw_sp_acl_rule_info *rulei,
1054 u16 fid, struct netlink_ext_ack *extack);
1055 int mlxsw_sp_acl_rulei_act_ignore(struct mlxsw_sp *mlxsw_sp,
1056 struct mlxsw_sp_acl_rule_info *rulei,
1058 int mlxsw_sp_acl_rulei_act_sample(struct mlxsw_sp *mlxsw_sp,
1059 struct mlxsw_sp_acl_rule_info *rulei,
1060 struct mlxsw_sp_flow_block *block,
1061 struct psample_group *psample_group, u32 rate,
1063 struct netlink_ext_ack *extack);
1065 struct mlxsw_sp_acl_rule;
1067 struct mlxsw_sp_acl_rule *
1068 mlxsw_sp_acl_rule_create(struct mlxsw_sp *mlxsw_sp,
1069 struct mlxsw_sp_acl_ruleset *ruleset,
1071 struct mlxsw_afa_block *afa_block,
1072 struct netlink_ext_ack *extack);
1073 void mlxsw_sp_acl_rule_destroy(struct mlxsw_sp *mlxsw_sp,
1074 struct mlxsw_sp_acl_rule *rule);
1075 int mlxsw_sp_acl_rule_add(struct mlxsw_sp *mlxsw_sp,
1076 struct mlxsw_sp_acl_rule *rule);
1077 void mlxsw_sp_acl_rule_del(struct mlxsw_sp *mlxsw_sp,
1078 struct mlxsw_sp_acl_rule *rule);
1079 int mlxsw_sp_acl_rule_action_replace(struct mlxsw_sp *mlxsw_sp,
1080 struct mlxsw_sp_acl_rule *rule,
1081 struct mlxsw_afa_block *afa_block);
1082 struct mlxsw_sp_acl_rule *
1083 mlxsw_sp_acl_rule_lookup(struct mlxsw_sp *mlxsw_sp,
1084 struct mlxsw_sp_acl_ruleset *ruleset,
1086 struct mlxsw_sp_acl_rule_info *
1087 mlxsw_sp_acl_rule_rulei(struct mlxsw_sp_acl_rule *rule);
1088 int mlxsw_sp_acl_rule_get_stats(struct mlxsw_sp *mlxsw_sp,
1089 struct mlxsw_sp_acl_rule *rule,
1094 struct mlxsw_sp_fid *mlxsw_sp_acl_dummy_fid(struct mlxsw_sp *mlxsw_sp);
1096 static inline const struct flow_action_cookie *
1097 mlxsw_sp_acl_act_cookie_lookup(struct mlxsw_sp *mlxsw_sp, u32 cookie_index) in mlxsw_sp_acl_act_cookie_lookup()
1102 int mlxsw_sp_acl_init(struct mlxsw_sp *mlxsw_sp);
1103 void mlxsw_sp_acl_fini(struct mlxsw_sp *mlxsw_sp);
1105 struct mlxsw_sp_acl_mangle_action;
1107 struct mlxsw_sp_acl_rulei_ops {
1108 int (*act_mangle_field)(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_acl_rule_info *rulei,
1109 struct mlxsw_sp_acl_mangle_action *mact, u32 val,
1110 struct netlink_ext_ack *extack);
1113 extern struct mlxsw_sp_acl_rulei_ops mlxsw_sp1_acl_rulei_ops;
1114 extern struct mlxsw_sp_acl_rulei_ops mlxsw_sp2_acl_rulei_ops;
1117 struct mlxsw_sp_acl_tcam;
1118 struct mlxsw_sp_acl_tcam_region;
1120 struct mlxsw_sp_acl_tcam_ops {
1123 int (*init)(struct mlxsw_sp *mlxsw_sp, void *priv,
1124 struct mlxsw_sp_acl_tcam *tcam);
1125 void (*fini)(struct mlxsw_sp *mlxsw_sp, void *priv);
1127 int (*region_init)(struct mlxsw_sp *mlxsw_sp, void *region_priv,
1129 struct mlxsw_sp_acl_tcam_region *region,
1131 void (*region_fini)(struct mlxsw_sp *mlxsw_sp, void *region_priv);
1132 int (*region_associate)(struct mlxsw_sp *mlxsw_sp,
1133 struct mlxsw_sp_acl_tcam_region *region);
1141 int (*entry_add)(struct mlxsw_sp *mlxsw_sp,
1144 struct mlxsw_sp_acl_rule_info *rulei);
1145 void (*entry_del)(struct mlxsw_sp *mlxsw_sp,
1148 int (*entry_action_replace)(struct mlxsw_sp *mlxsw_sp,
1150 struct mlxsw_sp_acl_rule_info *rulei);
1151 int (*entry_activity_get)(struct mlxsw_sp *mlxsw_sp,
1157 extern const struct mlxsw_sp_acl_tcam_ops mlxsw_sp1_acl_tcam_ops;
1160 extern const struct mlxsw_sp_acl_tcam_ops mlxsw_sp2_acl_tcam_ops;
1163 extern const struct mlxsw_afa_ops mlxsw_sp1_act_afa_ops;
1164 extern const struct mlxsw_afa_ops mlxsw_sp2_act_afa_ops;
1167 extern const struct mlxsw_afk_ops mlxsw_sp1_afk_ops;
1168 extern const struct mlxsw_afk_ops mlxsw_sp2_afk_ops;
1169 extern const struct mlxsw_afk_ops mlxsw_sp4_afk_ops;
1172 extern const struct mlxsw_sp_acl_bf_ops mlxsw_sp2_acl_bf_ops;
1173 extern const struct mlxsw_sp_acl_bf_ops mlxsw_sp4_acl_bf_ops;
1176 struct mlxsw_sp_mall_ops {
1177 int (*sample_add)(struct mlxsw_sp *mlxsw_sp,
1178 struct mlxsw_sp_port *mlxsw_sp_port,
1179 struct mlxsw_sp_mall_entry *mall_entry,
1180 struct netlink_ext_ack *extack);
1181 void (*sample_del)(struct mlxsw_sp *mlxsw_sp,
1182 struct mlxsw_sp_port *mlxsw_sp_port,
1183 struct mlxsw_sp_mall_entry *mall_entry);
1186 extern const struct mlxsw_sp_mall_ops mlxsw_sp1_mall_ops;
1187 extern const struct mlxsw_sp_mall_ops mlxsw_sp2_mall_ops;
1195 struct mlxsw_sp_mall_mirror_entry {
1196 const struct net_device *to_dev;
1200 struct mlxsw_sp_mall_trap_entry {
1204 struct mlxsw_sp_mall_sample_entry {
1205 struct mlxsw_sp_sample_params params;
1209 struct mlxsw_sp_mall_entry {
1210 struct list_head list;
1216 struct mlxsw_sp_mall_mirror_entry mirror;
1217 struct mlxsw_sp_mall_trap_entry trap;
1218 struct mlxsw_sp_mall_sample_entry sample;
1220 struct rcu_head rcu;
1223 int mlxsw_sp_mall_replace(struct mlxsw_sp *mlxsw_sp,
1224 struct mlxsw_sp_flow_block *block,
1225 struct tc_cls_matchall_offload *f);
1226 void mlxsw_sp_mall_destroy(struct mlxsw_sp_flow_block *block,
1227 struct tc_cls_matchall_offload *f);
1228 int mlxsw_sp_mall_port_bind(struct mlxsw_sp_flow_block *block,
1229 struct mlxsw_sp_port *mlxsw_sp_port,
1230 struct netlink_ext_ack *extack);
1231 void mlxsw_sp_mall_port_unbind(struct mlxsw_sp_flow_block *block,
1232 struct mlxsw_sp_port *mlxsw_sp_port);
1233 int mlxsw_sp_mall_prio_get(struct mlxsw_sp_flow_block *block, u32 chain_index,
1237 int mlxsw_sp_flower_replace(struct mlxsw_sp *mlxsw_sp,
1238 struct mlxsw_sp_flow_block *block,
1239 struct flow_cls_offload *f);
1240 void mlxsw_sp_flower_destroy(struct mlxsw_sp *mlxsw_sp,
1241 struct mlxsw_sp_flow_block *block,
1242 struct flow_cls_offload *f);
1243 int mlxsw_sp_flower_stats(struct mlxsw_sp *mlxsw_sp,
1244 struct mlxsw_sp_flow_block *block,
1245 struct flow_cls_offload *f);
1246 int mlxsw_sp_flower_tmplt_create(struct mlxsw_sp *mlxsw_sp,
1247 struct mlxsw_sp_flow_block *block,
1248 struct flow_cls_offload *f);
1249 void mlxsw_sp_flower_tmplt_destroy(struct mlxsw_sp *mlxsw_sp,
1250 struct mlxsw_sp_flow_block *block,
1251 struct flow_cls_offload *f);
1252 int mlxsw_sp_flower_prio_get(struct mlxsw_sp *mlxsw_sp,
1253 struct mlxsw_sp_flow_block *block,
1258 int mlxsw_sp_tc_qdisc_init(struct mlxsw_sp_port *mlxsw_sp_port);
1259 void mlxsw_sp_tc_qdisc_fini(struct mlxsw_sp_port *mlxsw_sp_port);
1260 int mlxsw_sp_setup_tc_red(struct mlxsw_sp_port *mlxsw_sp_port,
1261 struct tc_red_qopt_offload *p);
1262 int mlxsw_sp_setup_tc_prio(struct mlxsw_sp_port *mlxsw_sp_port,
1263 struct tc_prio_qopt_offload *p);
1264 int mlxsw_sp_setup_tc_ets(struct mlxsw_sp_port *mlxsw_sp_port,
1265 struct tc_ets_qopt_offload *p);
1266 int mlxsw_sp_setup_tc_tbf(struct mlxsw_sp_port *mlxsw_sp_port,
1267 struct tc_tbf_qopt_offload *p);
1268 int mlxsw_sp_setup_tc_fifo(struct mlxsw_sp_port *mlxsw_sp_port,
1269 struct tc_fifo_qopt_offload *p);
1270 int mlxsw_sp_setup_tc_block_qevent_early_drop(struct mlxsw_sp_port *mlxsw_sp_port,
1271 struct flow_block_offload *f);
1272 int mlxsw_sp_setup_tc_block_qevent_mark(struct mlxsw_sp_port *mlxsw_sp_port,
1273 struct flow_block_offload *f);
1276 struct mlxsw_sp_fid *mlxsw_sp_fid_lookup_by_index(struct mlxsw_sp *mlxsw_sp,
1278 int mlxsw_sp_fid_nve_ifindex(const struct mlxsw_sp_fid *fid, int *nve_ifindex);
1279 int mlxsw_sp_fid_nve_type(const struct mlxsw_sp_fid *fid,
1281 struct mlxsw_sp_fid *mlxsw_sp_fid_lookup_by_vni(struct mlxsw_sp *mlxsw_sp,
1283 int mlxsw_sp_fid_vni(const struct mlxsw_sp_fid *fid, __be32 *vni);
1284 int mlxsw_sp_fid_nve_flood_index_set(struct mlxsw_sp_fid *fid,
1286 void mlxsw_sp_fid_nve_flood_index_clear(struct mlxsw_sp_fid *fid);
1287 bool mlxsw_sp_fid_nve_flood_index_is_set(const struct mlxsw_sp_fid *fid);
1288 int mlxsw_sp_fid_vni_set(struct mlxsw_sp_fid *fid, enum mlxsw_sp_nve_type type,
1290 void mlxsw_sp_fid_vni_clear(struct mlxsw_sp_fid *fid);
1291 bool mlxsw_sp_fid_vni_is_set(const struct mlxsw_sp_fid *fid);
1292 void mlxsw_sp_fid_fdb_clear_offload(const struct mlxsw_sp_fid *fid,
1293 const struct net_device *nve_dev);
1294 int mlxsw_sp_fid_flood_set(struct mlxsw_sp_fid *fid,
1297 int mlxsw_sp_fid_port_vid_map(struct mlxsw_sp_fid *fid,
1298 struct mlxsw_sp_port *mlxsw_sp_port, u16 vid);
1299 void mlxsw_sp_fid_port_vid_unmap(struct mlxsw_sp_fid *fid,
1300 struct mlxsw_sp_port *mlxsw_sp_port, u16 vid);
1301 u16 mlxsw_sp_fid_index(const struct mlxsw_sp_fid *fid);
1302 enum mlxsw_sp_fid_type mlxsw_sp_fid_type(const struct mlxsw_sp_fid *fid);
1303 int mlxsw_sp_fid_rif_set(struct mlxsw_sp_fid *fid, struct mlxsw_sp_rif *rif);
1304 void mlxsw_sp_fid_rif_unset(struct mlxsw_sp_fid *fid);
1305 struct mlxsw_sp_rif *mlxsw_sp_fid_rif(const struct mlxsw_sp_fid *fid);
1307 mlxsw_sp_fid_type_rif_type(const struct mlxsw_sp *mlxsw_sp,
1309 u16 mlxsw_sp_fid_8021q_vid(const struct mlxsw_sp_fid *fid);
1310 struct mlxsw_sp_fid *mlxsw_sp_fid_8021q_get(struct mlxsw_sp *mlxsw_sp, u16 vid);
1311 struct mlxsw_sp_fid *mlxsw_sp_fid_8021d_get(struct mlxsw_sp *mlxsw_sp,
1313 struct mlxsw_sp_fid *mlxsw_sp_fid_8021q_lookup(struct mlxsw_sp *mlxsw_sp,
1315 struct mlxsw_sp_fid *mlxsw_sp_fid_8021d_lookup(struct mlxsw_sp *mlxsw_sp,
1317 struct mlxsw_sp_fid *mlxsw_sp_fid_rfid_get(struct mlxsw_sp *mlxsw_sp,
1319 struct mlxsw_sp_fid *mlxsw_sp_fid_dummy_get(struct mlxsw_sp *mlxsw_sp);
1320 void mlxsw_sp_fid_put(struct mlxsw_sp_fid *fid);
1321 int mlxsw_sp_port_fids_init(struct mlxsw_sp_port *mlxsw_sp_port);
1322 void mlxsw_sp_port_fids_fini(struct mlxsw_sp_port *mlxsw_sp_port);
1323 int mlxsw_sp_fid_port_join_lag(const struct mlxsw_sp_port *mlxsw_sp_port);
1324 void mlxsw_sp_fid_port_leave_lag(const struct mlxsw_sp_port *mlxsw_sp_port);
1326 extern const struct mlxsw_sp_fid_core_ops mlxsw_sp1_fid_core_ops;
1327 extern const struct mlxsw_sp_fid_core_ops mlxsw_sp2_fid_core_ops;
1339 struct mlxsw_sp_mr_route_key;
1341 struct mlxsw_sp_mr_tcam_ops {
1343 int (*init)(struct mlxsw_sp *mlxsw_sp, void *priv);
1346 int (*route_create)(struct mlxsw_sp *mlxsw_sp, void *priv,
1348 struct mlxsw_sp_mr_route_key *key,
1349 struct mlxsw_afa_block *afa_block,
1351 void (*route_destroy)(struct mlxsw_sp *mlxsw_sp, void *priv,
1353 struct mlxsw_sp_mr_route_key *key);
1354 int (*route_update)(struct mlxsw_sp *mlxsw_sp, void *route_priv,
1355 struct mlxsw_sp_mr_route_key *key,
1356 struct mlxsw_afa_block *afa_block);
1360 extern const struct mlxsw_sp_mr_tcam_ops mlxsw_sp1_mr_tcam_ops;
1363 extern const struct mlxsw_sp_mr_tcam_ops mlxsw_sp2_mr_tcam_ops;
1366 struct mlxsw_sp_nve_params {
1369 const struct net_device *dev;
1373 extern const struct mlxsw_sp_nve_ops *mlxsw_sp1_nve_ops_arr[];
1374 extern const struct mlxsw_sp_nve_ops *mlxsw_sp2_nve_ops_arr[];
1376 int mlxsw_sp_nve_learned_ip_resolve(struct mlxsw_sp *mlxsw_sp, u32 uip,
1379 int mlxsw_sp_nve_flood_ip_add(struct mlxsw_sp *mlxsw_sp,
1380 struct mlxsw_sp_fid *fid,
1383 void mlxsw_sp_nve_flood_ip_del(struct mlxsw_sp *mlxsw_sp,
1384 struct mlxsw_sp_fid *fid,
1387 int mlxsw_sp_nve_ipv6_addr_kvdl_set(struct mlxsw_sp *mlxsw_sp,
1388 const struct in6_addr *addr6,
1390 void mlxsw_sp_nve_ipv6_addr_kvdl_unset(struct mlxsw_sp *mlxsw_sp,
1391 const struct in6_addr *addr6);
1393 mlxsw_sp_nve_ipv6_addr_map_replace(struct mlxsw_sp *mlxsw_sp, const char *mac,
1395 const struct in6_addr *new_addr6);
1396 void mlxsw_sp_nve_ipv6_addr_map_del(struct mlxsw_sp *mlxsw_sp, const char *mac,
1398 int mlxsw_sp_nve_fid_enable(struct mlxsw_sp *mlxsw_sp, struct mlxsw_sp_fid *fid,
1399 struct mlxsw_sp_nve_params *params,
1400 struct netlink_ext_ack *extack);
1401 void mlxsw_sp_nve_fid_disable(struct mlxsw_sp *mlxsw_sp,
1402 struct mlxsw_sp_fid *fid);
1403 int mlxsw_sp_port_nve_init(struct mlxsw_sp_port *mlxsw_sp_port);
1404 void mlxsw_sp_port_nve_fini(struct mlxsw_sp_port *mlxsw_sp_port);
1405 int mlxsw_sp_nve_init(struct mlxsw_sp *mlxsw_sp);
1406 void mlxsw_sp_nve_fini(struct mlxsw_sp *mlxsw_sp);
1409 int mlxsw_sp_devlink_traps_init(struct mlxsw_sp *mlxsw_sp);
1410 void mlxsw_sp_devlink_traps_fini(struct mlxsw_sp *mlxsw_sp);
1411 int mlxsw_sp_trap_init(struct mlxsw_core *mlxsw_core,
1412 const struct devlink_trap *trap, void *trap_ctx);
1413 void mlxsw_sp_trap_fini(struct mlxsw_core *mlxsw_core,
1414 const struct devlink_trap *trap, void *trap_ctx);
1415 int mlxsw_sp_trap_action_set(struct mlxsw_core *mlxsw_core,
1416 const struct devlink_trap *trap,
1418 struct netlink_ext_ack *extack);
1419 int mlxsw_sp_trap_group_init(struct mlxsw_core *mlxsw_core,
1420 const struct devlink_trap_group *group);
1421 int mlxsw_sp_trap_group_set(struct mlxsw_core *mlxsw_core,
1422 const struct devlink_trap_group *group,
1423 const struct devlink_trap_policer *policer,
1424 struct netlink_ext_ack *extack);
1426 mlxsw_sp_trap_policer_init(struct mlxsw_core *mlxsw_core,
1427 const struct devlink_trap_policer *policer);
1428 void mlxsw_sp_trap_policer_fini(struct mlxsw_core *mlxsw_core,
1429 const struct devlink_trap_policer *policer);
1431 mlxsw_sp_trap_policer_set(struct mlxsw_core *mlxsw_core,
1432 const struct devlink_trap_policer *policer,
1433 u64 rate, u64 burst, struct netlink_ext_ack *extack);
1435 mlxsw_sp_trap_policer_counter_get(struct mlxsw_core *mlxsw_core,
1436 const struct devlink_trap_policer *policer,
1438 int mlxsw_sp_trap_group_policer_hw_id_get(struct mlxsw_sp *mlxsw_sp, u16 id,
1441 static inline struct net *mlxsw_sp_net(struct mlxsw_sp *mlxsw_sp) in mlxsw_sp_net()
1447 extern const struct ethtool_ops mlxsw_sp_port_ethtool_ops;
1448 extern const struct mlxsw_sp_port_type_speed_ops mlxsw_sp1_port_type_speed_ops;
1449 extern const struct mlxsw_sp_port_type_speed_ops mlxsw_sp2_port_type_speed_ops;
1452 extern const struct mlxsw_sp_policer_core_ops mlxsw_sp1_policer_core_ops;
1453 extern const struct mlxsw_sp_policer_core_ops mlxsw_sp2_policer_core_ops;
1462 struct mlxsw_sp_policer_params {
1468 int mlxsw_sp_policer_add(struct mlxsw_sp *mlxsw_sp,
1470 const struct mlxsw_sp_policer_params *params,
1471 struct netlink_ext_ack *extack, u16 *p_policer_index);
1472 void mlxsw_sp_policer_del(struct mlxsw_sp *mlxsw_sp,
1475 int mlxsw_sp_policer_drops_counter_get(struct mlxsw_sp *mlxsw_sp,
1478 int mlxsw_sp_policers_init(struct mlxsw_sp *mlxsw_sp);
1479 void mlxsw_sp_policers_fini(struct mlxsw_sp *mlxsw_sp);
1480 int mlxsw_sp_policer_resources_register(struct mlxsw_core *mlxsw_core);
1483 int mlxsw_sp_pgt_mid_alloc(struct mlxsw_sp *mlxsw_sp, u16 *p_mid);
1484 void mlxsw_sp_pgt_mid_free(struct mlxsw_sp *mlxsw_sp, u16 mid_base);
1485 int mlxsw_sp_pgt_mid_alloc_range(struct mlxsw_sp *mlxsw_sp, u16 *mid_base,
1487 void mlxsw_sp_pgt_mid_free_range(struct mlxsw_sp *mlxsw_sp, u16 mid_base,
1489 int mlxsw_sp_pgt_entry_port_set(struct mlxsw_sp *mlxsw_sp, u16 mid,
1491 int mlxsw_sp_pgt_init(struct mlxsw_sp *mlxsw_sp);
1492 void mlxsw_sp_pgt_fini(struct mlxsw_sp *mlxsw_sp);
1495 struct mlxsw_sp_port_range {
1501 int mlxsw_sp_port_range_reg_get(struct mlxsw_sp *mlxsw_sp,
1502 const struct mlxsw_sp_port_range *range,
1503 struct netlink_ext_ack *extack,
1505 void mlxsw_sp_port_range_reg_put(struct mlxsw_sp *mlxsw_sp, u8 prr_index);
1506 int mlxsw_sp_port_range_init(struct mlxsw_sp *mlxsw_sp);
1507 void mlxsw_sp_port_range_fini(struct mlxsw_sp *mlxsw_sp);