Please drop this patch. This fix is already merged. I referred to wrong tree. Sorry. Parav > -----Original Message----- > From: Parav Pandit [mailto:parav@xxxxxxxxxxxx] > Sent: Thursday, September 07, 2017 10:43 PM > To: dledford@xxxxxxxxxx; linux-rdma@xxxxxxxxxxxxxxx > Cc: Moni Shoua <monis@xxxxxxxxxxxx>; Matan Barak > <matanb@xxxxxxxxxxxx>; leon@xxxxxxxxxx; Parav Pandit > <parav@xxxxxxxxxxxx> > Subject: [PATCH] IB/cma: Fix setting default RoCE GID type > > GID table entry attribute stores gid entry type in absolute value (not bit mask). > HCA driver provides type of supported GID entries as bit mask. > cma code with recent change compares cma's preferred bit mask and sets > default GID type as bit mask. Setting bit mask is incorrect because it sets default > GID type as 2 (1 << 1). > Currently valid GID types are 0 and 1. > Due to this default GID entry is set incorrectly to 2. configfs also shows incorrect > GID entry type. > > This patch fixes it by compares GID type bit mask and sets default GID type as > absolute value. > > In follow up email [1] Leon mentioned correction in definition but it is actually in > comparision as done in the patch now. > > [1] > https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.s > pinics.net%2Flists%2Flinux- > rdma%2Fmsg50619.html&data=02%7C01%7Cparav%40mellanox.com%7Cad596 > 1e2cef847dd9b5c08d4f66bc86a%7Ca652971c7d2e4d9ba6a4d149256f461b%7C > 0%7C0%7C636404390169778399&sdata=xl%2F%2FH7Cu1vUYW9yILyA90XerTjL > WzC2mVbWMspLzfYs%3D&reserved=0 > > Fixes: a5288b27b731 (IB/cma: Fix default RoCE type setting) > Fixes: 63a5f483af0e (IB/cma: Set default gid type to RoCEv2) > Signed-off-by: Parav Pandit <parav@xxxxxxxxxxxx> > --- > drivers/infiniband/core/cma.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c index > f13f016..8444546 100644 > --- a/drivers/infiniband/core/cma.c > +++ b/drivers/infiniband/core/cma.c > @@ -72,7 +72,8 @@ > #define CMA_MAX_CM_RETRIES 15 > #define CMA_CM_MRA_SETTING (IB_CM_MRA_FLAG_DELAY | 24) #define > CMA_IBOE_PACKET_LIFETIME 18 -#define CMA_PREFERRED_ROCE_GID_TYPE > (1 << IB_GID_TYPE_ROCE_UDP_ENCAP) > +#define CMA_PREFERRED_ROCE_GID_TYPE IB_GID_TYPE_ROCE_UDP_ENCAP > #define > +CMA_PREFERRED_ROCE_GID_TYPE_MASK > BIT(CMA_PREFERRED_ROCE_GID_TYPE) > > static const char * const cma_events[] = { > [RDMA_CM_EVENT_ADDR_RESOLVED] = "address resolved", > @@ -4307,7 +4308,7 @@ static void cma_add_one(struct ib_device *device) > for (i = rdma_start_port(device); i <= rdma_end_port(device); i++) { > supported_gids = roce_gid_type_mask_support(device, i); > WARN_ON(!supported_gids); > - if (supported_gids & CMA_PREFERRED_ROCE_GID_TYPE) > + if (supported_gids & CMA_PREFERRED_ROCE_GID_TYPE_MASK) > cma_dev->default_gid_type[i - > rdma_start_port(device)] = > CMA_PREFERRED_ROCE_GID_TYPE; > else > -- > 1.8.3.1 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html