[realtek] Optimising the rtl8139 driver for low latency!
korahs@vsnl.com
korahs@vsnl.com
Sat, 30 Jun 2001 16:14:22 +0530 (IST)
Hi,
Thanks a lot for that. A lot of my doubts have been cleared up and I feel
more confident now. But there are still a few grey areas which I am sure you
can clarify?
> > How do I discard/pop the top packet in the rx_ring.
>
> Move the ring-write-block pointer "RxBufPtr".
>
I am not sure I follow this. What does RxBufPtr point to? Assuming that it
points to the beginning of the just received packet, would this macro work
pop off that packet.
#define discard_pkt() \
{\
/* Pop top Rx packet. */\
ring_offset = tp->cur_rx % RX_RING_SIZE;\
status = le32_to_cpu(*(u32*)(tp->rx_ring + ring_offset));\
tp->cur_rx += (((status >> 16) + 4 + 3) & ~3);\
}
2. How do I disable the Tx IRQ? Is it ok to do this? What I basically want
is to copy the int handling part to the rlt8129_xmit to eliminate the
overhead of Tx interrupt. Thus the xmit routine can become "blocking until
Tx complete".
3. Will the following two statements suspend and resume the operation of the
NIC?
/*Disable interrupts by clearing the interrupt mask.*/
outw(0x0000, ioaddr + IntrMask);
/* Enable interrupts by setting the interrupt mask.*/
outw(PCIErr|PCSTimeout|RxUnderrun|RxOverflow|RxFIFOOver|TxErr|TxOK|RxErr|RxO
K,ioaddr + IntrMask);
4. I have written a macro to enque a packet for transmission. Could you
check if this is right.
#define tx_enq_pkt(pkt_ptr,pkt_size) \
{\
unsigned long entry;\
entry = tp->cur_tx % TX_RING_SIZE;\
memcpy(&(tp->tx_buf[entry][0]),bus_to_virt ((unsigned
long)pkt_ptr),pkt_size);\
outl(virt_to_bus(tp->tx_buf[entry]), ioaddr + TxAddr0 + entry * 4);\
outl(tp->tx_flag | (pkt_size >= ETH_ZLEN ? pkt_size : ETH_ZLEN), ioaddr +
TxStatus0 + entry * 4);\
}
In case you are wondering, I am trying to get the realtek driver to work
with GAMMA for a cluster we are setting up in our department. These are
early days, but we hope we can show some performance improvement for
parallel programs.
Once again, thanks in advance.
Thommen