All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roland Dreier <rdreier@cisco.com>
To: Brice Goglin <bgoglin@myri.com>
Cc: netdev@vger.kernel.org, Andrew Morton <akpm@osdl.org>,
	LKML <linux-kernel@vger.kernel.org>,
	"Andrew J. Gallatin" <gallatin@myri.com>, <brice@myri.com>
Subject: Re: [PATCH 4/6] myri10ge - First half of the driver
Date: Wed, 10 May 2006 15:04:20 -0700	[thread overview]
Message-ID: <adahd3x7d0b.fsf@cisco.com> (raw)
In-Reply-To: <Pine.GSO.4.44.0605101438410.498-100000@adel.myri.com> (Brice Goglin's message of "Wed, 10 May 2006 14:40:22 -0700 (PDT)")

 > +typedef struct {
 > +	mcp_kreq_ether_recv_t __iomem *lanai;	/* lanai ptr for recv ring */
 > +	volatile uint8_t __iomem *wc_fifo;	/* w/c rx dma addr fifo address */
 > +	mcp_kreq_ether_recv_t *shadow;	/* host shadow of recv ring */
 > +	struct myri10ge_rx_buffer_state *info;
 > +	int cnt;
 > +	int alloc_fail;
 > +	int mask;			/* number of rx slots -1 */
 > +} myri10ge_rx_buf_t;

Why is wc_fifo volatile?  The only places you actually use it, you
seem to cast away the volatile anyway.

Also, again, no typedef of structures please.

 > +#define myri10ge_pio_copy(to,from,size) __iowrite64_copy(to,from,size/8)

Why do you need this wrapper?  Why not just call __iowrite64_copy()
without the obfuscation?  Anyone reading the code will just have to
search back to this define and mentally translate the size back and
forth all the time.

 > +int myri10ge_hyper_msi_cap_on(struct pci_dev *pdev)
 > +{
 > +	uint8_t cap_off;
 > +	int nbcap = 0;
 > +
 > +	cap_off = PCI_CAPABILITY_LIST - 1;
 > +	/* go through all caps looking for a hypertransport msi mapping */

This looks like something that should be fixed up in the general PCI
quirk handling rather than in every driver...

 > +static int
 > +myri10ge_use_msi(struct pci_dev *pdev)
 > +{
 > +	if (myri10ge_msi == 1 || myri10ge_msi == 0)
 > +		return myri10ge_msi;
 > +
 > +	/*  find root complex for our device */
 > +	while (pdev->bus && pdev->bus->self) {
 > +		pdev = pdev->bus->self;
 > +	}

Similarly looks like generic PCI code (if it's needed at all).  If I
understand correctly you're trying to check if MSI has a chance at
working on the system, but a network device driver has no business
walking up the PCI hierarchy.

 > +	buf = (mcp_cmd_t *) ((unsigned long)(buf_bytes + 7) & ~7UL);

ALIGN() from <linux/kernel.h>?

 - R.

  parent reply	other threads:[~2006-05-10 22:04 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-10 21:22 [PATCH 0/6] myri10ge - Myri-10G Ethernet driver Brice Goglin
2006-05-10 21:34 ` [PATCH 1/6] myri10ge - Revive pci_find_ext_capability Brice Goglin
2006-05-10 21:35 ` [PATCH 2/6] myri10ge - Add missing PCI IDs Brice Goglin
2006-05-10 21:52   ` Andi Kleen
2006-05-10 21:36 ` [PATCH 3/6] myri10ge - Driver header files Brice Goglin
2006-05-10 21:57   ` Roland Dreier
2006-05-10 22:00   ` Stephen Hemminger
2006-05-10 22:02   ` Francois Romieu
2006-05-10 21:40 ` [PATCH 4/6] myri10ge - First half of the driver Brice Goglin
2006-05-10 22:01   ` Stephen Hemminger
2006-05-10 22:06     ` Roland Dreier
2006-05-11 23:53       ` Brice Goglin
2006-05-10 22:04   ` Roland Dreier [this message]
2006-05-11 23:53     ` Brice Goglin
2006-05-10 23:13   ` Francois Romieu
2006-05-11 23:53     ` Brice Goglin
2006-05-12  6:47       ` Evgeniy Polyakov
2006-05-12 17:40         ` David S. Miller
2006-05-13 16:13       ` Francois Romieu
2006-05-15 17:02       ` Lee Revell
2006-05-15 17:39         ` Brice Goglin
2006-05-10 21:42 ` [PATCH 5/6] myri10ge - Second " Brice Goglin
2006-05-10 22:22   ` Stephen Hemminger
     [not found]     ` <200605111924.33125.netdev@axxeo.de>
2006-05-11 18:28       ` [PATCH] expose simplified skb_checksum_recalc Stephen Hemminger
2006-05-11 18:40         ` Ingo Oeser
2006-05-12 19:52         ` David S. Miller
2006-05-11 23:53     ` [PATCH 5/6] myri10ge - Second half of the driver Brice Goglin
2006-05-12  0:31       ` Herbert Xu
2006-05-10 21:43 ` [PATCH 6/6] myri10ge - Kconfig and Makefile Brice Goglin
2006-05-13 18:51   ` Adrian Bunk
2006-05-13 18:56     ` Brice Goglin

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=adahd3x7d0b.fsf@cisco.com \
    --to=rdreier@cisco.com \
    --cc=akpm@osdl.org \
    --cc=bgoglin@myri.com \
    --cc=brice@myri.com \
    --cc=gallatin@myri.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.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 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.