Netdev List
 help / color / mirror / Atom feed
From: David Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
To: hayeswang-Rasf1IRRPZFBDgjK7y7TUQ@public.gmane.org
Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	nic_swsd-Rasf1IRRPZFBDgjK7y7TUQ@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH net v4 3/4] r8152: support stopping/waking tx queue
Date: Tue, 19 Nov 2013 15:25:36 -0500 (EST)	[thread overview]
Message-ID: <20131119.152536.146706009595105149.davem@davemloft.net> (raw)
In-Reply-To: <1384831511-1625-4-git-send-email-hayeswang-Rasf1IRRPZFBDgjK7y7TUQ@public.gmane.org>

From: Hayes Wang <hayeswang-Rasf1IRRPZFBDgjK7y7TUQ@public.gmane.org>
Date: Tue, 19 Nov 2013 11:25:10 +0800

> The maximum packet number which a tx aggregation buffer could contain
> is the buffer size / (packet size + descriptor size).
> 
> If the tx buffer is empty and the tx queue length is more than the
> maximum value which is defined above, stop the tx queue. Wake the tx
> queue after any queued packet is filled in a available tx buffer.
> 
> Signed-off-by: Hayes Wang <hayeswang-Rasf1IRRPZFBDgjK7y7TUQ@public.gmane.org>

This is racy.

You have nothing which synchronizes r8152_tx_agg_fill() and rtl8152_start_xmit(),
therefore:

> +	if (netif_queue_stopped(tp->netdev))
> +		netif_wake_queue(tp->netdev);
> +

A netif_stop_queue() can occur right after the netif_queue_stopped() check,
meaning you can end up with the queue being stopped forever and the TX queue
stuck.

I am finding this patch series _very_ tiring, every single time I take
the time to review it, I find major problems.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2013-11-19 20:25 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-15  7:57 [PATCH net v3 0/4] r8152 bug fixes Hayes Wang
2013-11-15  7:57 ` [PATCH net v3 1/4] r8152: fix tx/rx memory overflow Hayes Wang
2013-11-15 22:39   ` David Miller
     [not found]     ` <20131115.173948.1712849813995511721.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2013-11-19  2:32       ` hayeswang
     [not found] ` <1384502279-9959-1-git-send-email-hayeswang-Rasf1IRRPZFBDgjK7y7TUQ@public.gmane.org>
2013-11-15  7:57   ` [PATCH net v3 2/4] r8152: modify the tx flow Hayes Wang
2013-11-15  7:57   ` [PATCH net v3 3/4] r8152: support stopping/waking tx queue Hayes Wang
2013-11-15  7:57 ` [PATCH net v3 4/4] r8152: fix incorrect type in assignment Hayes Wang
2013-11-19  3:25 ` [PATCH net v4 0/4] r8152 bug fixes Hayes Wang
     [not found]   ` <1384831511-1625-1-git-send-email-hayeswang-Rasf1IRRPZFBDgjK7y7TUQ@public.gmane.org>
2013-11-19  3:25     ` [PATCH net v4 1/4] r8152: fix tx/rx memory overflow Hayes Wang
2013-11-19  3:25   ` [PATCH net v4 2/4] r8152: modify the tx flow Hayes Wang
2013-11-19  3:25   ` [PATCH net v4 3/4] r8152: support stopping/waking tx queue Hayes Wang
     [not found]     ` <1384831511-1625-4-git-send-email-hayeswang-Rasf1IRRPZFBDgjK7y7TUQ@public.gmane.org>
2013-11-19 20:25       ` David Miller [this message]
     [not found]         ` <20131119.152536.146706009595105149.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2013-11-20  3:28           ` hayeswang
     [not found]             ` <9C2E97E7BED9426ABE0FF4F63E12E33D-Rasf1IRRPZGoECsaD+WFmw@public.gmane.org>
2013-11-20  5:22               ` David Miller
2013-11-20  6:30                 ` hayeswang
2013-11-19  3:25   ` [PATCH net v4 4/4] r8152: fix incorrect type in assignment Hayes Wang
2013-11-20  9:30 ` [PATCH net v5 0/4] r8152 bug fixes Hayes Wang
2013-11-20  9:30   ` [PATCH net v5 1/4] r8152: fix tx/rx memory overflow Hayes Wang
2013-11-20  9:30   ` [PATCH net v5 2/4] r8152: modify the tx flow Hayes Wang
2013-11-20  9:30   ` [PATCH net v5 3/4] r8152: support stopping/waking tx queue Hayes Wang
2013-11-20  9:30   ` [PATCH net v5 4/4] r8152: fix incorrect type in assignment Hayes Wang
2013-12-23  2:20   ` [PATCH net v5 0/4] r8152 bug fixes hayeswang

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=20131119.152536.146706009595105149.davem@davemloft.net \
    --to=davem-ft/pcqaiutieiz0/mpfg9q@public.gmane.org \
    --cc=hayeswang-Rasf1IRRPZFBDgjK7y7TUQ@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=nic_swsd-Rasf1IRRPZFBDgjK7y7TUQ@public.gmane.org \
    /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