hc
2024-01-31 f9004dbfff8a3fbbd7e2a88c8a4327c7f2f8e5b2
kernel/include/linux/mlx5/vport.h
....@@ -36,31 +36,53 @@
3636 #include <linux/mlx5/driver.h>
3737 #include <linux/mlx5/device.h>
3838
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
+
3952 enum {
4053 MLX5_CAP_INLINE_MODE_L2,
4154 MLX5_CAP_INLINE_MODE_VPORT_CONTEXT,
4255 MLX5_CAP_INLINE_MODE_NOT_REQUIRED,
4356 };
4457
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
+
4566 u8 mlx5_query_vport_state(struct mlx5_core_dev *mdev, u8 opmod, u16 vport);
4667 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);
4869 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);
5072 int mlx5_query_nic_vport_min_inline(struct mlx5_core_dev *mdev,
5173 u16 vport, u8 *min_inline);
5274 void mlx5_query_min_inline(struct mlx5_core_dev *mdev, u8 *min_inline);
5375 int mlx5_modify_nic_vport_min_inline(struct mlx5_core_dev *mdev,
5476 u16 vport, u8 min_inline);
5577 int mlx5_modify_nic_vport_mac_address(struct mlx5_core_dev *dev,
56
- u16 vport, u8 *addr);
78
+ u16 vport, const u8 *addr);
5779 int mlx5_query_nic_vport_mtu(struct mlx5_core_dev *mdev, u16 *mtu);
5880 int mlx5_modify_nic_vport_mtu(struct mlx5_core_dev *mdev, u16 mtu);
5981 int mlx5_query_nic_vport_system_image_guid(struct mlx5_core_dev *mdev,
6082 u64 *system_image_guid);
6183 int mlx5_query_nic_vport_node_guid(struct mlx5_core_dev *mdev, u64 *node_guid);
6284 int mlx5_modify_nic_vport_node_guid(struct mlx5_core_dev *mdev,
63
- u32 vport, u64 node_guid);
85
+ u16 vport, u64 node_guid);
6486 int mlx5_query_nic_vport_qkey_viol_cntr(struct mlx5_core_dev *mdev,
6587 u16 *qkey_viol_cntr);
6688 int mlx5_query_hca_vport_gid(struct mlx5_core_dev *dev, u8 other_vport,
....@@ -78,7 +100,7 @@
78100 int mlx5_query_hca_vport_node_guid(struct mlx5_core_dev *dev,
79101 u64 *node_guid);
80102 int mlx5_query_nic_vport_mac_list(struct mlx5_core_dev *dev,
81
- u32 vport,
103
+ u16 vport,
82104 enum mlx5_list_type list_type,
83105 u8 addr_list[][ETH_ALEN],
84106 int *list_size);
....@@ -87,7 +109,7 @@
87109 u8 addr_list[][ETH_ALEN],
88110 int list_size);
89111 int mlx5_query_nic_vport_promisc(struct mlx5_core_dev *mdev,
90
- u32 vport,
112
+ u16 vport,
91113 int *promisc_uc,
92114 int *promisc_mc,
93115 int *promisc_all);
....@@ -95,10 +117,6 @@
95117 int promisc_uc,
96118 int promisc_mc,
97119 int promisc_all);
98
-int mlx5_query_nic_vport_vlans(struct mlx5_core_dev *dev,
99
- u32 vport,
100
- u16 vlans[],
101
- int *size);
102120 int mlx5_modify_nic_vport_vlans(struct mlx5_core_dev *dev,
103121 u16 vlans[],
104122 int list_size);
....@@ -106,11 +124,10 @@
106124 int mlx5_nic_vport_enable_roce(struct mlx5_core_dev *mdev);
107125 int mlx5_nic_vport_disable_roce(struct mlx5_core_dev *mdev);
108126 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,
110128 u64 *tx_discard_vport_down);
111129 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);
114131 int mlx5_core_modify_hca_vport_context(struct mlx5_core_dev *dev,
115132 u8 other_vport, u8 port_num,
116133 int vf,
....@@ -121,4 +138,6 @@
121138 int mlx5_nic_vport_affiliate_multiport(struct mlx5_core_dev *master_mdev,
122139 struct mlx5_core_dev *port_mdev);
123140 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);
124143 #endif /* __MLX5_VPORT_H__ */