.. | .. |
---|
36 | 36 | #include <linux/mlx5/driver.h> |
---|
37 | 37 | #include <linux/mlx5/device.h> |
---|
38 | 38 | |
---|
| 39 | +#define MLX5_VPORT_PF_PLACEHOLDER (1u) |
---|
| 40 | +#define MLX5_VPORT_UPLINK_PLACEHOLDER (1u) |
---|
| 41 | +#define MLX5_VPORT_ECPF_PLACEHOLDER(mdev) (mlx5_ecpf_vport_exists(mdev)) |
---|
| 42 | + |
---|
| 43 | +#define MLX5_SPECIAL_VPORTS(mdev) (MLX5_VPORT_PF_PLACEHOLDER + \ |
---|
| 44 | + MLX5_VPORT_UPLINK_PLACEHOLDER + \ |
---|
| 45 | + MLX5_VPORT_ECPF_PLACEHOLDER(mdev)) |
---|
| 46 | + |
---|
| 47 | +#define MLX5_VPORT_MANAGER(mdev) \ |
---|
| 48 | + (MLX5_CAP_GEN(mdev, vport_group_manager) && \ |
---|
| 49 | + (MLX5_CAP_GEN(mdev, port_type) == MLX5_CAP_PORT_TYPE_ETH) && \ |
---|
| 50 | + mlx5_core_is_pf(mdev)) |
---|
| 51 | + |
---|
39 | 52 | enum { |
---|
40 | 53 | MLX5_CAP_INLINE_MODE_L2, |
---|
41 | 54 | MLX5_CAP_INLINE_MODE_VPORT_CONTEXT, |
---|
42 | 55 | MLX5_CAP_INLINE_MODE_NOT_REQUIRED, |
---|
43 | 56 | }; |
---|
44 | 57 | |
---|
| 58 | +/* Vport number for each function must keep unchanged */ |
---|
| 59 | +enum { |
---|
| 60 | + MLX5_VPORT_PF = 0x0, |
---|
| 61 | + MLX5_VPORT_FIRST_VF = 0x1, |
---|
| 62 | + MLX5_VPORT_ECPF = 0xfffe, |
---|
| 63 | + MLX5_VPORT_UPLINK = 0xffff |
---|
| 64 | +}; |
---|
| 65 | + |
---|
45 | 66 | u8 mlx5_query_vport_state(struct mlx5_core_dev *mdev, u8 opmod, u16 vport); |
---|
46 | 67 | int mlx5_modify_vport_admin_state(struct mlx5_core_dev *mdev, u8 opmod, |
---|
47 | | - u16 vport, u8 state); |
---|
| 68 | + u16 vport, u8 other_vport, u8 state); |
---|
48 | 69 | int mlx5_query_nic_vport_mac_address(struct mlx5_core_dev *mdev, |
---|
49 | | - u16 vport, u8 *addr); |
---|
| 70 | + u16 vport, bool other, u8 *addr); |
---|
| 71 | +int mlx5_query_mac_address(struct mlx5_core_dev *mdev, u8 *addr); |
---|
50 | 72 | int mlx5_query_nic_vport_min_inline(struct mlx5_core_dev *mdev, |
---|
51 | 73 | u16 vport, u8 *min_inline); |
---|
52 | 74 | void mlx5_query_min_inline(struct mlx5_core_dev *mdev, u8 *min_inline); |
---|
53 | 75 | int mlx5_modify_nic_vport_min_inline(struct mlx5_core_dev *mdev, |
---|
54 | 76 | u16 vport, u8 min_inline); |
---|
55 | 77 | int mlx5_modify_nic_vport_mac_address(struct mlx5_core_dev *dev, |
---|
56 | | - u16 vport, u8 *addr); |
---|
| 78 | + u16 vport, const u8 *addr); |
---|
57 | 79 | int mlx5_query_nic_vport_mtu(struct mlx5_core_dev *mdev, u16 *mtu); |
---|
58 | 80 | int mlx5_modify_nic_vport_mtu(struct mlx5_core_dev *mdev, u16 mtu); |
---|
59 | 81 | int mlx5_query_nic_vport_system_image_guid(struct mlx5_core_dev *mdev, |
---|
60 | 82 | u64 *system_image_guid); |
---|
61 | 83 | int mlx5_query_nic_vport_node_guid(struct mlx5_core_dev *mdev, u64 *node_guid); |
---|
62 | 84 | int mlx5_modify_nic_vport_node_guid(struct mlx5_core_dev *mdev, |
---|
63 | | - u32 vport, u64 node_guid); |
---|
| 85 | + u16 vport, u64 node_guid); |
---|
64 | 86 | int mlx5_query_nic_vport_qkey_viol_cntr(struct mlx5_core_dev *mdev, |
---|
65 | 87 | u16 *qkey_viol_cntr); |
---|
66 | 88 | int mlx5_query_hca_vport_gid(struct mlx5_core_dev *dev, u8 other_vport, |
---|
.. | .. |
---|
78 | 100 | int mlx5_query_hca_vport_node_guid(struct mlx5_core_dev *dev, |
---|
79 | 101 | u64 *node_guid); |
---|
80 | 102 | int mlx5_query_nic_vport_mac_list(struct mlx5_core_dev *dev, |
---|
81 | | - u32 vport, |
---|
| 103 | + u16 vport, |
---|
82 | 104 | enum mlx5_list_type list_type, |
---|
83 | 105 | u8 addr_list[][ETH_ALEN], |
---|
84 | 106 | int *list_size); |
---|
.. | .. |
---|
87 | 109 | u8 addr_list[][ETH_ALEN], |
---|
88 | 110 | int list_size); |
---|
89 | 111 | int mlx5_query_nic_vport_promisc(struct mlx5_core_dev *mdev, |
---|
90 | | - u32 vport, |
---|
| 112 | + u16 vport, |
---|
91 | 113 | int *promisc_uc, |
---|
92 | 114 | int *promisc_mc, |
---|
93 | 115 | int *promisc_all); |
---|
.. | .. |
---|
95 | 117 | int promisc_uc, |
---|
96 | 118 | int promisc_mc, |
---|
97 | 119 | int promisc_all); |
---|
98 | | -int mlx5_query_nic_vport_vlans(struct mlx5_core_dev *dev, |
---|
99 | | - u32 vport, |
---|
100 | | - u16 vlans[], |
---|
101 | | - int *size); |
---|
102 | 120 | int mlx5_modify_nic_vport_vlans(struct mlx5_core_dev *dev, |
---|
103 | 121 | u16 vlans[], |
---|
104 | 122 | int list_size); |
---|
.. | .. |
---|
106 | 124 | int mlx5_nic_vport_enable_roce(struct mlx5_core_dev *mdev); |
---|
107 | 125 | int mlx5_nic_vport_disable_roce(struct mlx5_core_dev *mdev); |
---|
108 | 126 | int mlx5_query_vport_down_stats(struct mlx5_core_dev *mdev, u16 vport, |
---|
109 | | - u64 *rx_discard_vport_down, |
---|
| 127 | + u8 other_vport, u64 *rx_discard_vport_down, |
---|
110 | 128 | u64 *tx_discard_vport_down); |
---|
111 | 129 | int mlx5_core_query_vport_counter(struct mlx5_core_dev *dev, u8 other_vport, |
---|
112 | | - int vf, u8 port_num, void *out, |
---|
113 | | - size_t out_sz); |
---|
| 130 | + int vf, u8 port_num, void *out); |
---|
114 | 131 | int mlx5_core_modify_hca_vport_context(struct mlx5_core_dev *dev, |
---|
115 | 132 | u8 other_vport, u8 port_num, |
---|
116 | 133 | int vf, |
---|
.. | .. |
---|
121 | 138 | int mlx5_nic_vport_affiliate_multiport(struct mlx5_core_dev *master_mdev, |
---|
122 | 139 | struct mlx5_core_dev *port_mdev); |
---|
123 | 140 | int mlx5_nic_vport_unaffiliate_multiport(struct mlx5_core_dev *port_mdev); |
---|
| 141 | + |
---|
| 142 | +u64 mlx5_query_nic_system_image_guid(struct mlx5_core_dev *mdev); |
---|
124 | 143 | #endif /* __MLX5_VPORT_H__ */ |
---|