Skip to contentSkip to conversation

2.4.20-pre8-ac3 - drivers/atm/iphase update

PATCH In review Francois Romieu 1 participant 2 messages Oct 12, 2002 – Oct 13, 2002 ATM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 2.4.20-pre8-ac3 - drivers/atm/iphase update

Greetings,

Content: DMA api update + pci init style + misc fixes. Detail follows.

Tested in 2.4.20-pre1-ac1 with dumb br2684 bridge between two facing 5575 (one on SMP) + multiple short sized ping -f for a total of ~13Mirq. Did something like ~2k insmod/rmmod without noticeable side effect. It's satursday evening anyway; if people don't enjoy their atm experience, the patch is available splitted in three readable parts for easier review at http://www.cogenit.fr//linux/patches/2.4.20-pre8-ac3/.

I'll diff against 2.5.x soon (TM).

- pci_find_device() removal
- unbalanced atm_dev_register() in kmalloc() failure path fixed
- pci_disable_device() added
- device id for revision 9 of chipset
- pci_{alloc/free}_consistent usage
- unaligned address of allocated memory for descriptor wasn't stored (actually aligned part wasn't always freed at removal time)
- some more memory leaks on failure paths/device removal fixed
- ia_free_{rx/tx}() helpers so as to avoid code duplication
- pci_{map/unmap}_single usage;
- extra structure to store the bus address of the trailing cpcs data;
- GFP_KERNEL -> GFP_ATOMIC for kmalloc in ia_enque_rtn_q() as it can be called with spinlock held.

drivers/atm/iphase.h +8 -2
@@ -200,7 +200,13 @@ struct cpcs_trailer 
 	u_short length;  
 	u_int	crc32;  
 };  
-  
+
+struct cpcs_trailer_desc
+{
+	struct cpcs_trailer *cpcs;
+	dma_addr_t dma_addr;
+};
+
 struct ia_vcc 
 { 
 	int rxing;	 
@@ -1017,7 +1023,7 @@ typedef struct iadev_t {  
         struct wait_queue     *close_wait;
         struct wait_queue     *timeout_wait;
 #endif
-	caddr_t *tx_buf;  
+	struct cpcs_trailer_desc *tx_buf;
         u16 num_tx_desc, tx_buf_sz, rate_limit;
         u32 tx_cell_cnt, tx_pkt_cnt;
         u32 MAIN_VC_TABLE_ADDR, EXT_VC_TABLE_ADDR, ABR_SCHED_TABLE_ADDR;
drivers/atm/iphase.c +270 -216

710 lines not on this page · raw message

#1 lore raw

Francois Romieu <[email protected]> :
[iphase update]

The diff of the header file is bOrken. Correct version attached. Online version has been updated.

Merge/diff against against 2.5.x is available in parts and complete at
http://www.cogenit.fr/linux/patches/2.5.42-ac1/

--
Ueimor

drivers/atm/iphase.h +12 -3
@@ -200,7 +200,13 @@ struct cpcs_trailer 
 	u_short length;  
 	u_int	crc32;  
 };  
-  
+
+struct cpcs_trailer_desc
+{
+	struct cpcs_trailer *cpcs;
+	dma_addr_t dma_addr;
+};
+
 struct ia_vcc 
 { 
 	int rxing;	 
@@ -272,6 +278,7 @@ struct ext_vc 
 #define DLE_ENTRIES 256  
 #define DMA_INT_ENABLE 0x0002	/* use for both Tx and Rx */  
 #define TX_DLE_PSI 0x0001  
+#define DLE_TOTAL_SIZE (sizeof(struct dle)*DLE_ENTRIES)
   
 /* Descriptor List Entries (DLE) */  
 struct dle 
@@ -1017,7 +1024,7 @@ typedef struct iadev_t {  
         struct wait_queue     *close_wait;
         struct wait_queue     *timeout_wait;
 #endif
-	caddr_t *tx_buf;  
+	struct cpcs_trailer_desc *tx_buf;
         u16 num_tx_desc, tx_buf_sz, rate_limit;
         u32 tx_cell_cnt, tx_pkt_cnt;
         u32 MAIN_VC_TABLE_ADDR, EXT_VC_TABLE_ADDR, ABR_SCHED_TABLE_ADDR;
@@ -1063,7 +1070,9 @@ typedef struct iadev_t {  
         struct desc_tbl_t *desc_tbl;
         u_short host_tcq_wr;
         struct testTable_t **testTable;
-} IADEV;  
+	dma_addr_t tx_dle_dma;
+	dma_addr_t rx_dle_dma;
+} IADEV;
   
   
 #define INPH_IA_DEV(d) ((IADEV *) (d)->dev_data)  
drivers/atm/iphase.c +268 -214

694 lines not on this page · raw message