MHonArc test archive

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

Re: problem about pca200e driver




Wang,

Below is a note from Uwe Dannowski about this problem. His fix seemed to work 
for me.

Also note that just yesterday he released a new version of the driver
to work with the 2.1.106 kernels and ATM 0.38. See

http://os.inf.tu-dresden.de/project/atm/ 

E

----
From: ud3@irz301.inf.tu-dresden.de (Uwe Dannowski)
Subject: Re: using linux at atm/ethernet gateway ... problems
To: linux-atm@lrc.di.epfl.ch, pca200e-linux@os.inf.tu-dresden.de
Date: Wed, 17 Dec 1997 22:57:48 +0100 (MET)

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


Explanation:
	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.


Problem:
	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.


Quick-Fix:

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

		  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;
		  else
		    {
		      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.

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



Uwe




Home | Main Index | Thread Index