aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ppp_synctty.c
diff options
context:
space:
mode:
authorGabriele Paoloni <gabriele.paoloni@intel.com>2009-03-13 19:09:12 -0400
committerDavid S. Miller <davem@davemloft.net>2009-03-13 19:09:12 -0400
commit9c705260feea6ae329bc6b6d5f6d2ef0227eda0a (patch)
tree0c8dc286ff35bbd0c75be020bee609b771084ae3 /drivers/net/ppp_synctty.c
parenta2025b8b1039e5abaa38319b2eaab3b17867479a (diff)
ppp: ppp_mp_explode() redesign
I found the PPP subsystem to not work properly when connecting channels with different speeds to the same bundle. Problem Description: As the "ppp_mp_explode" function fragments the sk_buff buffer evenly among the PPP channels that are connected to a certain PPP unit to make up a bundle, if we are transmitting using an upper layer protocol that requires an Ack before sending the next packet (like TCP/IP for example), we will have a bandwidth bottleneck on the slowest channel of the bundle. Let's clarify by an example. Let's consider a scenario where we have two PPP links making up a bundle: a slow link (10KB/sec) and a fast link (1000KB/sec) working at the best (full bandwidth). On the top we have a TCP/IP stack sending a 1000 Bytes sk_buff buffer down to the PPP subsystem. The "ppp_mp_explode" function will divide the buffer in two fragments of 500B each (we are neglecting all the headers, crc, flags etc?.). Before the TCP/IP stack sends out the next buffer, it will have to wait for the ACK response from the remote peer, so it will have to wait for both fragments to have been sent over the two PPP links, received by the remote peer and reconstructed. The resulting behaviour is that, rather than having a bundle working @1010KB/sec (the sum of the channels bandwidths), we'll have a bundle working @20KB/sec (the double of the slowest channels bandwidth). Problem Solution: The problem has been solved by redesigning the "ppp_mp_explode" function in such a way to make it split the sk_buff buffer according to the speeds of the underlying PPP channels (the speeds of the serial interfaces respectively attached to the PPP channels). Referring to the above example, the redesigned "ppp_mp_explode" function will now divide the 1000 Bytes buffer into two fragments whose sizes are set according to the speeds of the channels where they are going to be sent on (e.g . 10 Byets on 10KB/sec channel and 990 Bytes on 1000KB/sec channel). The reworked function grants the same performances of the original one in optimal working conditions (i.e. a bundle made up of PPP links all working at the same speed), while greatly improving performances on the bundles made up of channels working at different speeds. Signed-off-by: Gabriele Paoloni <gabriele.paoloni@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ppp_synctty.c')
-rw-r--r--drivers/net/ppp_synctty.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/ppp_synctty.c b/drivers/net/ppp_synctty.c
index 3ea791d16b00..d2fa2db13586 100644
--- a/drivers/net/ppp_synctty.c
+++ b/drivers/net/ppp_synctty.c
@@ -206,6 +206,7 @@ ppp_sync_open(struct tty_struct *tty)
206{ 206{
207 struct syncppp *ap; 207 struct syncppp *ap;
208 int err; 208 int err;
209 int speed;
209 210
210 if (tty->ops->write == NULL) 211 if (tty->ops->write == NULL)
211 return -EOPNOTSUPP; 212 return -EOPNOTSUPP;
@@ -234,6 +235,8 @@ ppp_sync_open(struct tty_struct *tty)
234 ap->chan.ops = &sync_ops; 235 ap->chan.ops = &sync_ops;
235 ap->chan.mtu = PPP_MRU; 236 ap->chan.mtu = PPP_MRU;
236 ap->chan.hdrlen = 2; /* for A/C bytes */ 237 ap->chan.hdrlen = 2; /* for A/C bytes */
238 speed = tty_get_baud_rate(tty);
239 ap->chan.speed = speed;
237 err = ppp_register_channel(&ap->chan); 240 err = ppp_register_channel(&ap->chan);
238 if (err) 241 if (err)
239 goto out_free; 242 goto out_free;