From: Roland Dreier <rdreier@cisco.com>
To: "Bryan O'Sullivan" <bos@pathscale.com>
Cc: "Michael S. Tsirkin" <mst@mellanox.co.il>,
linux-kernel@vger.kernel.org, greg@kroah.com,
openib-general@openib.org
Subject: Re: [PATCH 9 of 18] ipath - char devices for diagnostics and lightweight subnet management
Date: Thu, 23 Mar 2006 17:27:02 -0800 [thread overview]
Message-ID: <adaodzwvdi1.fsf@cisco.com> (raw)
In-Reply-To: <1143158332.11449.33.camel@serpentine.pathscale.com> (Bryan O'Sullivan's message of "Thu, 23 Mar 2006 15:58:52 -0800")
Bryan> I'm a bit confused by your question. We only have one SMA
Bryan> implementation, which is in userspace. The stuff that's in
Bryan> our core driver is purely for supporting it. That same
Bryan> code is also used during diags, too, to let userspace send
Bryan> and receive low-level packets.
We seem to be having a problem with the definition of an SMA. I'm
talking about all the kernel code like the following (and similar
stuff for guidinfo, nodedescription, portinfo, pkeytable).
You must have nearly identical code in your userspace SMA, since it
also has to respond to the same SM queries, right?
I'm trying to understand why you can't get down to one implementation
of these functions.
> +struct nodeinfo {
> + u8 base_version;
> + u8 class_version;
> + u8 node_type;
> + u8 num_ports;
> + __be64 sys_guid;
> + __be64 node_guid;
> + __be64 port_guid;
> + __be16 partition_cap;
> + __be16 device_id;
> + __be32 revision;
> + u8 local_port_num;
> + u8 vendor_id[3];
> +} __attribute__ ((packed));
> +
> +static inline int recv_subn_get_nodeinfo(struct ib_smp *smp,
> + struct ib_device *ibdev, u8 port)
> +{
> + struct nodeinfo *nip = (struct nodeinfo *)&smp->data;
> + struct ipath_devdata *dd = to_idev(ibdev)->dd;
> + u32 vendor, boardid, majrev, minrev;
> +
> + if (smp->attr_mod)
> + smp->status |= IB_SMP_INVALID_FIELD;
> +
> + nip->base_version = 1;
> + nip->class_version = 1;
> + nip->node_type = 1; /* channel adapter */
> + /*
> + * XXX The num_ports value will need a layer function to get
> + * the value if we ever have more than one IB port on a chip.
> + * We will also need to get the GUID for the port.
> + */
> + nip->num_ports = ibdev->phys_port_cnt;
> + /* This is already in network order */
> + nip->sys_guid = to_idev(ibdev)->sys_image_guid;
> + nip->node_guid = ipath_layer_get_guid(dd);
> + nip->port_guid = nip->sys_guid;
> + nip->partition_cap = cpu_to_be16(ipath_layer_get_npkeys(dd));
> + nip->device_id = cpu_to_be16(ipath_layer_get_deviceid(dd));
> + ipath_layer_query_device(dd, &vendor, &boardid, &majrev, &minrev);
> + nip->revision = cpu_to_be32((majrev << 16) | minrev);
> + nip->local_port_num = port;
> + nip->vendor_id[0] = 0;
> + nip->vendor_id[1] = vendor >> 8;
> + nip->vendor_id[2] = vendor;
> +
> + return reply(smp);
> +}
next prev parent reply other threads:[~2006-03-24 1:27 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-23 0:04 [PATCH 0 of 18] [RFC] ipath - almost-final round of patches for submission Bryan O'Sullivan
2006-03-23 0:04 ` [PATCH 1 of 18] ipath - core driver header files Bryan O'Sullivan
2006-03-23 0:04 ` [PATCH 2 of 18] ipath - core device driver Bryan O'Sullivan
2006-03-23 0:04 ` [PATCH 3 of 18] ipath - copy and send routines for sending an skb Bryan O'Sullivan
2006-03-23 0:04 ` [PATCH 4 of 18] ipath - support for HyperTransport devices Bryan O'Sullivan
2006-03-23 0:04 ` [PATCH 5 of 18] ipath - support for PCI Express devices Bryan O'Sullivan
2006-03-23 0:04 ` [PATCH 6 of 18] ipath - chip initialisation code Bryan O'Sullivan
2006-03-23 0:05 ` [PATCH 7 of 18] ipath - misc driver support code Bryan O'Sullivan
2006-03-23 0:05 ` [PATCH 8 of 18] ipath - sysfs and ipathfs support for core driver Bryan O'Sullivan
2006-03-23 5:49 ` Greg KH
2006-03-23 8:44 ` Bryan O'Sullivan
2006-03-23 20:06 ` Robert Walsh
2006-03-23 23:25 ` Greg KH
2006-03-23 6:30 ` Michael S. Tsirkin
2006-03-23 8:46 ` Bryan O'Sullivan
2006-03-23 9:40 ` Michael S. Tsirkin
2006-03-23 0:05 ` [PATCH 9 of 18] ipath - char devices for diagnostics and lightweight subnet management Bryan O'Sullivan
2006-03-23 6:41 ` Michael S. Tsirkin
2006-03-23 8:48 ` Bryan O'Sullivan
2006-03-23 9:37 ` Michael S. Tsirkin
2006-03-23 9:51 ` Bryan O'Sullivan
2006-03-23 10:13 ` Michael S. Tsirkin
2006-03-23 10:19 ` Bryan O'Sullivan
2006-03-23 19:18 ` Roland Dreier
2006-03-23 23:58 ` Bryan O'Sullivan
2006-03-24 1:27 ` Roland Dreier [this message]
2006-03-24 2:59 ` [openib-general] " Robert Walsh
2006-03-23 0:05 ` [PATCH 10 of 18] ipath - support for userspace apps using core driver Bryan O'Sullivan
2006-03-23 3:06 ` Andrew Morton
2006-03-23 8:37 ` Bryan O'Sullivan
2006-03-23 0:05 ` [PATCH 11 of 18] ipath - layering interfaces used by higher-level driver code Bryan O'Sullivan
2006-03-23 0:05 ` [PATCH 12 of 18] ipath - infiniband header files Bryan O'Sullivan
2006-03-23 0:05 ` [PATCH 13 of 18] ipath - infiniband UC and UD protocol support Bryan O'Sullivan
2006-03-23 0:05 ` [PATCH 14 of 18] ipath - infiniband RC " Bryan O'Sullivan
2006-03-23 0:05 ` [PATCH 15 of 18] ipath - misc infiniband code, part 1 Bryan O'Sullivan
2006-03-23 0:05 ` [PATCH 16 of 18] ipath - misc infiniband code, part 2 Bryan O'Sullivan
2006-03-23 0:05 ` [PATCH 17 of 18] ipath - infiniband verbs support Bryan O'Sullivan
2006-03-23 0:05 ` [PATCH 18 of 18] ipath - kbuild infrastructure Bryan O'Sullivan
-- strict thread matches above, loose matches on Subject: below --
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 9 of 18] ipath - char devices for diagnostics and lightweight subnet management 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=adaodzwvdi1.fsf@cisco.com \
--to=rdreier@cisco.com \
--cc=bos@pathscale.com \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@mellanox.co.il \
--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