0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033 #ifndef __MLX5_VPORT_H__
0034 #define __MLX5_VPORT_H__
0035
0036 #include <linux/mlx5/driver.h>
0037 #include <linux/mlx5/device.h>
0038
0039 #define MLX5_VPORT_MANAGER(mdev) \
0040 (MLX5_CAP_GEN(mdev, vport_group_manager) && \
0041 (MLX5_CAP_GEN(mdev, port_type) == MLX5_CAP_PORT_TYPE_ETH) && \
0042 mlx5_core_is_pf(mdev))
0043
0044 enum {
0045 MLX5_CAP_INLINE_MODE_L2,
0046 MLX5_CAP_INLINE_MODE_VPORT_CONTEXT,
0047 MLX5_CAP_INLINE_MODE_NOT_REQUIRED,
0048 };
0049
0050
0051 enum {
0052 MLX5_VPORT_PF = 0x0,
0053 MLX5_VPORT_FIRST_VF = 0x1,
0054 MLX5_VPORT_ECPF = 0xfffe,
0055 MLX5_VPORT_UPLINK = 0xffff
0056 };
0057
0058 u8 mlx5_query_vport_state(struct mlx5_core_dev *mdev, u8 opmod, u16 vport);
0059 int mlx5_modify_vport_admin_state(struct mlx5_core_dev *mdev, u8 opmod,
0060 u16 vport, u8 other_vport, u8 state);
0061 int mlx5_query_nic_vport_mac_address(struct mlx5_core_dev *mdev,
0062 u16 vport, bool other, u8 *addr);
0063 int mlx5_query_mac_address(struct mlx5_core_dev *mdev, u8 *addr);
0064 int mlx5_query_nic_vport_min_inline(struct mlx5_core_dev *mdev,
0065 u16 vport, u8 *min_inline);
0066 void mlx5_query_min_inline(struct mlx5_core_dev *mdev, u8 *min_inline);
0067 int mlx5_modify_nic_vport_min_inline(struct mlx5_core_dev *mdev,
0068 u16 vport, u8 min_inline);
0069 int mlx5_modify_nic_vport_mac_address(struct mlx5_core_dev *dev,
0070 u16 vport, const u8 *addr);
0071 int mlx5_query_nic_vport_mtu(struct mlx5_core_dev *mdev, u16 *mtu);
0072 int mlx5_modify_nic_vport_mtu(struct mlx5_core_dev *mdev, u16 mtu);
0073 int mlx5_query_nic_vport_system_image_guid(struct mlx5_core_dev *mdev,
0074 u64 *system_image_guid);
0075 int mlx5_query_nic_vport_node_guid(struct mlx5_core_dev *mdev, u64 *node_guid);
0076 int mlx5_modify_nic_vport_node_guid(struct mlx5_core_dev *mdev,
0077 u16 vport, u64 node_guid);
0078 int mlx5_query_nic_vport_qkey_viol_cntr(struct mlx5_core_dev *mdev,
0079 u16 *qkey_viol_cntr);
0080 int mlx5_query_hca_vport_gid(struct mlx5_core_dev *dev, u8 other_vport,
0081 u8 port_num, u16 vf_num, u16 gid_index,
0082 union ib_gid *gid);
0083 int mlx5_query_hca_vport_pkey(struct mlx5_core_dev *dev, u8 other_vport,
0084 u8 port_num, u16 vf_num, u16 pkey_index,
0085 u16 *pkey);
0086 int mlx5_query_hca_vport_context(struct mlx5_core_dev *dev,
0087 u8 other_vport, u8 port_num,
0088 u16 vf_num,
0089 struct mlx5_hca_vport_context *rep);
0090 int mlx5_query_hca_vport_system_image_guid(struct mlx5_core_dev *dev,
0091 u64 *sys_image_guid);
0092 int mlx5_query_hca_vport_node_guid(struct mlx5_core_dev *dev,
0093 u64 *node_guid);
0094 int mlx5_query_nic_vport_mac_list(struct mlx5_core_dev *dev,
0095 u16 vport,
0096 enum mlx5_list_type list_type,
0097 u8 addr_list[][ETH_ALEN],
0098 int *list_size);
0099 int mlx5_modify_nic_vport_mac_list(struct mlx5_core_dev *dev,
0100 enum mlx5_list_type list_type,
0101 u8 addr_list[][ETH_ALEN],
0102 int list_size);
0103 int mlx5_query_nic_vport_promisc(struct mlx5_core_dev *mdev,
0104 u16 vport,
0105 int *promisc_uc,
0106 int *promisc_mc,
0107 int *promisc_all);
0108 int mlx5_modify_nic_vport_promisc(struct mlx5_core_dev *mdev,
0109 int promisc_uc,
0110 int promisc_mc,
0111 int promisc_all);
0112 int mlx5_modify_nic_vport_vlans(struct mlx5_core_dev *dev,
0113 u16 vlans[],
0114 int list_size);
0115
0116 int mlx5_nic_vport_enable_roce(struct mlx5_core_dev *mdev);
0117 int mlx5_nic_vport_disable_roce(struct mlx5_core_dev *mdev);
0118 int mlx5_query_vport_down_stats(struct mlx5_core_dev *mdev, u16 vport,
0119 u8 other_vport, u64 *rx_discard_vport_down,
0120 u64 *tx_discard_vport_down);
0121 int mlx5_core_query_vport_counter(struct mlx5_core_dev *dev, u8 other_vport,
0122 int vf, u8 port_num, void *out);
0123 int mlx5_core_modify_hca_vport_context(struct mlx5_core_dev *dev,
0124 u8 other_vport, u8 port_num,
0125 int vf,
0126 struct mlx5_hca_vport_context *req);
0127 int mlx5_nic_vport_update_local_lb(struct mlx5_core_dev *mdev, bool enable);
0128 int mlx5_nic_vport_query_local_lb(struct mlx5_core_dev *mdev, bool *status);
0129
0130 int mlx5_nic_vport_affiliate_multiport(struct mlx5_core_dev *master_mdev,
0131 struct mlx5_core_dev *port_mdev);
0132 int mlx5_nic_vport_unaffiliate_multiport(struct mlx5_core_dev *port_mdev);
0133
0134 u64 mlx5_query_nic_system_image_guid(struct mlx5_core_dev *mdev);
0135 #endif