| .. | .. |
|---|
| 42 | 42 | |
|---|
| 43 | 43 | extern const struct ethtool_ops mlx5i_ethtool_ops; |
|---|
| 44 | 44 | extern const struct ethtool_ops mlx5i_pkey_ethtool_ops; |
|---|
| 45 | +extern const struct mlx5e_rx_handlers mlx5i_rx_handlers; |
|---|
| 45 | 46 | |
|---|
| 46 | 47 | #define MLX5_IB_GRH_BYTES 40 |
|---|
| 47 | 48 | #define MLX5_IPOIB_ENCAP_LEN 4 |
|---|
| .. | .. |
|---|
| 51 | 52 | /* ipoib rdma netdev's private data structure */ |
|---|
| 52 | 53 | struct mlx5i_priv { |
|---|
| 53 | 54 | struct rdma_netdev rn; /* keep this first */ |
|---|
| 54 | | - struct mlx5_core_qp qp; |
|---|
| 55 | + u32 qpn; |
|---|
| 55 | 56 | bool sub_interface; |
|---|
| 56 | 57 | u32 qkey; |
|---|
| 57 | 58 | u16 pkey_index; |
|---|
| 58 | 59 | struct mlx5i_pkey_qpn_ht *qpn_htbl; |
|---|
| 59 | | - char *mlx5e_priv[0]; |
|---|
| 60 | + char *mlx5e_priv[]; |
|---|
| 60 | 61 | }; |
|---|
| 61 | 62 | |
|---|
| 63 | +int mlx5i_create_tis(struct mlx5_core_dev *mdev, u32 underlay_qpn, u32 *tisn); |
|---|
| 64 | + |
|---|
| 62 | 65 | /* 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); |
|---|
| 65 | 68 | |
|---|
| 66 | 69 | /* Underlay QP state modification init/uninit functions */ |
|---|
| 67 | 70 | int mlx5i_init_underlay_qp(struct mlx5e_priv *priv); |
|---|
| .. | .. |
|---|
| 84 | 87 | int mlx5i_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd); |
|---|
| 85 | 88 | |
|---|
| 86 | 89 | /* 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); |
|---|
| 91 | 97 | |
|---|
| 92 | 98 | /* Get child interface nic profile */ |
|---|
| 93 | 99 | const struct mlx5e_profile *mlx5i_pkey_get_profile(void); |
|---|
| .. | .. |
|---|
| 104 | 110 | struct mlx5_wqe_datagram_seg datagram; |
|---|
| 105 | 111 | struct mlx5_wqe_eth_pad pad; |
|---|
| 106 | 112 | struct mlx5_wqe_eth_seg eth; |
|---|
| 107 | | - struct mlx5_wqe_data_seg data[0]; |
|---|
| 113 | + struct mlx5_wqe_data_seg data[]; |
|---|
| 108 | 114 | }; |
|---|
| 109 | 115 | |
|---|
| 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))) |
|---|
| 115 | 118 | |
|---|
| 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); |
|---|
| 123 | 122 | |
|---|
| 124 | 123 | #endif /* CONFIG_MLX5_CORE_IPOIB */ |
|---|
| 125 | 124 | #endif /* __MLX5E_IPOB_H__ */ |
|---|