[Asterisk-Users] Multiple E1s over TDMoE?

Nicolas Bougues nbougues-listes at axialys.net
Sat Jul 10 16:01:02 MST 2004


On Sat, Jul 03, 2004 at 07:44:54PM +0200, Thilo Salmon wrote:
>
> How would you go about running, 8 or 16 say, E1s over TDMoE? Would you
> create multiple dynamic spans or just one large one? How would you
> assign d channels to spans, if you had just one large span?
> 
> Did any of you guys try this before?
> 

Somewhat, yes.

I run 4 TDMoE E1s between pairs of servers (4 E1s between each of
them).

What I think about that :
- it works
- TDMoE doesn't like SMP. It doesn't like running on a NIC used for
  other kind of traffic. It will crash your box under heavy (non
  TDMoE) load. I believe that there must be some race condition
  related to dev_queue_xmit(), which is probably not callable at
  anytime.
- the subaddr support is not complete in the released driver. Here is
  a patch that will handle it (as described in zaptel.conf)
- it is not 100% reliable. You will get frame drops, and you will
  notice it if you look at your D-channel dumps.
- use high quality NICs and switches.

-- 
Nicolas Bougues
Axialys Interactive
-------------- next part --------------
--- ztd-eth.c.old	2004-02-01 06:53:58.000000000 +0100
+++ ztd-eth.c	2004-07-11 00:51:45.000000000 +0200
@@ -251,7 +251,7 @@
 {
 	struct ztdeth *z;
 	char src[256];
-	char tmp[256], *tmp2, *tmp3;
+	char tmp[256], *tmp2, *tmp3, *tmp4 = NULL;
 	int res,x;
 	unsigned long flags;
 
@@ -273,6 +273,7 @@
 			return NULL;
 		}
 		if (tmp2) {
+			tmp4 = strchr(tmp2+1, '/') +1;
 			/* We don't have SSCANF :(  Gotta do this the hard way */
 			tmp3 = strchr(tmp2, ':');
 			for (x=0;x<6;x++) {
@@ -288,7 +289,8 @@
 				} else
 					break;
 				if ((tmp2 = tmp3))
-					tmp3 = strchr(tmp2, ':');
+					if (!(tmp3 = strchr (tmp2, ':')))
+						tmp3 = strchr (tmp2, '/');
 			}
 			if (x != 6) {
 				printk("TDMoE: Invalid MAC address in: %s\n", addr);
@@ -300,6 +302,25 @@
 			kfree(z);
 			return NULL;
 		}
+		if (tmp4) {
+			int sub = 0;
+			int mul = 1;
+
+			// We have a subaddr
+			tmp3 = tmp4 + strlen (tmp4) - 1;
+			while (tmp3 >= tmp4) {
+				if (*tmp3 >= '0' && *tmp3 <= '9') {
+					sub += (*tmp3 - '0') * mul;
+				} else {
+					printk("TDMoE: Invalid subaddress\n");
+					kfree(z);
+					return NULL;
+				}
+				mul *= 10;
+				tmp3--;
+			}
+			z->subaddr = htons(sub);
+		}
 		z->dev = dev_get_by_name(z->ethdev);
 		if (!z->dev) {
 			printk("TDMoE: Invalid device '%s'\n", z->ethdev);
@@ -311,7 +332,7 @@
 		for (x=0;x<5;x++)
 			sprintf(src + strlen(src), "%02x:", z->dev->dev_addr[x]);
 		sprintf(src + strlen(src), "%02x", z->dev->dev_addr[5]);
-		printk("TDMoE: Added new interface for %s at %s (addr=%s, src=%s)\n", span->name, z->dev->name, addr, src);
+		printk("TDMoE: Added new interface for %s at %s (addr=%s, src=%s, subaddr(net byte order)=%d)\n", span->name, z->dev->name, addr, src, z->subaddr);
 			
 		spin_lock_irqsave(&zlock, flags);
 		z->next = zdevs;
@@ -350,3 +371,6 @@
 
 module_init(ztdeth_init);
 module_exit(ztdeth_exit);


More information about the asterisk-users mailing list