MHonArc test archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: using linux at atm/ethernet gateway ... problems

> I have a PPro200 (RH4.2) with a 2.0.29 kernel and the linux atm-0.31
> code. It has a eepro100 card and a fore sba200e card driven by the
> 0.2 version driver module. The sba200e is hooked up to a fore asx200 and
> the linux box is using the led zepplelin LANE client to fore LANE services.
> Im trying to use this box as a ethernet/LANE gateway.

This is one of the known bugs in the pca200e module version 0.2.

	Packets from ethernet are 4 byte aligned in memory when as arrive.
	Ethernet encapsulation uses a different header size than that of
	Classical IP or LANE -> the PDU to send is not 4 bytes aligned.

	The pca200e module version 0.2 doesn't test for unaligned PDUs. The
	address of a PDU is written into the card. The card ignores the lower
	two bits of the address -> additional bytes at the start, missing
	bytes at the end.


	1. Add a new member txbuff to the end of the qhost_tx struct in

		  void*     txbuff; /* used in case of misaligned data      */

	2. Add code to pca200e_send() to detect unaligned PDUs obtain a
	   temporary (4 byte aligned) buffer and copy the PDU into the buffer.
	   Write the buffer's address into the card.

	   instead of:

		  tpd->segment[0].buffer = skb->data;

	   it might look like this:

		  if (!(((unsigned long)(skb->data)) & 0x00000003))
		    tpd->segment[0].buffer = skb->data;
		      DPRINTK("pca200e_send: misaligned data detected.\n");
		      txq->txbuff = kmalloc(skb->len, GFP_ATOMIC);
		      if (!(txq->txbuff))
		          return -ENOMEM;
		      memcpy(txq->txbuff, skb->data, skb->len);
		      tpd->segment[0].buffer = txq->txbuff;

	3. Add code to pca200e_inttx() to detect unaligned PDUs and free the
	   temporary buffer.

	      for (i=0; i<QSIZE_TX; i++)
		  if (txq->status[0] & stat_complete)
	+	      if (((unsigned long) txq->skb->data) & 0x00000003)
	+		kfree(txq->txbuff);
		      txq->vcc->pop(txq->vcc, txq->skb);

	The procedure described above may result in poor performance as all
	data to be forwarded must be copied first.

	This will be fixed in pca200e module version 0.3 .
	I hope to get it ready in early January.


Uwe Dannowski, student, Dresden University of Technology, Dept. of CS, OS group
email:  WWW:
tel: +49-351-2848091/+49-172-3736772 addr: Gamigstr. 20, 01239 Dresden, Germany

Home | Main Index | Thread Index