How to get ports on the same ConnectX-7 HCA to form mlx5_bond_0?

We are trying to setup bonding using two ports on the same ConnectX-7 HCA, but we couldn’t get mlx5_bond_0 to form. We did the same thing on ConnectX-6 HCA, it could form the mlx5_bond_0 device correctly. Is there a specific configuration I need on ConnectX-7 to get it to work?