Re: [PATCH rdma-rc] IB/uverbs: Don't use the address vector's port number during modify_qp

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 19 Jun 2018 11:18:14 -0600
Jason Gunthorpe <jgg@xxxxxxxxxxxx> wrote:

> On Tue, Jun 19, 2018 at 10:36:46AM -0600, Jack Morgenstein wrote:
> >    Not correct.
> > 
> >    The IB_QP_PORT tag is required for non-connected QPs, which do
> > NOT use address vectors during QP creation (and so do not use the
> > AV tags).  
> 
> I said Linux doesn't follow the spec, so quoting the spec doesn't help
> :)
> 
> In Linux we do not use IB_QP_PORT information, for any QP type. I mean
> this very literally, go in the code and look, there is no useful
> access to qp->port. I did check.
> 
The low level drivers (mlx4 and mlx5) use IB_QP_PORT in their
modify_qp calls.  When IB_QP_PORT is set in the attr structure,
the low-level driver modify_qp sets the port field in its
own structure to the port number provided by the ib core interface
inside the attr struct (via ib_modify_qp -> ib_security_modify_qp ->
low-level-driver-modify_qp).
Thus, IB_QP_PORT and the port num provided in the attr struct are,
in fact, useful.

> For connected we require the port numbers to be present in each of the
> AVs during modify_qp.
> 
> For unconnected we require the port numbers to be provided when
> creating the AH, and we do not limit the acceptable port numbers to
> the IB_QP_PORT value.
> 
Jason, you are correct in that the IB Spec overspecified the
physical port number associated with a QP for unconnected types
(requiring the physical port number in the reset-to-init transition,
and again in the AH).
However, for security reasons, at least in the mlx4 driver, the HCA is
initialized so that the FW rejects packets where the physical port
number in the AV does not match the port number associated with the QP.
(see file drivers/net/ethernet/mellanox/mlx4/fw.c line 1998)

Thus, the IB_QP_PORT tag IS important in the Linux API.

-Jack

> So the IB_QP_PORT has no purpose in the Linux API, from what I can
> see, and should never be used by any code.
> 
> Jason
> --
> 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

--
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



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux