linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] IB/mad: Support devices taking pkey_index from the GSI QP
@ 2015-10-14  8:29 Haggai Eran
       [not found] ` <1444811388-22486-1-git-send-email-haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 15+ messages in thread
From: Haggai Eran @ 2015-10-14  8:29 UTC (permalink / raw)
  To: Doug Ledford
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Haggai Eran, Jason Gunthorpe,
	Hal Rosenstock, Sean Hefty, Or Gerlitz, Eli Cohen

Hi,

Patch 4c21b5bcef73 ("IB/cma: Add net_dev and private data checks to RDMA
CM") started checking the BTH P_Key for RDMA CM requests, and this
uncovered some issues with P_Key handling. In mlx5 the pkey_index in ib_wc
wasn't set correctly [1]. In addition, we found out that mlx5 doesn't
respect the pkey_index in ib_send_wr.ud for GSI packets. Apparently having
the pkey_index in a work request isn't required by the IBA specifications,
and so the Connect-IB and ConnectX-4 cards that mlx5 drives doesn't support
it. The result is that in kernel 4.3, RDMA CM can reject new connections
created using an mlx5 IPoIB interface that uses a non-default P_Key.

The proposed solution here is to change the ib_mad module to create
multiple UD QPs for sending GMPs, when the underlying driver doesn't
support the pkey_index in the work request. A side effect of
this change is that MADs going out with pkey_index != 0 will have a source
QP number != 1. This is allowed by the IBA specifications.

To save resources, the code creates QPs only for pkey table entries that are
non-zero. However, the code doesn't currently destroy QPs when pkey entries are
cleared. This would require reference counting on each QP to work correctly,
and we plan to do that later on.

The patchset is divided as follows. The first two patches add helper
functions and store additional info in ib_mad_qp_info to help eliminate the
depenedency on a single ib_qp pointer in ib_mad_qp_info. Patch 3 adds a
capability bit to ib_device to tell whether a device uses the pkey index
from a work request or from the QP. Patch 4 adds SRQ support to the mad
layer to allow receiving MADs designated to any QP belonging to a GSI agent
to the same queue. Patch 5 adds the bulk of the code required to create and
use multiple QPs on the same ib_mad_qp_info struct, and patch 6 adds a
P_Key change event handler to update the table when the SM changes the
available P_Keys.

[1] mlx5: Fix incorrect wc pkey_index assignment for GSI messages
http://www.spinics.net/lists/linux-rdma/msg28374.html

Regards,
Haggai

Haggai Eran (6):
  IB/mad: Use helpers to get ib_device and ib_pd from ib_mad_agent
  IB/mad: Add QP parameters to ib_mad_qp_info
  IB/core: Add capability bit to tell whether per-WR P_Key change in
    GSI is supported
  IB/mad: Use a SRQ for receiving GMPs
  IB/mad: Create multiple QPs for supporting different P_Keys
  IB/mad: P_Key change event handler

 drivers/infiniband/core/agent.c          |   4 +-
 drivers/infiniband/core/cm.c             |   5 +-
 drivers/infiniband/core/mad.c            | 528 ++++++++++++++++++++++++-------
 drivers/infiniband/core/mad_priv.h       |   9 +-
 drivers/infiniband/core/mad_rmpp.c       |   4 +-
 drivers/infiniband/core/sa_query.c       |  10 +-
 drivers/infiniband/core/user_mad.c       |   4 +-
 drivers/infiniband/hw/mlx4/mad.c         |   2 +-
 drivers/infiniband/hw/mlx5/main.c        |   1 +
 drivers/infiniband/hw/mthca/mthca_mad.c  |   2 +-
 drivers/infiniband/ulp/srpt/ib_srpt.c    |   2 +-
 drivers/staging/rdma/ipath/ipath_verbs.c |   1 +
 include/rdma/ib_mad.h                    |  16 +-
 include/rdma/ib_verbs.h                  |   2 +
 14 files changed, 452 insertions(+), 138 deletions(-)

-- 
1.7.11.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2015-10-21 10:51 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-14  8:29 [PATCH 0/6] IB/mad: Support devices taking pkey_index from the GSI QP Haggai Eran
     [not found] ` <1444811388-22486-1-git-send-email-haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-10-14  8:29   ` [PATCH 1/6] IB/mad: Use helpers to get ib_device and ib_pd from ib_mad_agent Haggai Eran
2015-10-14  8:29   ` [PATCH 2/6] IB/mad: Add QP parameters to ib_mad_qp_info Haggai Eran
2015-10-14  8:29   ` [PATCH 3/6] IB/core: Add capability bit to tell whether per-WR P_Key change in GSI is supported Haggai Eran
2015-10-14  8:29   ` [PATCH 4/6] IB/mad: Use a SRQ for receiving GMPs Haggai Eran
2015-10-14  8:29   ` [PATCH 5/6] IB/mad: Create multiple QPs for supporting different P_Keys Haggai Eran
2015-10-14  8:29   ` [PATCH 6/6] IB/mad: P_Key change event handler Haggai Eran
2015-10-14 17:54   ` [PATCH 0/6] IB/mad: Support devices taking pkey_index from the GSI QP Jason Gunthorpe
     [not found]     ` <20151014175410.GB28534-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2015-10-14 21:42       ` Weiny, Ira
2015-10-19 17:59       ` Haggai Eran
     [not found]         ` <56252F7B.4000300-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-10-19 18:09           ` [PATCH] IB/cma: Use inner P_Key to determine netdev Haggai Eran
     [not found]             ` <1445278165-18442-1-git-send-email-haggaie-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-10-19 18:19               ` Jason Gunthorpe
     [not found]                 ` <20151019181953.GA19665-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2015-10-20  6:45                   ` Haggai Eran
     [not found]                     ` <5625E307.4090105-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-10-20 16:44                       ` Jason Gunthorpe
     [not found]                         ` <20151020164445.GB24608-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2015-10-21 10:51                           ` Haggai Eran

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).