Subject: network receive performance improvement (#131) Index: pdpif/if_uba.c 2.11BSD Description: The receive routine 'if_rubaget' does not allocate a large mbuf when possible. Repeat-By: Examination. Note that the 3com driver (if_ec.c) does not call if_rubaget and implements its own "cluster" (large) mbuf allocation logic. Fix: Apply the following patch. Using a DEQNA on a 11/73 this patch improved the 'ftp' performance by 12% when transferring a file to the 11/73. A couple of register variable assignments were changed (there was an unused register variable in one function) to improve the code generated. ===========================cut here================================= *** /sys/pdpif/if_uba.c.old Sun Jan 3 00:52:53 1993 --- /sys/pdpif/if_uba.c Sat Apr 3 21:13:32 1993 *************** *** 3,9 **** * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * ! * @(#)if_uba.c 1.1 (2.10BSD Berkeley) 12/1/86 * * 2.11BSD - uballoc and ubmalloc calling conventions changed. * ubmalloc now only performs address computation, the --- 3,9 ---- * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * ! * @(#)if_uba.c 1.2 (2.11BSD GTE) 4/3/93 * * 2.11BSD - uballoc and ubmalloc calling conventions changed. * ubmalloc now only performs address computation, the *************** *** 85,90 **** --- 85,99 ---- cp = (caddr_t) (ifu->ifu_hlen + off); } else len = totlen; + if (len >= NBPG) { + if (ifp) + goto nopage; + MCLGET(m); + if (m->m_len != CLBYTES) + goto nopage; + m->m_len = MIN(len, CLBYTES); + goto copy; + } nopage: m->m_off = MMINOFF; if (ifp) { *************** *** 132,142 **** * header. */ if_wubaput(ifu, m) ! register struct ifuba *ifu; register struct mbuf *m; { register struct mbuf *mp; ! u_short off = 0; u_short click = ifu->ifu_w.ifrw_click; while (m) { --- 141,151 ---- * header. */ if_wubaput(ifu, m) ! struct ifuba *ifu; register struct mbuf *m; { register struct mbuf *mp; ! register u_short off = 0; u_short click = ifu->ifu_w.ifrw_click; while (m) { *************** *** 162,168 **** caddr_t addr; u_int size; { ! register int nregs, s; register struct ubmap *ubp; ubadr_t paddr, vaddr; u_int click, first; --- 171,177 ---- caddr_t addr; u_int size; { ! register int nregs; register struct ubmap *ubp; ubadr_t paddr, vaddr; u_int click, first; *************** *** 206,212 **** */ ubadr_t ubmalloc(addr) ! register memaddr addr; /* pdp11 "clicks" */ { extern ubadr_t mioumr; extern memaddr miostart; --- 215,221 ---- */ ubadr_t ubmalloc(addr) ! memaddr addr; /* pdp11 "clicks" */ { extern ubadr_t mioumr; extern memaddr miostart;