netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Patch] fix packet loss and massive ping spikes with PPP multi-link
@ 2010-03-26 15:50 Richard Hartmann
  2010-03-26 16:02 ` Alan Cox
                   ` (2 more replies)
  0 siblings, 3 replies; 31+ messages in thread
From: Richard Hartmann @ 2010-03-26 15:50 UTC (permalink / raw)
  To: linux-kernel, netdev, linux-ppp

Hi all,

as you may be aware, it is recommended to switch of fragmentation when
doing PPP multi-link. Problems which will be seen if you don't do that
involve packet loss and massive spikes in the round-trip times.
An increase of 1.5 seconds(!) is what we usually see.

Every Cisco CPE offers to switch off fragmentation for multi-link, other
manufacturers are likely to offer it, as well.
We implemented a really ugly hack which allows us to do the same with
the Linux kernel. I can confirm that it gets rid of the problem 100%
of the time.

We are fully aware that this code is not nearly up for inclusion into
the kernel. What we hope to achieve is that someone with the skills to
do this properly will introduce an option to turn off fragmentation on
PPP multi-link or to just do away with it completely.

Some stats for a run of 4 hours each:

No patch:
    129 lost fragments, 575803 reordered
    127/3960 discarded fragments/bytes, 0 lost received

Patch:
    0 lost fragments, 0 reordered
    0/0 discarded fragments/bytes, 0 lost received

Unfortunately, I don't have paste-able stats for ping times available,
at the moment.


Any and all feedback on this is appreciated,
Richard

PS: Our image which is deployed in the field is using 2.6.32 which is
why we were forced to develop for and test with 2.6.32 instead of
linux-next; sorry for that.


--- /usr/src/linux-2.6.32.3/drivers/net/ppp_generic.c.orig	2010-03-25
16:56:05.000000000 +0100
+++ /usr/src/linux-2.6.32.3/drivers/net/ppp_generic.c	2010-03-26
14:42:42.000000000 +0100
@@ -123,6 +123,7 @@
 	struct net_device *dev;		/* network interface device a4 */
 	int		closing;	/* is device closing down? a8 */
 #ifdef CONFIG_PPP_MULTILINK
+	int		rrsched;	/* round robin scheduler for packet distribution */
 	int		nxchan;		/* next channel to send something on */
 	u32		nxseq;		/* next sequence number to send */
 	int		mrru;		/* MP: max reconst. receive unit */
@@ -1261,6 +1262,7 @@
 	struct list_head *list;
 	struct channel *pch;
 	struct sk_buff *skb = ppp->xmit_pending;
+	int i;

 	if (!skb)
 		return;
@@ -1292,10 +1294,40 @@
 	}

 #ifdef CONFIG_PPP_MULTILINK
-	/* Multilink: fragment the packet over as many links
-	   as can take the packet at the moment. */
-	if (!ppp_mp_explode(ppp, skb))
-		return;
+	ppp->rrsched++;
+//    printk(KERN_ERR "ppp: multi new packet, rrsched = %d\n", ppp->rrsched);
+
+	i = 0;
+	list_for_each_entry(pch, &ppp->channels, clist)      {
+//    	printk(KERN_ERR "ppp: channel %d ... \n", i);
+		if(pch->chan == NULL) continue;
+
+		if (ppp->rrsched % ppp->n_channels == i) {
+//    		printk(KERN_ERR "use channel %d\n", i);
+			spin_lock_bh(&pch->downl);
+			if (pch->chan) {
+//				++ppp->nxseq;
+				if (pch->chan->ops->start_xmit(pch->chan, skb)) {
+					ppp->xmit_pending = NULL;
+				}
+			} else {
+				/* channel got unregistered */
+				kfree_skb(skb);
+				ppp->xmit_pending = NULL;
+			}
+			spin_unlock_bh(&pch->downl);
+			return;
+		}
+		i++;
+	}
+//	printk(KERN_ERR "keep in queue\n");
+	return;
+
+
+//	/* Multilink: fragment the packet over as many links
+//	   as can take the packet at the moment. */
+//	if (!ppp_mp_explode(ppp, skb))
+//		return;
 #endif /* CONFIG_PPP_MULTILINK */

 	ppp->xmit_pending = NULL;

^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2010-11-15 12:12 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-26 15:50 [Patch] fix packet loss and massive ping spikes with PPP multi-link Richard Hartmann
2010-03-26 16:02 ` Alan Cox
2010-03-26 16:33   ` Joe Perches
2010-03-26 16:39   ` Richard Hartmann
2010-03-26 16:59     ` David Miller
2010-03-26 17:04       ` David Miller
2010-03-26 17:04     ` James Carlson
2010-03-26 17:00   ` Alexander E. Patrakov
2010-03-26 17:04     ` Alan Cox
2010-03-31 10:03       ` Ben McKeegan
2010-05-29  2:16         ` Paul Mackerras
2010-05-29  9:06           ` Richard Hartmann
2010-05-31 13:39           ` Richard Hartmann
2010-05-31 16:20           ` Ben McKeegan
2010-06-02 14:55             ` Ben McKeegan
2010-06-02 15:04               ` [PATCH] ppp_generic: fix multilink fragment sizes Ben McKeegan
2010-06-02 15:17                 ` Paoloni, Gabriele
2010-06-02 15:31                   ` David Miller
2010-06-02 15:55                   ` Ben McKeegan
2010-06-03  8:41                     ` Paoloni, Gabriele
2010-06-03  9:14                       ` Ben McKeegan
2010-11-08 14:05               ` [Patch] fix packet loss and massive ping spikes with PPP multi-link Richard Hartmann
2010-11-15 12:07                 ` Richard Hartmann
2010-06-01 10:20           ` Richard Hartmann
2010-06-01 11:18             ` Ben McKeegan
2010-06-01 11:28               ` Richard Hartmann
2010-06-01 22:15                 ` David Miller
2010-03-31  9:01 ` Richard Hartmann
2010-05-25  9:52 ` Richard Hartmann
     [not found]   ` <4BFBA3F2.2000301@bfs.de>
     [not found]     ` <AANLkTilnueP5HIfX03soMCYE93jubL000rpiOCN1xB2-@mail.gmail.com>
     [not found]       ` <4BFC0942.2030103@bfs.de>
2010-05-26  8:47         ` Richard Hartmann
2010-05-28  7:28           ` walter harms

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).