public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: Boris Chiu <boris.chiu-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: RESUBMIT: [PATCH] libibmad: To reserve upper 8 bits of tid used by solaris SRIOV driver
Date: Wed, 27 Mar 2013 10:13:15 -0700	[thread overview]
Message-ID: <20130327101315.58eace03f17e4870fd92f944@intel.com> (raw)
In-Reply-To: <5151E973.80901-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>

As I said before this is really what we should do so thanks, however, see below.

On Tue, 26 Mar 2013 11:31:15 -0700
Boris Chiu <boris.chiu-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org> wrote:

> From 493e8ed95e32f9c3e337f758a979120392c9e412 Mon Sep 17 00:00:00 2001
> From: Brendan Doyle <brendan.doyle-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> Date: Tue, 12 Mar 2013 19:38:52 +0000
> Subject: [PATCH] libibmad: To reserve upper 8 bits of tid used by solaris
>  SRIOV driver
> 
> Signed-off-by: Brendan Doyle <brendan.doyle-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> ---
>  src/mad.c |    8 ++++++++
>  src/rpc.c |    2 +-
>  2 files changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/src/mad.c b/src/mad.c
> index 70a69dd..fe1305d 100644
> --- a/src/mad.c
> +++ b/src/mad.c
> @@ -50,6 +50,13 @@
>  #undef DEBUG
>  #define DEBUG	if (ibdebug)	IBWARN
>  
> +#define GET_IB_USERLAND_TID(tid)	(tid & 0x00000000ffffffff)
> +/*
> + * Generate the 64 bit MAD transaction ID. The upper 32 bits are reserved for
> + * use by the kernel. We clear the upper 32 bits here, but MADs received from
> + * the kernel may contain kernel specific data in these bits, consequently
> + * userland TID matching should only be done on the lower 32 bits.
> + */
>  uint64_t mad_trid(void)
>  {
>  	static uint64_t base;
> @@ -62,6 +69,7 @@ uint64_t mad_trid(void)
>  		trid = random();
>  	}
>  	next = ++trid | (base << 32);
> +	next = GET_IB_USERLAND_TID(next);

Sorry, I guess I should have specified that we don't need "base" any longer.  I am going to combine the removal of base with your patch and accept this.

Thanks,
Ira

>  	return next;
>  }
>  
> diff --git a/src/rpc.c b/src/rpc.c
> index 5cb13f1..7d93180 100644
> --- a/src/rpc.c
> +++ b/src/rpc.c
> @@ -129,7 +129,7 @@ static int
>  _do_madrpc(int port_id, void *sndbuf, void *rcvbuf, int agentid, int len,
>  	   int timeout, int max_retries, int *p_error)
>  {
> -	uint32_t trid;		/* only low 32 bits */
> +	uint32_t trid;		/* only low 32 bits - see mad_trid() */
>  	int retries;
>  	int length, status;
>  
> -- 
> 1.7.9.2
> 


-- 
Ira Weiny <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      parent reply	other threads:[~2013-03-27 17:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-26 18:31 RESUBMIT: [PATCH] libibmad: To reserve upper 8 bits of tid used by solaris SRIOV driver Boris Chiu
     [not found] ` <5151E973.80901-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2013-03-27 17:13   ` Ira Weiny [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130327101315.58eace03f17e4870fd92f944@intel.com \
    --to=ira.weiny-ral2jqcrhueavxtiumwx3w@public.gmane.org \
    --cc=boris.chiu-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox