RE: rx interrupt boundaries (2.4.20 - 8139too.c)

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

 



> -----Original Message-----
> From: Adam Flizikowski [mailto:adam_fli@poczta.onet.pl] 
> 
> I would like to know, where exactly NIC interrupt 
> starts/ends.

(Somebody correct me if I describe any of this wrong.)

Exactness is difficult to attain.  Do you want to know (a) when the NIC
raises the interrupt, (b) when the kernel detects it, or (c) when the
driver's handler begins?  (Or something else?)  For (a) you must examine the
NIC from outside the CPU, because if IRQs are masked, or if the IRQ is
shared by another device, you can not tell from the inside "exactly" when
the NIC raised the interrupt.  For (b) you must enter the bowels of the
kernel, as it may decide to defer the handling of the request until after a
different handler has been called (one of higher priority, or one sharing
this IRQ) or to mitigate the effects of too-frequent interrupts.  Case (c)
is the easiest to measure.  It starts when the kernel calls the interrupt
handler and ends when the handler returns.

The spin locks prevent a program running on another CPU from accessing
shared data while the interrupt handler is executing them on this CPU.  Spin
locks do nothing on single-processor systems because a single CPU can not
execute in interrupt and non-interrupt context at the same time.

Have you read this book?
http://www.xml.com/ldd/chapter/book/index.html
Chapters 9 and 14 are very helpful.

> there is part of (2.4.20) 8139too.c code that handles 
> interrupts rx/tx.
> 
> I don't know if:
> 
>  line numbers 2044/2098 (spin_lock()/spin_unlock) are the interrupt
> start/end boundaries
> 
> ... or let say in rx case only:
> 
>  line 2073 (rx_interrupt())
> 
> 
> *******************************
> * 8139too.c: rtl8139_interrupt(), code snippet
> *
> *******************************
> 2032 /* The interrupt handler does all of the Rx thread work 
> and cleans up
> 2033    after the Tx thread. */
> 2034 static void rtl8139_interrupt (int irq, void *dev_instance,
> 2035                                struct pt_regs *regs)
> 2036 {
> ...
> 2043
> 2044         spin_lock (&tp->lock);
> 2045
> 2046         do {
> 
> ...
> 
> 2073                         rtl8139_rx_interrupt (dev, tp, ioaddr);
> 
> ..
> 
> 2082                         rtl8139_tx_interrupt (dev, tp, ioaddr);
> 
> ...
> 
> 2087                 boguscnt--;
> 2088         } while (boguscnt > 0);
> 
> ...
> 
> 2098         spin_unlock (&tp->lock);
> 
> 
> thanks for any help in advance
> 
> regards
> 
> adam
> 
> -
> : 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
> 
-
: 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