All of lore.kernel.org
 help / color / mirror / Atom feed
From: "ravinandan arakali" <ravinandan.arakali@s2io.com>
To: "'Jeff Garzik'" <jgarzik@pobox.com>
Cc: <raghavendra.koushik@wipro.com>, <leonid.grossman@s2io.com>,
	<netdev@oss.sgi.com>, <raghavendra.koushik@s2io.com>
Subject: RE: Submission for S2io 10GbE driver
Date: Thu, 19 Feb 2004 18:59:59 -0800	[thread overview]
Message-ID: <002e01c3f75d$a1413410$8e10100a@S2IOtech.com> (raw)
In-Reply-To: <403573B5.4050100@pobox.com>

Hi Jeff,
Since the whole nic structure is zeroed out initially, the
"block_virt_addr" is initially NULL. So, if the allocation
succeeds, it will hold a non-NULL value.
So, in the freeSharedMem() if we check for it's non-NULL
value and free it, we should be okay. Do you agree ?

Thanks,
Ravi

-----Original Message-----
From: Jeff Garzik [mailto:jgarzik@pobox.com] 
Sent: Thursday, February 19, 2004 6:41 PM
To: ravinandan arakali
Cc: raghavendra.koushik@wipro.com; leonid.grossman@s2io.com;
netdev@oss.sgi.com; raghavendra.koushik@s2io.com
Subject: Re: Submission for S2io 10GbE driver

ravinandan arakali wrote:
> Hi Jeff,
> For #7, the temporary variable tmp_v_addr is assigned as follows
> (immediately below the code you have quoted):
> 
> nic->rx_blocks[i][j].block_virt_addr = tmp_v_addr;

Yes... but only after the allocation.


> In the freeSharedMem() routine, we go thru' each block of each
> receive ring and free it. Following is the relevant piece of
> code:
> for (i = 0; i < config->RxRingNum; i++) {
>      blk_cnt = nic->block_count[i];
>      for (j = 0; j < blk_cnt; j++) {
>           tmp_v_addr = nic->rx_blocks[i][j].block_virt_addr;
>           tmp_p_addr = nic->rx_blocks[i][j].block_dma_addr;
>           pci_free_consistent(nic->pdev, size, tmp_v_addr,
tmp_p_addr);
>      }
> }
> 
> But I guess in the above piece of code, it may be a good idea to
> check if nic->rx_blocks[i][j].block_virt_addr is non-NULL before
> doing the pci_free_consistent().

Yes, you could add the check there.

	Jeff

       reply	other threads:[~2004-02-20  2:59 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <403573B5.4050100@pobox.com>
2004-02-20  2:59 ` ravinandan arakali [this message]
2004-02-20  3:30   ` Submission for S2io 10GbE driver Jeff Garzik
2004-02-25  6:03 raghavendra.koushik
2004-02-26  7:40 ` Jeff Garzik
  -- strict thread matches above, loose matches on Subject: below --
2004-02-19  7:16 raghavendra.koushik
2004-02-19  8:14 ` Jeff Garzik
2004-02-20  2:33   ` ravinandan arakali
2004-02-05  0:49 FW: " Grant Grundler
2004-02-16 21:16 ` Leonid Grossman
2004-02-16 22:12   ` Jeff Garzik
2004-02-16 23:53     ` Leonid Grossman
2004-02-17  0:11   ` Christoph Hellwig
2004-02-17  0:16     ` Stephen Hemminger
2004-01-23 21:22 FW: " Leonid Grossman
2004-01-23 21:54 ` Stephen Hemminger
2004-01-23 21:58   ` Leonid Grossman
2004-01-23 22:22 ` FW: " Andi Kleen
2004-01-24  0:21   ` Stephen Hemminger
2004-01-27  5:32     ` Leonid Grossman
2004-01-27  6:08       ` Jeff Garzik
2004-01-27  6:19         ` Leonid Grossman

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='002e01c3f75d$a1413410$8e10100a@S2IOtech.com' \
    --to=ravinandan.arakali@s2io.com \
    --cc=jgarzik@pobox.com \
    --cc=leonid.grossman@s2io.com \
    --cc=netdev@oss.sgi.com \
    --cc=raghavendra.koushik@s2io.com \
    --cc=raghavendra.koushik@wipro.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 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.