All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roland Dreier <rdreier-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
To: Steve Wise <swise@opengridcomputing.com>
Cc: Trond Myklebust <trond.myklebust@fys.uio.no>,
	linux-nfs@vger.kernel.org, "Talpey\,
	Thomas" <Thomas.Talpey@netapp.com>,
	"general\@lists.openfabrics.org"
	<general-ZwoEplunGu1OwGhvXhtEPSCwEArCW2h5@public.gmane.org>
Subject: Re: [ofa-general] Re: [PATCH 2.6.30] xprtrdma: The frmr iova_start values are truncated by	the nfs rdma client.
Date: Wed, 13 May 2009 14:35:16 -0700	[thread overview]
Message-ID: <adak54kr8iz.fsf@cisco.com> (raw)
In-Reply-To: <4A09A283.3090605@opengridcomputing.com> (Steve Wise's message of "Tue, 12 May 2009 11:23:31 -0500")

 > Trond Myklebust wrote (earlier in this thread):
 > >
 > > All I should need to know is that I can advertise either dma handles or
 > > kernel VAs, and know that I can choose between two functions, say,
 > > ib_send_wr_fastreg_dma_init() and ib_send_wr_fastreg_kva_init() to
 > > initialise the ib_send_wr structure correctly.

I skimmed the earlier thread, and I have to say that I don't quite see
what the problem with assigning things to a u64 directly is.  You can
use any address you want, and I don't quite understand why using the
correct cast to avoid sign extension or truncation problems is such a
big maintenance burden?

The code below really just looks like obfuscation to me -- are we going
to want to add something like

/**
 * ib_init_fast_reg_iova_start_u64 - initializes the iova_start field
 *   based on a 64-bit address supplied by the user.
 * @wr - struct ib_send_wr pointer to be initialized
 * @addr - void * address to be used as the iova_start
 */
static inline void ib_init_fast_reg_iova_start_kva(struct ib_send_wr *wr,
						   u64 addr)
{
	wr->wr.fast_reg.iova_start = addr;
}

next, to make sure we don't get confused about assigning a u64 to a u64?
It all looks a bit overcomplicated to me.

 - R.

 > /**
 > + * ib_init_fast_reg_iova_start_dma - initializes the iova_start field
 > + *   based on a dma address supplied by the user.
 > + * @wr - struct ib_send_wr pointer to be initialized
 > + * @addr - dma_addr_t value to be used as the iova_start
 > + */
 > +static inline void ib_init_fast_reg_iova_start_dma(struct ib_send_wr *wr,
 > +                                                  dma_addr_t addr)
 > +{
 > +       wr->wr.fast_reg.iova_start = addr;
 > +}
 > +
 > +/**
 > + * ib_init_fast_reg_iova_start_kva - initializes the iova_start field
 > + *   based on a kernel virtual address supplied by the user.
 > + * @wr - struct ib_send_wr pointer to be initialized
 > + * @addr - void * address to be used as the iova_start
 > + */
 > +static inline void ib_init_fast_reg_iova_start_kva(struct ib_send_wr *wr,
 > +                                                  void *addr)
 > +{
 > +       wr->wr.fast_reg.iova_start = (unsigned long)addr;
 > +}
 > +
 > +/**
 >  * ib_alloc_mw - Allocates a memory window.
 >  * @pd: The protection domain associated with the memory window.
 >  */

  reply	other threads:[~2009-05-13 21:35 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-24 19:05 [PATCH 2.6.30] xprtrdma: The frmr iova_start values are truncated by the nfs rdma client Steve Wise
     [not found] ` <20090424190510.3134.90405.stgit-T4OLL4TyM9aNDNWfRnPdfg@public.gmane.org>
2009-04-25 14:11   ` Steve Wise
2009-04-26 18:57     ` Steve Wise
2009-04-27  2:17       ` Tom Talpey
     [not found]         ` <49f515a5.1d1e640a.1c82.6677-ATjtLOhZ0NVl57MIdRCFDg@public.gmane.org>
2009-04-27 17:37           ` Steve Wise
2009-04-27 18:05             ` Trond Myklebust
     [not found]               ` <1240855510.8818.9.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-04-27 18:23                 ` Trond Myklebust
     [not found]                   ` <1240856613.8818.16.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-04-27 19:32                     ` Steve Wise
2009-04-27 19:42                       ` Tom Talpey
     [not found]                         ` <49f60ac4.1c1d640a.2d0a.61a7-ATjtLOhZ0NVl57MIdRCFDg@public.gmane.org>
2009-04-27 19:50                           ` Steve Wise
2009-04-27 20:06                             ` Tom Talpey
     [not found]                               ` <49f61067.181e640a.3cb9.0e6c-ATjtLOhZ0NVl57MIdRCFDg@public.gmane.org>
2009-04-27 20:20                                 ` Steve Wise
2009-04-27 20:46                       ` Trond Myklebust
     [not found]                         ` <1240865214.8818.73.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-04-27 20:49                           ` Steve Wise
2009-05-11 22:25                           ` Steve Wise
2009-05-11 22:50                             ` Trond Myklebust
     [not found]                               ` <1242082203.1743.11.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-05-12  0:13                                 ` Steve Wise
2009-05-12  0:23                                   ` Tom Talpey
     [not found]                                     ` <4a08c1b5.151e640a.0a99.fffff868-ATjtLOhZ0NVl57MIdRCFDg@public.gmane.org>
2009-05-12  0:44                                       ` Steve Wise
2009-05-12  0:44                                   ` Trond Myklebust
     [not found]                                     ` <1242089066.1743.19.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-05-12  1:14                                       ` Tom Talpey
     [not found]                                         ` <4a08cd7b.48c3f10a.6bb1.fffff6d3-ATjtLOhZ0NVl57MIdRCFDg@public.gmane.org>
2009-05-12  1:35                                           ` Trond Myklebust
     [not found]                                             ` <1242092150.16618.15.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-05-12  3:06                                               ` Steve Wise
2009-05-12 16:11                                                 ` [ofa-general] " Steve Wise
2009-05-12 16:23                                                   ` Steve Wise
2009-05-13 21:35                                                     ` Roland Dreier [this message]
     [not found]                                                       ` <adak54kr8iz.fsf-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
2009-05-14  7:22                                                         ` Or Gerlitz
     [not found]                                                           ` <4A0BC6A6.1070002-smomgflXvOZWk0Htik3J/w@public.gmane.org>
2009-05-14 13:41                                                             ` Steve Wise
2009-05-14 13:45                                                               ` Or Gerlitz

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=adak54kr8iz.fsf@cisco.com \
    --to=rdreier-fyb4gu1cfyuavxtiumwx3w@public.gmane.org \
    --cc=Thomas.Talpey@netapp.com \
    --cc=general-ZwoEplunGu1OwGhvXhtEPSCwEArCW2h5@public.gmane.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=swise@opengridcomputing.com \
    --cc=trond.myklebust@fys.uio.no \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.