netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: cascardo@linux.vnet.ibm.com
Cc: netdev@vger.kernel.org, prashant@broadcom.com, mchan@broadcom.com
Subject: Re: [PATCH] tg3: fix ring init when there are more TX than RX channels
Date: Tue, 25 Nov 2014 14:33:52 -0500 (EST)	[thread overview]
Message-ID: <20141125.143352.669361329120151757.davem@davemloft.net> (raw)
In-Reply-To: <1416932471-8744-1-git-send-email-cascardo@linux.vnet.ibm.com>

From: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
Date: Tue, 25 Nov 2014 14:21:11 -0200

> @@ -8563,7 +8563,8 @@ static int tg3_init_rings(struct tg3 *tp)
>  		if (tnapi->rx_rcb)
>  			memset(tnapi->rx_rcb, 0, TG3_RX_RCB_RING_BYTES(tp));
>  
> -		if (tg3_rx_prodring_alloc(tp, &tnapi->prodring)) {
> +		if (tnapi->prodring.rx_std &&
> +		    tg3_rx_prodring_alloc(tp, &tnapi->prodring)) {
>  			tg3_free_rings(tp);
>  			return -ENOMEM;

Maybe a better test is "i < tp->rxq_cnt"?  This is what is used in
tg3_mem_rx_acquire() to determine if tg3_rx_prodring_init() happens.

  reply	other threads:[~2014-11-25 19:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-25 16:21 [PATCH] tg3: fix ring init when there are more TX than RX channels Thadeu Lima de Souza Cascardo
2014-11-25 19:33 ` David Miller [this message]
2014-11-25 19:57   ` cascardo
2014-11-25 20:19     ` David Miller

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=20141125.143352.669361329120151757.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=cascardo@linux.vnet.ibm.com \
    --cc=mchan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    --cc=prashant@broadcom.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).