Lines Matching defs:mlx5_eswitch

313 	struct mlx5_eswitch	*esw;
336 struct mlx5_eswitch {
389 void esw_offloads_disable(struct mlx5_eswitch *esw);
390 int esw_offloads_enable(struct mlx5_eswitch *esw);
391 void esw_offloads_cleanup(struct mlx5_eswitch *esw);
392 int esw_offloads_init(struct mlx5_eswitch *esw);
395 mlx5_eswitch_add_send_to_vport_meta_rule(struct mlx5_eswitch *esw, u16 vport_num);
398 bool mlx5_esw_vport_match_metadata_supported(const struct mlx5_eswitch *esw);
399 u32 mlx5_esw_match_metadata_alloc(struct mlx5_eswitch *esw);
400 void mlx5_esw_match_metadata_free(struct mlx5_eswitch *esw, u32 metadata);
402 int mlx5_esw_qos_modify_vport_rate(struct mlx5_eswitch *esw, u16 vport_num, u32 rate_mbps);
406 void mlx5_eswitch_cleanup(struct mlx5_eswitch *esw);
409 int mlx5_eswitch_enable_locked(struct mlx5_eswitch *esw, int num_vfs);
410 int mlx5_eswitch_enable(struct mlx5_eswitch *esw, int num_vfs);
411 void mlx5_eswitch_disable_sriov(struct mlx5_eswitch *esw, bool clear_vf);
412 void mlx5_eswitch_disable_locked(struct mlx5_eswitch *esw);
413 void mlx5_eswitch_disable(struct mlx5_eswitch *esw);
414 void mlx5_esw_offloads_devcom_init(struct mlx5_eswitch *esw, u64 key);
415 void mlx5_esw_offloads_devcom_cleanup(struct mlx5_eswitch *esw);
416 bool mlx5_esw_offloads_devcom_is_ready(struct mlx5_eswitch *esw);
417 int mlx5_eswitch_set_vport_mac(struct mlx5_eswitch *esw,
419 int mlx5_eswitch_set_vport_state(struct mlx5_eswitch *esw,
421 int mlx5_eswitch_set_vport_vlan(struct mlx5_eswitch *esw,
423 int mlx5_eswitch_set_vport_spoofchk(struct mlx5_eswitch *esw,
425 int mlx5_eswitch_set_vport_trust(struct mlx5_eswitch *esw,
427 int mlx5_eswitch_set_vport_rate(struct mlx5_eswitch *esw, u16 vport,
429 int mlx5_esw_qos_vport_update_group(struct mlx5_eswitch *esw,
433 int mlx5_eswitch_set_vepa(struct mlx5_eswitch *esw, u8 setting);
434 int mlx5_eswitch_get_vepa(struct mlx5_eswitch *esw, u8 *setting);
435 int mlx5_eswitch_get_vport_config(struct mlx5_eswitch *esw,
437 int mlx5_eswitch_get_vport_stats(struct mlx5_eswitch *esw,
450 mlx5_eswitch_termtbl_required(struct mlx5_eswitch *esw,
456 mlx5_eswitch_add_termtbl_rule(struct mlx5_eswitch *esw,
465 mlx5_eswitch_termtbl_put(struct mlx5_eswitch *esw,
469 mlx5_eswitch_clear_rule_source_port(struct mlx5_eswitch *esw, struct mlx5_flow_spec *spec);
472 mlx5_eswitch_add_offloaded_rule(struct mlx5_eswitch *esw,
476 mlx5_eswitch_add_fwd_rule(struct mlx5_eswitch *esw,
480 mlx5_eswitch_del_offloaded_rule(struct mlx5_eswitch *esw,
484 mlx5_eswitch_del_fwd_rule(struct mlx5_eswitch *esw,
489 mlx5_eswitch_create_vport_rx_rule(struct mlx5_eswitch *esw, u16 vport,
576 void *mlx5_eswitch_get_uplink_priv(struct mlx5_eswitch *esw, u8 rep_type);
578 int __mlx5_eswitch_set_vport_vlan(struct mlx5_eswitch *esw,
581 static inline bool esw_vst_mode_is_steering(struct mlx5_eswitch *esw)
616 static inline bool mlx5_esw_allowed(const struct mlx5_eswitch *esw)
622 mlx5_esw_is_manager_vport(const struct mlx5_eswitch *esw, u16 vport_num)
627 static inline bool mlx5_esw_is_owner(struct mlx5_eswitch *esw, u16 vport_num,
658 static inline bool mlx5_esw_is_fdb_created(struct mlx5_eswitch *esw)
664 void mlx5e_tc_clean_fdb_peer_flows(struct mlx5_eswitch *esw);
709 struct mlx5_eswitch *__must_check
712 struct mlx5_eswitch *mlx5_devlink_eswitch_nocheck_get(struct devlink *devlink);
715 mlx5_eswitch_get_vport(struct mlx5_eswitch *esw, u16 vport_num);
717 bool mlx5_eswitch_is_vf_vport(struct mlx5_eswitch *esw, u16 vport_num);
718 bool mlx5_eswitch_is_pf_vf_vport(struct mlx5_eswitch *esw, u16 vport_num);
719 bool mlx5_esw_is_sf_vport(struct mlx5_eswitch *esw, u16 vport_num);
724 mlx5_eswitch_enable_pf_vf_vports(struct mlx5_eswitch *esw,
726 void mlx5_eswitch_disable_pf_vf_vports(struct mlx5_eswitch *esw);
728 int mlx5_esw_vport_enable(struct mlx5_eswitch *esw, struct mlx5_vport *vport,
730 void mlx5_esw_vport_disable(struct mlx5_eswitch *esw, struct mlx5_vport *vport);
733 esw_vport_create_offloads_acl_tables(struct mlx5_eswitch *esw,
736 esw_vport_destroy_offloads_acl_tables(struct mlx5_eswitch *esw,
753 mlx5_esw_vporttbl_get(struct mlx5_eswitch *esw, struct mlx5_vport_tbl_attr *attr);
755 mlx5_esw_vporttbl_put(struct mlx5_eswitch *esw, struct mlx5_vport_tbl_attr *attr);
758 esw_add_restore_rule(struct mlx5_eswitch *esw, u32 tag);
760 void mlx5_esw_set_flow_group_source_port(struct mlx5_eswitch *esw,
764 void mlx5_esw_set_spec_source_port(struct mlx5_eswitch *esw,
768 int mlx5_esw_offloads_init_pf_vf_rep(struct mlx5_eswitch *esw, struct mlx5_vport *vport);
769 void mlx5_esw_offloads_cleanup_pf_vf_rep(struct mlx5_eswitch *esw, struct mlx5_vport *vport);
771 int mlx5_esw_offloads_init_sf_rep(struct mlx5_eswitch *esw, struct mlx5_vport *vport,
774 void mlx5_esw_offloads_cleanup_sf_rep(struct mlx5_eswitch *esw, struct mlx5_vport *vport);
776 int mlx5_esw_offloads_load_rep(struct mlx5_eswitch *esw, struct mlx5_vport *vport);
777 void mlx5_esw_offloads_unload_rep(struct mlx5_eswitch *esw, struct mlx5_vport *vport);
779 int mlx5_eswitch_load_sf_vport(struct mlx5_eswitch *esw, u16 vport_num,
782 void mlx5_eswitch_unload_sf_vport(struct mlx5_eswitch *esw, u16 vport_num);
784 int mlx5_eswitch_load_vf_vports(struct mlx5_eswitch *esw, u16 num_vfs,
786 void mlx5_eswitch_unload_vf_vports(struct mlx5_eswitch *esw, u16 num_vfs);
788 int mlx5_esw_offloads_pf_vf_devlink_port_init(struct mlx5_eswitch *esw,
790 void mlx5_esw_offloads_pf_vf_devlink_port_cleanup(struct mlx5_eswitch *esw,
793 int mlx5_esw_offloads_sf_devlink_port_init(struct mlx5_eswitch *esw, struct mlx5_vport *vport,
796 void mlx5_esw_offloads_sf_devlink_port_cleanup(struct mlx5_eswitch *esw, struct mlx5_vport *vport);
798 int mlx5_esw_offloads_devlink_port_register(struct mlx5_eswitch *esw, struct mlx5_vport *vport);
799 void mlx5_esw_offloads_devlink_port_unregister(struct mlx5_eswitch *esw, struct mlx5_vport *vport);
800 struct devlink_port *mlx5_esw_offloads_devlink_port(struct mlx5_eswitch *esw, u16 vport_num);
804 int mlx5_esw_vport_vhca_id_set(struct mlx5_eswitch *esw, u16 vport_num);
805 void mlx5_esw_vport_vhca_id_clear(struct mlx5_eswitch *esw, u16 vport_num);
806 int mlx5_eswitch_vhca_id_to_vport(struct mlx5_eswitch *esw, u16 vhca_id, u16 *vport_num);
817 int mlx5_esw_event_notifier_register(struct mlx5_eswitch *esw, struct notifier_block *n);
818 void mlx5_esw_event_notifier_unregister(struct mlx5_eswitch *esw, struct notifier_block *n);
824 int mlx5_esw_try_lock(struct mlx5_eswitch *esw);
825 int mlx5_esw_lock(struct mlx5_eswitch *esw);
826 void mlx5_esw_unlock(struct mlx5_eswitch *esw);
830 bool mlx5_esw_offloads_controller_valid(const struct mlx5_eswitch *esw, u32 controller);
832 int mlx5_eswitch_offloads_single_fdb_add_one(struct mlx5_eswitch *master_esw,
833 struct mlx5_eswitch *slave_esw, int max_slaves);
834 void mlx5_eswitch_offloads_single_fdb_del_one(struct mlx5_eswitch *master_esw,
835 struct mlx5_eswitch *slave_esw);
836 int mlx5_eswitch_reload_reps(struct mlx5_eswitch *esw);
844 static inline int mlx5_eswitch_num_vfs(struct mlx5_eswitch *esw)
852 static inline int mlx5_eswitch_get_npeers(struct mlx5_eswitch *esw)
860 mlx5_eswitch_get_slow_fdb(struct mlx5_eswitch *esw)
865 int mlx5_eswitch_restore_ipsec_rule(struct mlx5_eswitch *esw, struct mlx5_flow_handle *rule,
874 int mlx5_esw_ipsec_vf_crypto_offload_set(struct mlx5_eswitch *esw, struct mlx5_vport *vport,
876 int mlx5_esw_ipsec_vf_packet_offload_set(struct mlx5_eswitch *esw, struct mlx5_vport *vport,
880 void mlx5_esw_vport_ipsec_offload_enable(struct mlx5_eswitch *esw);
881 void mlx5_esw_vport_ipsec_offload_disable(struct mlx5_eswitch *esw);
886 static inline void mlx5_eswitch_cleanup(struct mlx5_eswitch *esw) {}
887 static inline int mlx5_eswitch_enable(struct mlx5_eswitch *esw, int num_vfs) { return 0; }
888 static inline void mlx5_eswitch_disable_sriov(struct mlx5_eswitch *esw, bool clear_vf) {}
889 static inline void mlx5_eswitch_disable(struct mlx5_eswitch *esw) {}
890 static inline void mlx5_esw_offloads_devcom_init(struct mlx5_eswitch *esw, u64 key) {}
891 static inline void mlx5_esw_offloads_devcom_cleanup(struct mlx5_eswitch *esw) {}
892 static inline bool mlx5_esw_offloads_devcom_is_ready(struct mlx5_eswitch *esw) { return false; }
895 int mlx5_eswitch_set_vport_state(struct mlx5_eswitch *esw, u16 vport, int link_state) { return 0; }
902 esw_add_restore_rule(struct mlx5_eswitch *esw, u32 tag)
915 mlx5_eswitch_offloads_single_fdb_add_one(struct mlx5_eswitch *master_esw,
916 struct mlx5_eswitch *slave_esw, int max_slaves)
922 mlx5_eswitch_offloads_single_fdb_del_one(struct mlx5_eswitch *master_esw,
923 struct mlx5_eswitch *slave_esw) {}
925 static inline int mlx5_eswitch_get_npeers(struct mlx5_eswitch *esw) { return 0; }
928 mlx5_eswitch_reload_reps(struct mlx5_eswitch *esw)