linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peter Hurley <peter@hurleysoftware.com>
To: Stefan Richter <stefanr@s5r6.in-berlin.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux1394-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org,
	Peter Hurley <peter@hurleysoftware.com>
Subject: [PATCH v2 2/6] staging/fwserial: Remove bandwidth limit logic
Date: Sat, 15 Dec 2012 01:03:16 -0500	[thread overview]
Message-ID: <1355551400-8204-3-git-send-email-peter@hurleysoftware.com> (raw)
In-Reply-To: <1355551400-8204-1-git-send-email-peter@hurleysoftware.com>

Self-limiting asynchronous bandwidth (via reducing the payload)
is not necessary and does not work, because
 1) asynchronous traffic will absorb all available bandwidth (less that
    being used for isochronous traffic)
 2) isochronous arbitration always wins.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
---
 drivers/staging/fwserial/fwserial.c |  3 ---
 drivers/staging/fwserial/fwserial.h | 15 ++++++---------
 2 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/fwserial/fwserial.c b/drivers/staging/fwserial/fwserial.c
index 61ee290..be5db8a 100644
--- a/drivers/staging/fwserial/fwserial.c
+++ b/drivers/staging/fwserial/fwserial.c
@@ -40,12 +40,10 @@ static int num_ttys = 4;	    /* # of std ttys to create per fw_card    */
 				    /* - doubles as loopback port index       */
 static bool auto_connect = true;    /* try to VIRT_CABLE to every peer        */
 static bool create_loop_dev = true; /* create a loopback device for each card */
-bool limit_bw;			    /* limit async bandwidth to 20% of max    */
 
 module_param_named(ttys, num_ttys, int, S_IRUGO | S_IWUSR);
 module_param_named(auto, auto_connect, bool, S_IRUGO | S_IWUSR);
 module_param_named(loop, create_loop_dev, bool, S_IRUGO | S_IWUSR);
-module_param(limit_bw, bool, S_IRUGO | S_IWUSR);
 
 /*
  * Threshold below which the tty is woken for writing
@@ -2940,4 +2938,3 @@ MODULE_DEVICE_TABLE(ieee1394, fwserial_id_table);
 MODULE_PARM_DESC(ttys, "Number of ttys to create for each local firewire node");
 MODULE_PARM_DESC(auto, "Auto-connect a tty to each firewire node discovered");
 MODULE_PARM_DESC(loop, "Create a loopback device, fwloop<n>, with ttys");
-MODULE_PARM_DESC(limit_bw, "Limit bandwidth utilization to 20%.");
diff --git a/drivers/staging/fwserial/fwserial.h b/drivers/staging/fwserial/fwserial.h
index 8b572ed..cb0eea0 100644
--- a/drivers/staging/fwserial/fwserial.h
+++ b/drivers/staging/fwserial/fwserial.h
@@ -351,7 +351,6 @@ struct fw_serial {
 #define TTY_DEV_NAME		    "fwtty"	/* ttyFW was taken           */
 static const char tty_dev_name[] =  TTY_DEV_NAME;
 static const char loop_dev_name[] = "fwloop";
-extern bool limit_bw;
 
 struct tty_driver *fwtty_driver;
 
@@ -370,18 +369,16 @@ static inline void fwtty_bind_console(struct fwtty_port *port,
 
 /*
  * Returns the max send async payload size in bytes based on the unit device
- * link speed - if set to limit bandwidth to max 20%, use lookup table
+ * link speed. Self-limiting asynchronous bandwidth (via reducing the payload)
+ * is not necessary and does not work, because
+ *   1) asynchronous traffic will absorb all available bandwidth (less that
+ *	being used for isochronous traffic)
+ *   2) isochronous arbitration always wins.
  */
 static inline int link_speed_to_max_payload(unsigned speed)
 {
-	static const int max_async[] = { 307, 614, 1229, 2458, 4916, 9832, };
-	BUILD_BUG_ON(ARRAY_SIZE(max_async) - 1 != SCODE_3200);
-
 	speed = clamp(speed, (unsigned) SCODE_100, (unsigned) SCODE_3200);
-	if (limit_bw)
-		return max_async[speed];
-	else
-		return 1 << (speed + 9);
+	return 1 << (speed + 9);
 }
 
 #endif /* _FIREWIRE_FWSERIAL_H */
-- 
1.8.0.1


  parent reply	other threads:[~2012-12-15  6:04 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-15  6:03 [PATCH v2 0/5] staging/fwserial: Address reviewer comments Peter Hurley
2012-12-15  6:03 ` [PATCH v2 1/6] staging/fwserial: Refine Kconfig help text Peter Hurley
2012-12-15  6:03 ` Peter Hurley [this message]
2012-12-15  6:03 ` [PATCH v2 3/6] staging/fwserial: Limit tx/rx to 1394-2008 spec maximum Peter Hurley
2012-12-15  6:03 ` [PATCH v2 4/6] staging/fwserial: Update TODO file per reviewer comments Peter Hurley
2012-12-15  6:03 ` [PATCH v2 5/6] staging/fwserial: Assume firmware is OHCI-complaint Peter Hurley
2012-12-15  6:03 ` [PATCH v2 6/6] staging/fwserial: Drop suggestion for helper fn integration Peter Hurley
2012-12-15 12:34   ` Stefan Richter
2012-12-15 16:09     ` Stefan Richter
2013-01-07 23:22 ` [PATCH v2 0/5] staging/fwserial: Address reviewer comments Greg Kroah-Hartman
2013-01-08 14:59   ` Peter Hurley
2013-01-29  1:57   ` [PATCH v3 0/6] " Peter Hurley
2013-01-29  1:57     ` [PATCH v3 1/6] staging/fwserial: Remove bandwidth limit logic Peter Hurley
2013-01-29  1:57     ` [PATCH v3 2/6] staging/fwserial: Refer to fw_device as "node" Peter Hurley
2013-01-29  1:57     ` [PATCH v3 3/6] staging/fwserial: Simplify max payload calculation Peter Hurley
2013-01-29  1:57     ` [PATCH v3 4/6] staging/fwserial: Fold constant MAX_ASYNC_PAYLOAD Peter Hurley
2013-01-29  1:57     ` [PATCH v3 5/6] staging/fwserial: Assume firmware is OHCI-complaint Peter Hurley
2013-01-29  1:57     ` [PATCH v3 6/6] staging/fwserial: Drop suggestion for helper fn integration Peter Hurley

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=1355551400-8204-3-git-send-email-peter@hurleysoftware.com \
    --to=peter@hurleysoftware.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux1394-devel@lists.sourceforge.net \
    --cc=stefanr@s5r6.in-berlin.de \
    /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).