mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michael Chan <mchan@broadcom.com>
To: Benjamin Poirier <bpoirier@suse.de>
Cc: Prashant Sreedharan <prashant@broadcom.com>,
	<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/3] tg3: Fix tx_pending checks for tg3_tso_bug
Date: Tue, 19 Aug 2014 16:10:52 -0700	[thread overview]
Message-ID: <1408489852.7404.60.camel@LTIRV-MCHAN1.corp.ad.broadcom.com> (raw)
In-Reply-To: <1408474371-19509-2-git-send-email-bpoirier@suse.de>

On Tue, 2014-08-19 at 11:52 -0700, Benjamin Poirier wrote: 
> @@ -7838,11 +7838,14 @@ static int tg3_tso_bug(struct tg3 *tp, struct tg3_napi *tnapi,
>                        struct netdev_queue *txq, struct sk_buff *skb)
>  {
>         struct sk_buff *segs, *nskb;
> -       u32 frag_cnt_est = skb_shinfo(skb)->gso_segs * 3;
>  
> -       /* Estimate the number of fragments in the worst case */
> -       if (unlikely(tg3_tx_avail(tnapi) <= frag_cnt_est)) {
> +       if (unlikely(tg3_tx_avail(tnapi) <= skb_shinfo(skb)->gso_segs)) {
> +               trace_printk("stopping queue, %d <= %d\n",
> +                            tg3_tx_avail(tnapi), skb_shinfo(skb)->gso_segs);
>                 netif_tx_stop_queue(txq);
> +               trace_printk("stopped queue\n");
> +               tnapi->wakeup_thresh = skb_shinfo(skb)->gso_segs;
> +               BUG_ON(tnapi->wakeup_thresh >= tnapi->tx_pending);
>  
>                 /* netif_tx_stop_queue() must be done before checking
>                  * checking tx index in tg3_tx_avail() below, because in 

I don't quite understand this logic and I must be missing something.
gso_segs is the number of TCP segments the large packet will be broken
up into.  If it exceeds dev->gso_max_segs, it means it exceeds
hardware's capabilty and it will do GSO instead of TSO.  But in this
case in tg3_tso_bug(), we are doing GSO and we may not have enough DMA
descriptors to do GSO.  Each gso_seg typically requires 2 DMA
descriptors.


  parent reply	other threads:[~2014-08-19 23:10 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-19 18:52 [PATCH 1/3] tg3: Limit minimum tx queue wakeup threshold Benjamin Poirier
2014-08-19 18:52 ` [PATCH 2/3] tg3: Fix tx_pending checks for tg3_tso_bug Benjamin Poirier
2014-08-19 20:56   ` Benjamin Poirier
2014-08-19 23:10   ` Michael Chan [this message]
2014-08-21  1:23     ` Benjamin Poirier
2014-08-21  9:51       ` Michael Chan
2014-08-21 21:59         ` Benjamin Poirier
2014-08-22  4:25           ` David Miller
2014-08-19 18:52 ` [PATCH 3/3] tg3: Fix tx_pending check for MAX_SKB_FRAGS Benjamin Poirier
2014-08-19 22:00 ` [PATCH 1/3] tg3: Limit minimum tx queue wakeup threshold Michael Chan
2014-08-21 22:04   ` Benjamin Poirier
2014-08-21 22:32     ` Michael Chan
2014-08-21 23:06       ` Benjamin Poirier
2014-08-21 23:26         ` Michael Chan

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=1408489852.7404.60.camel@LTIRV-MCHAN1.corp.ad.broadcom.com \
    --to=mchan@broadcom.com \
    --cc=bpoirier@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --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

all inboxes | Powered by JetHome®