[openib-general] [PATCH] rdma_cm: let SDP control the SDP version in the hello header

Michael S. Tsirkin mst at mellanox.co.il
Thu Apr 27 12:43:52 PDT 2006


Quoting r. Sean Hefty <sean.hefty at intel.com>:
> Subject: [openib-general] [PATCH] rdma_cm: let SDP control the SDP version in the hello header
> 
> These are the changes to the CMA that I was considering.
> 
> This patch lets SDP determine which version of the SDP headers to use.
> The CMA will check that it can support that version, and set the
> address fields appropriately.
> 
> Signed-off-by: Sean Hefty <sean.hefty at intel.com>
> ---
> Index: cma.c
> ===================================================================
> --- cma.c	(revision 6627)
> +++ cma.c	(working copy)
> @@ -1486,7 +1486,8 @@ static void cma_format_hdr(void *hdr, en
>  	switch (ps) {
>  	case RDMA_PS_SDP:
>  		sdp_hdr = hdr;
> -		sdp_hdr->sdp_version = SDP_VERSION;
> +		if (sdp_hdr->sdp_version != SDP_VERSION)
> +			return -EINVAL;

I think if you want to do it this way you should check only the MajV.
SDP spec says:

A4.3.2.1.1 MAJOR PROTOCOL VERSION NUMBER (MAJV) - 4 BITS
The current specification requires MajV to be set to 2. See section A4.5.1
Connection Setup on page 1218 for additional information.
CA4-15: The accepting peer shall reject the connection if MajV in the HH
does not match its local value.
CA4-16: The accepting peer shall not reject the connection, solely on the
basis that MinV of the HH does not match its local value.
This enables future protocol extensions which are upwardly compatible.

and I think the same applies to CMA.

-- 
MST



More information about the general mailing list