From: Roland Dreier <roland@topspin.com>
To: long <tlnguyen@snoqualmie.dp.intel.com>
Cc: ak@muc.de, akpm@osdl.org, greg@kroah.com, jgarzik@pobox.com,
linux-kernel@vger.kernel.org, tom.l.nguyen@intel.com,
zwane@linuxpower.ca, eli@mellanox.co.il
Subject: Re: [PATCH]2.6.7 MSI-X Update
Date: Tue, 22 Jun 2004 20:45:34 -0700 [thread overview]
Message-ID: <52d63rj5sx.fsf@topspin.com> (raw)
In-Reply-To: <200406222148.i5MLmA4Y001949@snoqualmie.dp.intel.com> (long's message of "Tue, 22 Jun 2004 14:48:10 -0700")
A couple of other comments on the patch:
> +Argument entries is a pointer of unsigned integer type. The number of
> +elements is indicated in argument nvec. The content of each element
> +will be mapped to the following struct defined in /driver/pci/msi.h.
> +
> +struct msix_entry {
> + __u32 vector : 16; /* kernel uses to write alloc vector */
> + __u32 entry : 16; /* driver uses to specify entry */
> +};
> +
> +A device driver is responsible for initializing the field entry of
> +each element with unique entry supported by MSI-X table.
I think this structure should be defined in a header in include/linux,
probably <linux/pci.h>. We could create a new <linux/msi.h> include
but I don't think it's worth it at this point. Also I don't see any
reason to use bitfields or userspace types like __u32 (since no
userspace code is going to use this include file). I would just
declare the type as
struct msix_entry {
u16 vector;
u16 entry;
};
> +int pci_enable_msix(struct pci_dev *dev, u32 *entries, int nvec)
Since this function takes an array of struct msix_entry in its entries
parameter, I think entries should be declared as struct msix_entry *
rather than just u32 *. That is, I would write the prototype as
int pci_enable_msix(struct pci_dev *dev, struct msix_entry *entries,
int nvec);
> + j = (entries + i)->entry;
> + (entries + i)->vector = vector;
Finally, this is a nitpick, but this just looks odd to me. Why not
write this as
j = entries[i].entry;
entries[i].vector = vector;
By the way, I have MSI working with my device with this patch
applied. I am getting ready to test MSI-X, which is why I have
comments about the MSI-X API now.
- Roland
next prev parent reply other threads:[~2004-06-23 3:45 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-22 21:48 [PATCH]2.6.7 MSI-X Update long
2004-06-22 23:57 ` Roland Dreier
2004-06-23 0:26 ` Jeff Garzik
2004-06-23 1:18 ` Roland Dreier
2004-06-23 3:45 ` Roland Dreier [this message]
2004-06-23 16:50 ` Roland Dreier
-- strict thread matches above, loose matches on Subject: below --
2004-06-22 23:06 Nguyen, Tom L
2004-06-23 16:49 Nguyen, Tom L
2004-06-23 16:58 Nguyen, Tom L
2004-06-23 22:03 Nguyen, Tom L
2004-06-24 1:42 ` Roland Dreier
2004-06-24 6:37 ` Zwane Mwaikambo
2004-06-24 7:27 ` Roland Dreier
2004-06-24 16:29 Nguyen, Tom L
2004-06-26 1:21 long
2004-06-26 0:30 ` [PATCH]2.6.7 " Roland Dreier
2004-06-26 1:38 ` Roland Dreier
2004-06-26 8:27 ` Christoph Hellwig
2004-06-26 17:30 ` Roland Dreier
2004-07-13 22:02 long
2004-07-15 2:14 ` [PATCH]2.6.7 " Roland Dreier
2004-07-18 1:25 ` Roland Dreier
2004-07-15 15:46 Nguyen, Tom L
2004-07-19 15:36 Nguyen, Tom L
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=52d63rj5sx.fsf@topspin.com \
--to=roland@topspin.com \
--cc=ak@muc.de \
--cc=akpm@osdl.org \
--cc=eli@mellanox.co.il \
--cc=greg@kroah.com \
--cc=jgarzik@pobox.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tlnguyen@snoqualmie.dp.intel.com \
--cc=tom.l.nguyen@intel.com \
--cc=zwane@linuxpower.ca \
/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