Re: [PATCH rdma-rc] RDMA/cma: Limit join multicast to UD QP type only

Leon Romanovsky
2022-04-13T08:04:40Z

On Tue, Apr 12, 2022 at 05:01:36PM +0200, Christoph Lameter wrote:
> On Tue, 12 Apr 2022, Jason Gunthorpe wrote:
>
> > The only places setting non-default qkeys are SIDR, maybe nobody uses
> > SIDR with multicast.
>
>
> IP port numbers provided are ignored by the RDMA subsytem when doing
> multicast joins. Thus no need to do SIDRs with RDMA multicast.
>
> Some middleware solutions (like LLM by IBM and Confinity) are creating
> their own custom MGID because of this problem. The custom MGID will then
> contain the port number.
>
> On the subject of this patch: There is a usecase for Multicast with
> IBV_QPT_RAW_PACKET too. A multicast join is required to redirect traffic
> for a multicast group to the raw socket.

The qp_type in rdma-cm is a little bit misleading and represents
communication QP. It can be or RC or UD, which is hard coded in
almost all rdma-cm code.

The one of the places that receive it from the user space is ucma_get_qp_type()
for RDMA_PS_IB flow, but librdmacm set it to RC too.

790
791 int rdma_create_id(struct rdma_event_channel *channel,
792 struct rdma_cm_id **id, void *context,
793 enum rdma_port_space ps)
794 {
795 enum ibv_qp_type qp_type;
796
797 qp_type = (ps == RDMA_PS_IPOIB || ps == RDMA_PS_UDP) ?
798 IBV_QPT_UD : IBV_QPT_RC;
799 return rdma_create_id2(channel, id, context, ps, qp_type);
800 }
801

Thanks