From owner-freebsd-net@FreeBSD.ORG Tue Jun 27 02:11:19 2006 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C1F5216A401 for ; Tue, 27 Jun 2006 02:11:19 +0000 (UTC) (envelope-from haisang@gmail.com) Received: from nz-out-0102.google.com (nz-out-0102.google.com [64.233.162.203]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0B06A43D55 for ; Tue, 27 Jun 2006 02:11:09 +0000 (GMT) (envelope-from haisang@gmail.com) Received: by nz-out-0102.google.com with SMTP id 16so1274489nzp for ; Mon, 26 Jun 2006 19:11:09 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type; b=WiIQUT2um2w43ZLE2kmN+DW7y7KMHCyOh4hIvb2pi9RLXxPOJakwPP1Y5ECH6JtzbUDxZK5TbD/BlabkHgXjiEs8yDC2AVhl/XQPrS54atM+rvvN0pGVuYWgp25aMC+nOHYY2to7b21WTaHsE2ACRBmrdMM0pyzKtKr8STmuNDk= Received: by 10.36.250.62 with SMTP id x62mr3641866nzh; Mon, 26 Jun 2006 19:11:09 -0700 (PDT) Received: by 10.37.15.29 with HTTP; Mon, 26 Jun 2006 19:11:09 -0700 (PDT) Message-ID: Date: Mon, 26 Jun 2006 19:11:09 -0700 From: "Haisang Wu" To: freebsd-net@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: mbufs in tcp_output and tcp_input X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Jun 2006 02:11:19 -0000 Hello, I need to read m_flags of a mbuf in an TCP application in the following two cases: (1) in sending direction, right before TCP calls ip_output() to send out a packet, (2) in receiving direction, right before TCP appends a packet to so_rcv of the corresponding socket and wakes up the socket. My understandings are: for (1), tcp_output() only calls ip_output() once, so right before that function call, I should read the m_flags. For (2), tcp_input() is more complex and calls insbappendstream_locked() twice, one for fast path processing, and one for slow path processing. I think I should read m_flags before both of the two insbappendstream_locked() function calls. I am using freebsd 5.4. Could you let me know whether my above understandings are correct, and provide some suggestions? Thank you! Haisang