diff options
| author | masputra <none@none> | 2005-10-22 22:50:14 -0700 |
|---|---|---|
| committer | masputra <none@none> | 2005-10-22 22:50:14 -0700 |
| commit | ff550d0e264b51131fb34e9e83163b348d916640 (patch) | |
| tree | 5cfa61832db382b34b7090acd22cfed2bed7cf82 /usr/src/uts/common/os/streamio.c | |
| parent | d56104979b99dfd4b6bb1294d1c318fbd990903a (diff) | |
| download | illumos-joyent-ff550d0e264b51131fb34e9e83163b348d916640.tar.gz | |
PSARC 2005/082 Yosemite: UDP Performance Enhancement
4796051 Solaris needs a more complete HW checksumming support
4905227 duplicate macros in ipclassifier.h and ip.h
4915681 need hardware checksum offload for the case of IP/UDP reassembly
6201076 outbound flow-control dysfunctional, ip to ce using mdt
6223331 ipv6 flow control may corrupt UDP packets
6223809 16-bit aligned IP header should be allowed for all x86 platforms
6275398 Galaxy hangs when running lmbench
6281836 Yosemite project integration into Solaris
6281885 xge needs to support IPv6 checksum offload
6282776 IPv6 NCE fast path is not created for incoming solicitation
6304890 IP transmit-side checksum logic needs to be tightened
6304902 IP6_IN_NOCKSUM is obsolete and should be torched
6304904 UDP should reject TI_GETPEERNAME for non-connected endpoint
6306768 IP and UDP device and module definitions need to be centralized
Diffstat (limited to 'usr/src/uts/common/os/streamio.c')
| -rw-r--r-- | usr/src/uts/common/os/streamio.c | 84 |
1 files changed, 9 insertions, 75 deletions
diff --git a/usr/src/uts/common/os/streamio.c b/usr/src/uts/common/os/streamio.c index e28d9e2fe0..0b0ac98ca4 100644 --- a/usr/src/uts/common/os/streamio.c +++ b/usr/src/uts/common/os/streamio.c @@ -2642,11 +2642,18 @@ strput(struct stdata *stp, mblk_t *mctl, struct uio *uiop, ssize_t *iosize, int strwrite(struct vnode *vp, struct uio *uiop, cred_t *crp) { + return (strwrite_common(vp, uiop, crp, 0)); +} + +/* ARGSUSED2 */ +int +strwrite_common(struct vnode *vp, struct uio *uiop, cred_t *crp, int wflag) +{ struct stdata *stp; struct queue *wqp; ssize_t rmin, rmax; ssize_t iosize; - char waitflag; + int waitflag; int tempmode; int error = 0; int b_flag; @@ -2701,7 +2708,7 @@ strwrite(struct vnode *vp, struct uio *uiop, cred_t *crp) /* * Do until count satisfied or error. */ - waitflag = WRITEWAIT; + waitflag = WRITEWAIT | wflag; if (stp->sd_flag & OLDNDELAY) tempmode = uiop->uio_fmode & ~FNDELAY; else @@ -2803,79 +2810,6 @@ out: } /* - * kstrwritemp() has very similar semantics as that of strwrite(). - * The main difference is it obtains mblks from the caller and also - * does not do any copy as done in strwrite() from user buffers to - * kernel buffers. - * - * - * Currently, this routine is used by sendfile to send data allocated - * within the kernel without any copying. This interface does not use the - * synchronous stream interface as synch. stream interface implies - * copying. - */ -int -kstrwritemp(struct vnode *vp, mblk_t *mp, ushort_t fmode) -{ - struct stdata *stp; - struct queue *wqp; - char waitflag; - int tempmode; - int error; - int done = 0; - - ASSERT(vp->v_stream); - stp = vp->v_stream; - - if (stp->sd_flag & (STWRERR|STRHUP|STPLEX)) { - mutex_enter(&stp->sd_lock); - error = strwriteable(stp, B_FALSE, B_TRUE); - mutex_exit(&stp->sd_lock); - if (error != 0) - return (error); - } - - /* - * First, check for flow control without grabbing the sd_lock. - * If we would block, re-check with the lock. This is similar - * to the logic used by strwrite(). - */ - wqp = stp->sd_wrq; - if (canputnext(wqp)) { - putnext(wqp, mp); - return (0); - } - - waitflag = WRITEWAIT; - if (stp->sd_flag & OLDNDELAY) - tempmode = fmode & ~FNDELAY; - else - tempmode = fmode; - - mutex_enter(&stp->sd_lock); - do { - if (canputnext(wqp)) { - mutex_exit(&stp->sd_lock); - putnext(wqp, mp); - return (0); - } - error = strwaitq(stp, waitflag, (ssize_t)0, tempmode, -1, - &done); - } while (error == 0 && !done); - - mutex_exit(&stp->sd_lock); - /* - * EAGAIN tells the application to try again. ENOMEM - * is returned only if the memory allocation size - * exceeds the physical limits of the system. ENOMEM - * can't be true here. - */ - if (error == ENOMEM) - error = EAGAIN; - return (error); -} - -/* * Stream head write service routine. * Its job is to wake up any sleeping writers when a queue * downstream needs data (part of the flow control in putq and getq). |
