forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.h
....@@ -42,6 +42,7 @@
4242
4343 extern const struct ethtool_ops mlx5i_ethtool_ops;
4444 extern const struct ethtool_ops mlx5i_pkey_ethtool_ops;
45
+extern const struct mlx5e_rx_handlers mlx5i_rx_handlers;
4546
4647 #define MLX5_IB_GRH_BYTES 40
4748 #define MLX5_IPOIB_ENCAP_LEN 4
....@@ -51,17 +52,19 @@
5152 /* ipoib rdma netdev's private data structure */
5253 struct mlx5i_priv {
5354 struct rdma_netdev rn; /* keep this first */
54
- struct mlx5_core_qp qp;
55
+ u32 qpn;
5556 bool sub_interface;
5657 u32 qkey;
5758 u16 pkey_index;
5859 struct mlx5i_pkey_qpn_ht *qpn_htbl;
59
- char *mlx5e_priv[0];
60
+ char *mlx5e_priv[];
6061 };
6162
63
+int mlx5i_create_tis(struct mlx5_core_dev *mdev, u32 underlay_qpn, u32 *tisn);
64
+
6265 /* Underlay QP create/destroy functions */
63
-int mlx5i_create_underlay_qp(struct mlx5_core_dev *mdev, struct mlx5_core_qp *qp);
64
-void mlx5i_destroy_underlay_qp(struct mlx5_core_dev *mdev, struct mlx5_core_qp *qp);
66
+int mlx5i_create_underlay_qp(struct mlx5e_priv *priv);
67
+void mlx5i_destroy_underlay_qp(struct mlx5_core_dev *mdev, u32 qpn);
6568
6669 /* Underlay QP state modification init/uninit functions */
6770 int mlx5i_init_underlay_qp(struct mlx5e_priv *priv);
....@@ -84,10 +87,13 @@
8487 int mlx5i_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
8588
8689 /* Parent profile functions */
87
-void mlx5i_init(struct mlx5_core_dev *mdev,
88
- struct net_device *netdev,
89
- const struct mlx5e_profile *profile,
90
- void *ppriv);
90
+int mlx5i_init(struct mlx5_core_dev *mdev,
91
+ struct net_device *netdev,
92
+ const struct mlx5e_profile *profile,
93
+ void *ppriv);
94
+void mlx5i_cleanup(struct mlx5e_priv *priv);
95
+
96
+int mlx5i_update_nic_rx(struct mlx5e_priv *priv);
9197
9298 /* Get child interface nic profile */
9399 const struct mlx5e_profile *mlx5i_pkey_get_profile(void);
....@@ -104,22 +110,15 @@
104110 struct mlx5_wqe_datagram_seg datagram;
105111 struct mlx5_wqe_eth_pad pad;
106112 struct mlx5_wqe_eth_seg eth;
107
- struct mlx5_wqe_data_seg data[0];
113
+ struct mlx5_wqe_data_seg data[];
108114 };
109115
110
-static inline void mlx5i_sq_fetch_wqe(struct mlx5e_txqsq *sq,
111
- struct mlx5i_tx_wqe **wqe,
112
- u16 pi)
113
-{
114
- struct mlx5_wq_cyc *wq = &sq->wq;
116
+#define MLX5I_SQ_FETCH_WQE(sq, pi) \
117
+ ((struct mlx5i_tx_wqe *)mlx5e_fetch_wqe(&(sq)->wq, pi, sizeof(struct mlx5i_tx_wqe)))
115118
116
- *wqe = mlx5_wq_cyc_get_wqe(wq, pi);
117
- memset(*wqe, 0, sizeof(**wqe));
118
-}
119
-
120
-netdev_tx_t mlx5i_sq_xmit(struct mlx5e_txqsq *sq, struct sk_buff *skb,
121
- struct mlx5_av *av, u32 dqpn, u32 dqkey);
122
-void mlx5i_handle_rx_cqe(struct mlx5e_rq *rq, struct mlx5_cqe64 *cqe);
119
+void mlx5i_sq_xmit(struct mlx5e_txqsq *sq, struct sk_buff *skb,
120
+ struct mlx5_av *av, u32 dqpn, u32 dqkey, bool xmit_more);
121
+void mlx5i_get_stats(struct net_device *dev, struct rtnl_link_stats64 *stats);
123122
124123 #endif /* CONFIG_MLX5_CORE_IPOIB */
125124 #endif /* __MLX5E_IPOB_H__ */