Date: Fri, 5 Jul 2013 21:33:33 +0000 (UTC) From: Andre Oppermann <andre@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252843 - stable/9/sys/kern Message-ID: <201307052133.r65LXXfD089926@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: andre Date: Fri Jul 5 21:33:32 2013 New Revision: 252843 URL: http://svnweb.freebsd.org/changeset/base/252843 Log: MFC r241703: Remove double-wrapping of #ifdef ZERO_COPY_SOCKETS within zero copy specialized sosend_copyin() helper function. MFC r241704: Remove unnecessary includes from sosend_copyin() and fix a couple of style issues. Modified: stable/9/sys/kern/uipc_socket.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/uipc_socket.c ============================================================================== --- stable/9/sys/kern/uipc_socket.c Fri Jul 5 21:32:54 2013 (r252842) +++ stable/9/sys/kern/uipc_socket.c Fri Jul 5 21:33:32 2013 (r252843) @@ -893,12 +893,6 @@ struct so_zerocopy_stats{ int found_ifp; }; struct so_zerocopy_stats so_zerocp_stats = {0,0,0}; -#include <netinet/in.h> -#include <net/route.h> -#include <netinet/in_pcb.h> -#include <vm/vm.h> -#include <vm/vm_page.h> -#include <vm/vm_object.h> /* * sosend_copyin() is only used if zero copy sockets are enabled. Otherwise @@ -923,9 +917,7 @@ sosend_copyin(struct uio *uio, struct mb long len; ssize_t resid; int error; -#ifdef ZERO_COPY_SOCKETS int cow_send; -#endif *retmp = top = NULL; mp = ⊤ @@ -933,11 +925,8 @@ sosend_copyin(struct uio *uio, struct mb resid = uio->uio_resid; error = 0; do { -#ifdef ZERO_COPY_SOCKETS cow_send = 0; -#endif /* ZERO_COPY_SOCKETS */ if (resid >= MINCLSIZE) { -#ifdef ZERO_COPY_SOCKETS if (top == NULL) { m = m_gethdr(M_WAITOK, MT_DATA); m->m_pkthdr.len = 0; @@ -945,9 +934,9 @@ sosend_copyin(struct uio *uio, struct mb } else m = m_get(M_WAITOK, MT_DATA); if (so_zero_copy_send && - resid>=PAGE_SIZE && - *space>=PAGE_SIZE && - uio->uio_iov->iov_len>=PAGE_SIZE) { + resid >= PAGE_SIZE && + *space >= PAGE_SIZE && + uio->uio_iov->iov_len >= PAGE_SIZE) { so_zerocp_stats.size_ok++; so_zerocp_stats.align_ok++; cow_send = socow_setup(m, uio); @@ -957,15 +946,6 @@ sosend_copyin(struct uio *uio, struct mb m_clget(m, M_WAITOK); len = min(min(MCLBYTES, resid), *space); } -#else /* ZERO_COPY_SOCKETS */ - if (top == NULL) { - m = m_getcl(M_WAIT, MT_DATA, M_PKTHDR); - m->m_pkthdr.len = 0; - m->m_pkthdr.rcvif = NULL; - } else - m = m_getcl(M_WAIT, MT_DATA, 0); - len = min(min(MCLBYTES, resid), *space); -#endif /* ZERO_COPY_SOCKETS */ } else { if (top == NULL) { m = m_gethdr(M_WAIT, MT_DATA); @@ -990,12 +970,10 @@ sosend_copyin(struct uio *uio, struct mb } *space -= len; -#ifdef ZERO_COPY_SOCKETS if (cow_send) error = 0; else -#endif /* ZERO_COPY_SOCKETS */ - error = uiomove(mtod(m, void *), (int)len, uio); + error = uiomove(mtod(m, void *), (int)len, uio); resid = uio->uio_resid; m->m_len = len; *mp = m; @@ -1013,7 +991,7 @@ out: *retmp = top; return (error); } -#endif /*ZERO_COPY_SOCKETS*/ +#endif /* ZERO_COPY_SOCKETS */ #define SBLOCKWAIT(f) (((f) & MSG_DONTWAIT) ? 0 : SBL_WAIT)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201307052133.r65LXXfD089926>