8139too packet sending routines - need explanation

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

 



Hello,

It concerns packet sending routines in 8139too.c driver (kernel:2.4.20).

I am trying to find what happens exactly AFTER rtl8139_start_xmit() is
called, when the packet is being forwarded through linux router. Which
routine is called right after rtl8139_start_xmit() ( is this
rtl8139_tx_interrupt ?) ?? I would like to know exact code path of packet
going out of router interface, if possible ;) .

Underneath there is snippet of code taken from
http://lxr.linux.no/source/drivers/net/8139too.c.

[...] - means that this part of code is cut for sake of clarity

static int rtl8139_start_xmit (struct sk_buff *skb, struct net_device *dev)
{
	[...]

        if (likely(len < TX_BUF_SIZE)) {
                 skb_copy_and_csum_dev(skb, tp->tx_buf[entry]);   <<-- what
exactly happens here ??
							        // is the packet data being copied to kernel memory buffer?
							        // what happens with packet data afterwards...???
                 dev_kfree_skb(skb);
         } else {
                 dev_kfree_skb(skb);
                 tp->stats.tx_dropped++;
                 return 0;
         }
	[...]
}

What happens after skb_copy_and_csum_dev(skb, tp->tx_buf[entry]); and before
tx_interrupt() being called ????

And what happens with packet data DURING tx_interrupt() execution? Is this
being copied from kernel memory buffer into NIC memory? or is this
transmitted into the network, so when tx_interrupt finishes the packet is
already gone from the interface???
How the packet data are kept inside NIC: is there a small memory buffer or
so?


while (tx_left > 0) {
                 int entry = dirty_tx % NUM_TX_DESC;
                 int txstatus;

                 txstatus = RTL_R32 (TxStatus0 + (entry * sizeof (u32)));

	[...]

                 } else {
                         if (txstatus & TxUnderrun) {
			[...]
                         }
                         tp->stats.collisions += (txstatus >> 24) & 15;
                         tp->stats.tx_bytes += txstatus & 0x7ff;
                         tp->stats.tx_packets++;
// <- ONE packet has been actually sent, right?
								   // how many packet can be stored inside NIC simultaneously
                 }

                 dirty_tx++;
                 tx_left--;
 }


I will be grateful for the explanation of this questions!!

regards

Adam F.

-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux