netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stanislaw Gruszka <sgruszka@redhat.com>
To: Rasesh Mody <rmody@brocade.com>
Cc: netdev@vger.kernel.org, adapter_linux_open_src_team@brocade.com
Subject: Re: Subject: [PATCH 2/6] bna: Brocade 10Gb Ethernet device driver
Date: Mon, 22 Feb 2010 13:36:30 +0100	[thread overview]
Message-ID: <20100222123629.GC2520@dhcp-lab-161.englab.brq.redhat.com> (raw)
In-Reply-To: <201002192152.o1JLqcI5031959@blc-10-1.brocade.com>

On Fri, Feb 19, 2010 at 01:52:38PM -0800, Rasesh Mody wrote:
> From: Rasesh Mody <rmody@brocade.com>
> 
> This is patch 2/6 which contains linux driver source for
> Brocade's BR1010/BR1020 10Gb CEE capable ethernet adapter.
> Source is based against net-next-2.6.
> 
> We wish this patch to be considered for inclusion in net-next-2.6
> 
> Signed-off-by: Rasesh Mody <rmody@brocade.com>
> ---
>  bfad_fwimg.c   |   94 ++
>  bna_fn.c       | 1795 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  bna_queue.c    |  394 ++++++++++++
>  bnad_ethtool.c | 1100 ++++++++++++++++++++++++++++++++++
>  4 files changed, 3383 insertions(+)
[snip]

> +u32 *
> +bfad_read_firmware(struct pci_dev *pdev, u32 **bfi_image,
> +			u32 *bfi_image_size, char *fw_name)
> +{
> +	const struct firmware *fw;
> +
> +	if (request_firmware(&fw, fw_name, &pdev->dev)) {
> +		printk(KERN_ALERT "Can't locate firmware %s\n", fw_name);
> +		goto error;
> +	}
> +
> +	*bfi_image = vmalloc(fw->size);
> +	if (NULL == *bfi_image) {
> +		printk(KERN_ALERT "Fail to allocate buffer for fw image "
> +			"size=%x!\n", (u32) fw->size);
> +		goto error;
> +	}
> +
> +	memcpy(*bfi_image, fw->data, fw->size);

Why do you alloc and copy image, why not just use fw->data?

> +	 struct bfa_log_mod *logmod)
> +{
> +	u32 pcifn;
> +
> +	memset(dev, 0, sizeof(struct bna_dev));
> +
> +	dev->trcmod = trcmod;
> +	dev->logmod = logmod;
> +
> +	dev->bar0 = (u8 *) bar0;
> +	dev->hw_stats = (struct bfi_ll_stats *)stats;
> +	dev->hw_stats_dma.msb = stats_dma.msb;
> +	dev->hw_stats_dma.lsb = stats_dma.lsb;
> +
> +	dev->rxf_promiscuous_id = BNA_RXF_ID_NONE;
> +	dev->rxf_default_id = BNA_RXF_ID_NONE;
> +
> +	pcifn = readl(dev->bar0 + FNC_ID_REG);
> +	pcifn = readl(dev->bar0 + FNC_ID_REG);
What for you read this twice?

> +	/* we always use RSS table 0 */
> +	writel(cfg_ptr->flags & BNA_RXF_CF_RSS_ENABLE,
> +		&rx_fndb_ram[rxf_id].rss_prop);
> +
> +	/* small large buffer enable/disable */
> +	writel((cfg_ptr->flags & BNA_RXF_CF_SM_LG_RXQ) | 0x80,
> +		&rx_fndb_ram[rxf_id].size_routing_props);
> +
> +	/* RIT offset, HDS forced offset, multicast RxQ Id */
> +	writel(
> +		       (cfg_ptr->rit_offset << 16) | (cfg_ptr->hds.
> +						      forced_offset << 8) |
> +		       (cfg_ptr->hds.type & BNA_HDS_FORCED) | cfg_ptr->
> +		       mcast_rxq_id, &rx_fndb_ram[rxf_id].rit_hds_mcastq);
Please use normal indentions.


  reply	other threads:[~2010-02-22 12:38 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-19 21:52 Subject: [PATCH 2/6] bna: Brocade 10Gb Ethernet device driver Rasesh Mody
2010-02-22 12:36 ` Stanislaw Gruszka [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-02-12 14:00 Rasesh Mody
2010-02-10  6:29 Rasesh Mody
2009-12-19  1:28 Debashis Dutt
2009-12-19  2:19 ` Ben Hutchings
2009-11-26  9:28 Debashis Dutt
2009-11-24  3:51 Rasesh Mody
2009-11-24  4:21 ` Stephen Hemminger
2009-11-24  4:22 ` Stephen Hemminger
2009-11-24  4:23 ` Stephen Hemminger
2009-11-24  4:24 ` Stephen Hemminger
2009-11-26  9:01   ` Debashis Dutt
2009-11-24  4:26 ` Stephen Hemminger
2009-11-24  4:27 ` Stephen Hemminger
2009-11-24  4:28 ` Stephen Hemminger
2009-11-26  8:58   ` Debashis Dutt
2009-11-17  8:30 Rasesh Mody
2009-11-17  9:00 ` David Miller
2009-11-13  3:46 Rasesh Mody
2009-11-13  5:08 ` Stephen Hemminger
2009-11-01  5:03 Rasesh Mody
2009-11-01 19:23 ` Stephen Hemminger
2009-11-01 19:25 ` Stephen Hemminger
2009-10-16 18:24 Rasesh Mody
2009-10-16 20:31 ` Ben Hutchings

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=20100222123629.GC2520@dhcp-lab-161.englab.brq.redhat.com \
    --to=sgruszka@redhat.com \
    --cc=adapter_linux_open_src_team@brocade.com \
    --cc=netdev@vger.kernel.org \
    --cc=rmody@brocade.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).