netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Divy Le Ray <divy@chelsio.com>
To: Arjan van de Ven <arjan@infradead.org>
Cc: Divy Le Ray <None@chelsio.com>,
	jeff@garzik.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, swise@opengridcomputing.com
Subject: Re: [PATCH 2/10] cxgb3 - main source file
Date: Wed, 20 Dec 2006 15:43:24 -0800	[thread overview]
Message-ID: <4589CA9C.80007@chelsio.com> (raw)
In-Reply-To: <1166623330.3365.1397.camel@laptopd505.fenrus.org>

Arjan,

Thanks for the review. Please see my replies inline.

Arjan van de Ven wrote:
>> +/*
>> + * Interrupt handler for asynchronous events used with MSI-X.
>> + */
>> +static irqreturn_t t3_async_intr_handler(int irq, void *cookie)
>> +{
>> +	t3_slow_intr_handler(cookie);
>> +	return IRQ_HANDLED;
>> +}
>
> this looks very wrong; why is t3_slow_intr_handler a void rather than
> returning IRQ_HANDLED etc? And why wrap around it ?
t3_slow_intr_handler() processes non-data events such as board errors.
In line interupt and MSI mode, the intr handler deals with both data
and non-data events and calls t3_slow_intr_handler for the latter.
In MSI-X mode, t3_async_intr_handler() is registered to deal with these
non-data interrupts exclusively.

>> +
>> +static ssize_t attr_show(struct class_device *cd, char *buf,
>> +			 ssize_t(*format) (struct adapter *, char *))
>> +{
>> +	ssize_t len;
>> +	struct adapter *adap = to_net_dev(cd)->priv;
>> +
>> +	/* Synchronize with ioctls that may shut down the device */
>> +	rtnl_lock();
>> +	len = (*format) (adap, buf);
>> +	rtnl_unlock();
>> +	return len;
>> +}
>
> I'm usually kind of nervous with drivers taking the rtnl_lock; to me
> that sounds like a layering violation.. why shouldn't your attributes
> etc live in the net layer instead?

These attributes are really device specific.
The net layer does not support device specific attributes.

>> +#ifdef ETHTOOL_GPERMADDR
>> +	.get_perm_addr = ethtool_op_get_perm_addr
>> +#endif
>
> what is this ifdef for?
it will be removed.
>> +static int cxgb_extension_ioctl(struct net_device *dev, void __user *useraddr)
>> +{
>> +	int ret;
>> +	u32 cmd;
>> +	struct adapter *adapter = dev->priv;
>> +
>> +	if (copy_from_user(&cmd, useraddr, sizeof(cmd)))
>> +		return -EFAULT;
>> +
>> +	switch (cmd) {
>> +	case CHELSIO_SETREG:{
>
> what are these for ?
They are used to parameter the HW:
register access, configuration of queue sets, on board memory 
configuration,
firmware load, etc ...
>> +
>> +	/*
>> +	 * Can't use pci_request_regions() here because some kernels want to
>> +	 * request the MSI-X BAR in pci_enable_msix.
>
> are these "some kernels" actual current mainline kernels?
Will fix both comment and related code.
>> +	if (!pci_set_dma_mask(pdev, DMA_64BIT_MASK)) {
>> +		pci_using_dac = 1;
>> +		err = pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK);
>> +		if (err) {
>> +			dev_err(&pdev->dev, "unable to obtain 64-bit DMA for "
>> +			       "coherent allocations\n");
>> +			goto out_release_regions;
>
> this looks wrong; if you can't get 64 bit coherent allocs but can get 32
> bit ones.. why error out ?
This is how most of the existing drivers behave.

Cheers,
Divy

  reply	other threads:[~2006-12-20 23:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-20 12:41 [PATCH 2/10] cxgb3 - main source file Divy Le Ray
2006-12-20 14:02 ` Arjan van de Ven
2006-12-20 23:43   ` Divy Le Ray [this message]
2006-12-21  8:16     ` Arjan van de Ven
2006-12-22  7:17       ` Divy Le Ray
2006-12-22 11:26         ` Arjan van de Ven
  -- strict thread matches above, loose matches on Subject: below --
2006-12-22  7:20 Divy Le Ray
2006-12-14  5:41 Divy Le Ray
2006-12-08  3:27 Divy Le Ray
2006-12-04 19:44 Divy Le Ray
2006-12-04 21:09 ` Stephen Hemminger
2006-12-05  8:29   ` Divy Le Ray
2006-11-17 20:23 Divy Le Ray <divy@chelsio.com>

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=4589CA9C.80007@chelsio.com \
    --to=divy@chelsio.com \
    --cc=None@chelsio.com \
    --cc=arjan@infradead.org \
    --cc=jeff@garzik.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=swise@opengridcomputing.com \
    /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;
as well as URLs for NNTP newsgroup(s).