🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.bugs.2bsd
Article #48

Network Device Interrupts Not Counted

#48
From: Steven M. Schultz
Date: Wed, 17 Jan 1990 07:05
52 lines
2427 bytes
Subject: Network Device Interrupts Not Counted
Index:	sys/pdp/net_trap.s 2.10BSD

Description:
	Interrupts from network interfaces are not counted if metering
	(UCB_METER) is selected at system configuration time.

Repeat-By:
	Either by examination of the code, or by performing an rlogin
	to/from a 2.10.XBSD system and running 'vmstat' on another terminal.

Fix:
	Since the interrupt count is in kernel space, the count must
	be retrieved via "mfpd" and put back with "mtpd".  By performing
	the increment after the PSW has been loaded with 040340 the overhead
	of counting interrupts is reduced to only two instructions.

	Apply the following patch to /sys/pdp/net_trap.s and if UCB_METER
	is being used, recompile the kernel and networking.

*** net_trap.s.old	Tue Jul  5 14:20:04 1988
--- net_trap.s	Tue Jan 16 21:05:51 1990
***************
*** 33,42 ****
  	 * from kernel mode to the PS, PC pair we push on the kernel stack.
  	 *
  	 * Transfer our saved <PS, PC> pair to the kernel stack.  The spl7
! 	 * below is pure paranoia.
  	 */
  	mov	PS,-(sp)
  	mov	$40340,PS		/ current mode SUPV, prev KERN, BR7
  	mfpd	sp			/ old kernel stack pointer
  	mov	(sp),r1
  	sub	$4,(sp)			/ grow the kernel stack
--- 33,49 ----
  	 * from kernel mode to the PS, PC pair we push on the kernel stack.
  	 *
  	 * Transfer our saved <PS, PC> pair to the kernel stack.  The spl7
! 	 * below is pure paranoia, BUT while we're at it let's bump the
! 	 * interrupt count - it's a mere two instructions of overhead (the
! 	 * increment would have been done anyhow)!
  	 */
  	mov	PS,-(sp)
  	mov	$40340,PS		/ current mode SUPV, prev KERN, BR7
+ #ifdef	UCB_METER
+ 	mfpd	*$_cnt+V_INTR		/ fetch interrupt count
+ 	inc	(sp)			/ bump it
+ 	mtpd	*$_cnt+V_INTR		/ put it back
+ #endif
  	mfpd	sp			/ old kernel stack pointer
  	mov	(sp),r1
  	sub	$4,(sp)			/ grow the kernel stack
Technical Details
Message-ID: <44170@wlbr.IMSD.CONTEL.COM>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!brutus.cs.uiuc.edu!apple!ames!elroy.jpl.nasa.gov!mahendo!wlbr!wlv!sms

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!brutus.cs.uiuc.edu!apple!ames!elroy.jpl.nasa.gov!mahendo!wlbr!wlv!sms
From: sms@wlv.imsd.contel.com (Steven M. Schultz)
Newsgroups: comp.bugs.2bsd
Subject: Network Device Interrupts Not Counted
Message-ID: <44170@wlbr.IMSD.CONTEL.COM>
Date: 17 Jan 90 07:05:38 GMT
Sender: news@wlbr.IMSD.CONTEL.COM
Reply-To: sms@wlv.imsd.contel.com (Steven M. Schultz)
Organization: Contel Federal Systems
Lines: 52