From owner-p4-projects@FreeBSD.ORG Sat Nov 24 03:18:28 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 0583716A419; Sat, 24 Nov 2007 03:18:28 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2AC716A417 for ; Sat, 24 Nov 2007 03:18:27 +0000 (UTC) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id C207A13C447 for ; Sat, 24 Nov 2007 03:18:27 +0000 (UTC) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id lAO3IR7h067494 for ; Sat, 24 Nov 2007 03:18:27 GMT (envelope-from kmacy@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id lAO3IRJM067491 for perforce@freebsd.org; Sat, 24 Nov 2007 03:18:27 GMT (envelope-from kmacy@freebsd.org) Date: Sat, 24 Nov 2007 03:18:27 GMT Message-Id: <200711240318.lAO3IRJM067491@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to kmacy@freebsd.org using -f From: Kip Macy To: Perforce Change Reviews Cc: Subject: PERFORCE change 129441 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2007 03:18:28 -0000 http://perforce.freebsd.org/chv.cgi?CH=129441 Change 129441 by kmacy@kmacy:storage:toestack on 2007/11/24 03:17:54 make all zero copy check contingent on TF_TOE being set in t_flags Affected files ... .. //depot/projects/toestack/sys/dev/cxgb/ulp/tom/cxgb_cpl_socket.c#4 edit Differences ... ==== //depot/projects/toestack/sys/dev/cxgb/ulp/tom/cxgb_cpl_socket.c#4 (text+ko) ==== @@ -311,11 +311,9 @@ cxgb_sosend(struct socket *so, struct sockaddr *addr, struct uio *uio, struct mbuf *top, struct mbuf *control, int flags, struct thread *td) { - struct toedev *tdev = TOE_DEV(so); - int zcopy_thres = TOM_TUNABLE(tdev, zcopy_sosend_partial_thres); - int zcopy_enabled = TOM_TUNABLE(tdev, zcopy_sosend_enabled); - int rv; struct tcpcb *tp = sototcpcb(so); + struct toedev *tdev; + int zcopy_thres, zcopy_enabled, rv; /* * In order to use DMA direct from userspace the following @@ -329,14 +327,19 @@ * - blocking socket XXX for now * */ - if ((tp->t_flags & TF_TOE) && (uio->uio_resid > zcopy_thres) && - (uio->uio_iovcnt < TMP_IOV_MAX) && ((so->so_state & SS_NBIO) == 0) - && zcopy_enabled) { - rv = t3_sosend(so, uio); - if (rv != EAGAIN) - return (rv); + if (tp->t_flags & TF_TOE) { + tdev = TOE_DEV(so); + zcopy_thres = TOM_TUNABLE(tdev, zcopy_sosend_partial_thres); + zcopy_enabled = TOM_TUNABLE(tdev, zcopy_sosend_enabled); + + if ((uio->uio_resid > zcopy_thres) && + (uio->uio_iovcnt < TMP_IOV_MAX) && ((so->so_state & SS_NBIO) == 0) + && zcopy_enabled) { + rv = t3_sosend(so, uio); + if (rv != EAGAIN) + return (rv); + } } - return pru_sosend(so, addr, uio, top, control, flags, td); } @@ -376,10 +379,8 @@ cxgb_soreceive(struct socket *so, struct sockaddr **psa, struct uio *uio, struct mbuf **mp0, struct mbuf **controlp, int *flagsp) { - struct toedev *tdev = TOE_DEV(so); - int zcopy_thres = TOM_TUNABLE(tdev, ddp_thres); - int zcopy_enabled = TOM_TUNABLE(tdev, ddp); - int rv; + struct toedev *tdev; + int rv, zcopy_thres, zcopy_enabled; struct tcpcb *tp = sototcpcb(so); /* @@ -395,14 +396,19 @@ * - iovcnt is 1 * */ - if ((tp->t_flags & TF_TOE) && (uio->uio_resid > zcopy_thres) && - (uio->uio_iovcnt == 1) && ((so->so_state & SS_NBIO) == 0) - && zcopy_enabled) { - rv = t3_soreceive(so, uio); - if (rv != EAGAIN) - return (rv); + if (tp->t_flags & TF_TOE) { + tdev = TOE_DEV(so); + zcopy_thres = TOM_TUNABLE(tdev, ddp_thres); + zcopy_enabled = TOM_TUNABLE(tdev, ddp); + if ((uio->uio_resid > zcopy_thres) && + (uio->uio_iovcnt == 1) && ((so->so_state & SS_NBIO) == 0) + && zcopy_enabled) { + rv = t3_soreceive(so, uio); + if (rv != EAGAIN) + return (rv); + } } - + return pru_soreceive(so, psa, uio, mp0, controlp, flagsp); }