[ofw] [PATCH 4/4] nd2: convert ND MR flags to WV flags

Fab Tillier ftillier at microsoft.com
Tue Jul 27 18:23:34 PDT 2010


Hefty, Sean wrote on Tue, 27 Jul 2010 at 16:53:06

> Provide conversions for missing ND MR flags.
> 
> Signed-off-by: Sean Hefty <sean.hefty at intel.com>
> ---
>  trunk/ulp/netdirect2/user/nd_mw.cpp |   18 ++++++++++++------
>  trunk/ulp/netdirect2/user/nd_mw.h   |    2 --
>  2 files changed, 12 insertions(+), 8 deletions(-)
> diff --git a/trunk/ulp/netdirect2/user/nd_mw.cpp
> b/trunk/ulp/netdirect2/user/nd_mw.cpp index 7e5a27c..c2a53b5 100644 ---
> a/trunk/ulp/netdirect2/user/nd_mw.cpp +++
> b/trunk/ulp/netdirect2/user/nd_mw.cpp @@ -94,17 +94,23 @@
> GetOverlappedResult(OVERLAPPED *pOverlapped, BOOL bWait)
>  	return hr;
>  }
> -DWORD ConvertAccessFlags(DWORD Flags)
> +static DWORD ConvertAccessFlags(DWORD Flags)

Why isn't this scoped to the MR object (a static member of the CNDMr class?)

-Fab

>  {
>  	DWORD opts = 0;
> -	//other flags to convert???
> -	if (!(Flags & ND_OP_FLAG_ALLOW_READ)) {
> -		opts |= WV_ACCESS_REMOTE_READ;
> +	if (Flags & ND_MR_FLAG_ALLOW_LOCAL_WRITE) {
> +		opts |= WV_ACCESS_LOCAL_WRITE;
>  	}
> -	if (Flags & ND_OP_FLAG_ALLOW_WRITE) {
> -		opts |= WV_ACCESS_REMOTE_WRITE;
> +	if (Flags & ND_MR_FLAG_ALLOW_REMOTE_READ) {
> +		opts |= WV_ACCESS_REMOTE_READ | WV_ACCESS_MW_BIND;
>  	}
> +	if (Flags & ND_MR_FLAG_ALLOW_REMOTE_WRITE) {
> +		opts |= WV_ACCESS_REMOTE_WRITE | WV_ACCESS_MW_BIND;
> +	}
> +	if (!(Flags & ND_MR_FLAG_DO_NOT_SECURE_VM)) {
> +		opts |= WV_ACCESS_CACHABLE;
> +	}
> +
>  	return opts;
>  }
> diff --git a/trunk/ulp/netdirect2/user/nd_mw.h
> b/trunk/ulp/netdirect2/user/nd_mw.h index de8431a..660c06c 100644 ---
> a/trunk/ulp/netdirect2/user/nd_mw.h +++
> b/trunk/ulp/netdirect2/user/nd_mw.h @@ -128,6 +128,4 @@ protected:
>  	CNDAdapter			*m_pAdapter;
>  };
> -DWORD ConvertAccessFlags(DWORD Flags);
> -
>  #endif // _ND_MW_H_
> _______________________________________________
> ofw mailing list
> ofw at lists.openfabrics.org
> http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ofw



More information about the ofw mailing list