RE: [PATCH for-next v2 15/16] IB/core: Map iWarp AH type to undefined in rdma_ah_find_type

Parav Pandit
2018-01-26T21:41:47Z

> -----Original Message-----
> From: linux-rdma-owner@vger.kernel.org [mailto:linux-rdma-
> owner@vger.kernel.org] On Behalf Of Parav Pandit
> Sent: Friday, January 26, 2018 3:40 PM
> To: Dennis Dalessandro <dennis.dalessandro@intel.com>; jgg@ziepe.ca;
> dledford@redhat.com
> Cc: linux-rdma@vger.kernel.org; Shiraz Saleem <shiraz.saleem@intel.com>; Don
> Hiatt <don.hiatt@intel.com>; Sean Hefty <sean.hefty@intel.com>; Ira Weiny
> <ira.weiny@intel.com>
> Subject: RE: [PATCH for-next v2 15/16] IB/core: Map iWarp AH type to
> undefined in rdma_ah_find_type
>
>
>
> > -----Original Message-----
> > From: Dennis Dalessandro [mailto:dennis.dalessandro@intel.com]
> > Sent: Friday, January 26, 2018 3:31 PM
> > To: jgg@ziepe.ca; dledford@redhat.com
> > Cc: Parav Pandit <parav@mellanox.com>; linux-rdma@vger.kernel.org;
> > Shiraz Saleem <shiraz.saleem@intel.com>; Don Hiatt
> > <don.hiatt@intel.com>; Sean Hefty <sean.hefty@intel.com>; Ira Weiny
> > <ira.weiny@intel.com>
> > Subject: [PATCH for-next v2 15/16] IB/core: Map iWarp AH type to
> > undefined in rdma_ah_find_type
> >
> > From: Don Hiatt <don.hiatt@intel.com>
> >
> > iWarp devices do not support the creation of address handles so return
> > AH_ATTR_TYPE_UNDEFINED for all iWarp devices.
> >
> > While we are here reduce the size of port_num to u8 and add a comment.
> >
> > Fixes: 44c58487d51a ("IB/core: Define 'ib' and 'roce' rdma_ah_attr
> > types")
> > Reported-by: Parav Pandit <parav@mellanox.com>
> > CC: Sean Hefty <sean.hefty@intel.com>
> > Reviewed-by: Ira Weiny <ira.weiny@intel.com>
> > Reviewed-by: Shiraz Saleem <shiraz.saleem@intel.com>
> > Signed-off-by: Don Hiatt <don.hiatt@intel.com>
> > Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
> >
> > ---
> > Changes since v1: Add Shiraz RB tag, move undefined to be 0 not 3
> > ---
> > include/rdma/ib_verbs.h | 12 ++++++++++--
> > 1 files changed, 10 insertions(+), 2 deletions(-)
> >
> > diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index
> > 5e32fe7..0eb3074 100644
> > --- a/include/rdma/ib_verbs.h
> > +++ b/include/rdma/ib_verbs.h
> > @@ -878,6 +878,7 @@ struct ib_mr_status { __attribute_const__ enum
> > ib_rate mult_to_ib_rate(int mult);
> >
> > enum rdma_ah_attr_type {
> > + RDMA_AH_ATTR_TYPE_UNDEFINED,
> > RDMA_AH_ATTR_TYPE_IB,
> > RDMA_AH_ATTR_TYPE_ROCE,
> > RDMA_AH_ATTR_TYPE_OPA,
> > @@ -3789,12 +3790,19 @@ static inline void rdma_ah_set_grh(struct
> > rdma_ah_attr *attr,
> > grh->traffic_class = traffic_class;
> > }
> >
> > -/*Get AH type */
> > +/**
> > + * rdma_ah_find_type - Return address handle type.
> > + *
> > + * @dev: Device to be checked
> > + * @port_num: Port number
> > + */
> > static inline enum rdma_ah_attr_type rdma_ah_find_type(struct
> > ib_device *dev,
> > - u32 port_num)
> > + u8 port_num)
> > {
> > if (rdma_protocol_roce(dev, port_num))
> > return RDMA_AH_ATTR_TYPE_ROCE;
> > + else if (rdma_protocol_iwarp(dev, port_num))
> > + return RDMA_AH_ATTR_TYPE_UNDEFINED;
> > else if ((rdma_protocol_ib(dev, port_num)) &&
> > (rdma_cap_opa_ah(dev, port_num)))
> > return RDMA_AH_ATTR_TYPE_OPA;
> You need a case to return AH_TYPE_IB.
>
I am sorry, didn't notice the else part that returns AH_TYPE_IB.

>
> \x13 칻\x1c & ~ & \x18 +- ݶ\x17 w ˛ m b kvf ^n r z \x1a h & \x1e G h \x03( 階 ݢj" \x1a ^[m z ޖ f
> h ~ m