public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Roland Dreier <rdreier@cisco.com>
To: "Bryan O'Sullivan" <bos@pathscale.com>
Cc: akpm@osdl.org, greg@kroah.com, linux-kernel@vger.kernel.org,
	openib-general@openib.org
Subject: Re: [openib-general] Re: [PATCH 0 of 18] ipath driver - for inclusion in 2.6.17
Date: Fri, 24 Mar 2006 15:21:09 -0800	[thread overview]
Message-ID: <ada8xqzh1ju.fsf@cisco.com> (raw)
In-Reply-To: <1143239617.30626.83.camel@serpentine.pathscale.com> (Bryan O'Sullivan's message of "Fri, 24 Mar 2006 14:33:37 -0800")

    Roland> I would just get rid of your atomic_clear_mask() and
    Roland> atomic_set_mask() calls.  They're bogus because you're not
    Roland> even operating on an atomic_t, and not many architectures
    Roland> implement them.

    Bryan> They're not obviously defined to operate on atomic_t
    Bryan> objects, but what you say makes sense.  I guess that's a
    Bryan> peril of using macros for that stuff.

Not on x86_64, but:

./asm-s390/atomic.h:static __inline__ void atomic_clear_mask(unsigned long mask, atomic_t * v)
./asm-sh/atomic.h:static __inline__ void atomic_clear_mask(unsigned int mask, atomic_t *v)
./asm-sh64/atomic.h:static __inline__ void atomic_clear_mask(unsigned int mask, atomic_t *v)

etc.  Some other architectures do use unsigned long instead.  It all
looks rather non-portable, and the only drivers that use these
functions are s390-specific.  Clearly the simplest solution for your
situation is just to kill it.

    Bryan> There is no duplicated SMA code.  There are two routines in
    Bryan> ipathfs that handle nodeinfo and portinfo structures, but
    Bryan> they're for passing them to userspace; they don't even
    Bryan> really resemble the code in ipath_mad.c.

We seem to be going around and around on this.  There definitely is
duplicated code; you just hide some of it in userspace.  You clearly
have two copies of the function to generate a reply to a GET of
NodeInfo, for example.

What if you moved the MAD query handling code into your core driver?
You could use your current method of sending and receiving replies
directly when ib_ipath isn't loaded, but just process the queries in
the kernel without proxying to userspace.  Then if/when QP0 is
created, switch to letting the MAD layer handle sending and receiving
queries and let it call the same query handling code via your
process_mad method.

But it would (I think) solve all the issues of needing ib_mad loaded
for things to work.  Users could even load ib_ipath without ib_mad and
have IB verbs work -- anything that actually needed MADs would pull in
ib_mad as a dependency, and everything else should work fine with the
SMA stuff handled by your driver.

Of course this would expose the duplication of the SMI directed route
handling logic between your driver and the IB midlayer.  Perhaps it
makes sense to move this directed route logic into its own module to
fix this.

I just really don't like the fact that you apparently have two
different MAD handling methods, with different features.  Diluting
your development by a factor of 2 isn't good for the code.  Also,
the way your are working around the IB midlayer just smells wrong --
either the midlayer or your driver should be fixed so that they work
well together.

    Bryan> That's true; sorry about that.  Do you want me to send you
    Bryan> a patch that drops it and pulls it out of headers and
    Bryan> kbuild stuff?

Let's just try to get closure on everything and then you can send a
real final patchset for merging.

I understand that you really, really want your driver in 2.6.17.  But
let's do things right.  Also, in my opinion, we can still merge ipath
even after 2.6.17-rc1, since it doesn't touch anything (except trivial
kbuild stuff) outside of drivers/infiniband/hw/ipath.

 - R.

  reply	other threads:[~2006-03-24 23:21 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-24  4:41 [PATCH 0 of 18] ipath driver - for inclusion in 2.6.17 Bryan O'Sullivan
2006-03-24  4:41 ` [PATCH 1 of 18] ipath - core device driver Bryan O'Sullivan
2006-03-24  4:41 ` [PATCH 2 of 18] ipath - core driver header files Bryan O'Sullivan
2006-03-24  4:41 ` [PATCH 3 of 18] ipath - copy and send routines for sending an skb Bryan O'Sullivan
2006-03-24  4:41 ` [PATCH 4 of 18] ipath - support for HyperTransport devices Bryan O'Sullivan
2006-03-24  4:41 ` [PATCH 5 of 18] ipath - support for PCI Express devices Bryan O'Sullivan
2006-03-24  4:41 ` [PATCH 6 of 18] ipath - chip initialisation code Bryan O'Sullivan
2006-03-24  4:41 ` [PATCH 7 of 18] ipath - misc driver support code Bryan O'Sullivan
2006-03-24  4:41 ` [PATCH 8 of 18] ipath - sysfs and ipathfs support for core driver Bryan O'Sullivan
2006-03-24  4:41 ` [PATCH 9 of 18] ipath - char devices for diagnostics and lightweight subnet management Bryan O'Sullivan
2006-03-24  4:41 ` [PATCH 10 of 18] ipath - support for userspace apps using core driver Bryan O'Sullivan
2006-03-24  4:41 ` [PATCH 11 of 18] ipath - layering interfaces used by higher-level driver code Bryan O'Sullivan
2006-03-24  4:41 ` [PATCH 12 of 18] ipath - infiniband header files Bryan O'Sullivan
2006-03-24  4:41 ` [PATCH 13 of 18] ipath - infiniband UC and UD protocol support Bryan O'Sullivan
2006-03-24  4:41 ` [PATCH 14 of 18] ipath - infiniband RC " Bryan O'Sullivan
2006-03-24  4:41 ` [PATCH 15 of 18] ipath - misc infiniband code, part 1 Bryan O'Sullivan
2006-03-24  4:41 ` [PATCH 16 of 18] ipath - misc infiniband code, part 2 Bryan O'Sullivan
2006-03-24  4:41 ` [PATCH 17 of 18] ipath - infiniband verbs support Bryan O'Sullivan
2006-03-24  4:41 ` [PATCH 18 of 18] ipath - kbuild infrastructure Bryan O'Sullivan
2006-03-24 18:57 ` [PATCH 0 of 18] ipath driver - for inclusion in 2.6.17 Roland Dreier
2006-03-24 19:11   ` Bryan O'Sullivan
2006-03-24 20:57     ` Muli Ben-Yehuda
2006-03-24 21:19     ` [openib-general] " Roland Dreier
2006-03-24 22:33       ` Bryan O'Sullivan
2006-03-24 23:21         ` Roland Dreier [this message]
2006-03-25  0:03           ` Bryan O'Sullivan

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=ada8xqzh1ju.fsf@cisco.com \
    --to=rdreier@cisco.com \
    --cc=akpm@osdl.org \
    --cc=bos@pathscale.com \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=openib-general@openib.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