From owner-freebsd-hackers@FreeBSD.ORG Fri Jul 1 17:06:02 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 23BF616A41C for ; Fri, 1 Jul 2005 17:06:02 +0000 (GMT) (envelope-from sam@errno.com) Received: from ebb.errno.com (ebb.errno.com [66.127.85.87]) by mx1.FreeBSD.org (Postfix) with ESMTP id E816943D1F for ; Fri, 1 Jul 2005 17:05:59 +0000 (GMT) (envelope-from sam@errno.com) Received: from [66.127.85.94] ([66.127.85.94]) (authenticated bits=0) by ebb.errno.com (8.12.9/8.12.6) with ESMTP id j61H5ums012185 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 1 Jul 2005 10:05:59 -0700 (PDT) (envelope-from sam@errno.com) Message-ID: <42C5780C.5050706@errno.com> Date: Fri, 01 Jul 2005 10:06:20 -0700 From: Sam Leffler Organization: Errno Consulting User-Agent: Mozilla Thunderbird 1.0.2 (Macintosh/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Sam Pierson References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: FreeBSD Hackers Subject: Re: Accurate/Fine-grained timing of latency in atheros drivers X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Jul 2005 17:06:02 -0000 Sam Pierson wrote: > Hey guys, > > In a current project, I need to find out exactly how long it takes to send > a 802.11 packet and how much time is spent in the following stages: > > send time - time spent constructing message, including context switches > and other delays and the time it takes to transfer the message to the > network card. You didn't provide enough info to really answer this but it sounds like it's time spent prior to handing the packet to the h/w in which case you need to augment the existing code. Atheros h/w uses dma so "time it takes to transfer the message to the network card" is kinda nebulous. If you want to know when the h/w starts dma then you can mark a tx descriptor to get an interrupt when it's processed but unless you poll the tx dma registers you cannot tell when dma has started and even then you can only get an approximation. The better thing to do is use a bus analyzer and watch for particular data patterns and/or addresses. > > access time - delay which we experience waiting to access the transmitting > channel. Normally this would include the RTS and CTS queuing signals, > but for this application, I have to disable them. Is it possible that no time > is spent waiting here, if I have disabled the whole CSMA scheme on the > hardware level? Depends. Regardless you'll need to monitor at the h/w level with an analyzer. > > propagation time - how long it takes to get to the receiver, once it has left > our card You must monitor the medium unless sniffing for the ack is good enough. > > receive time - how long it takes for the receiving network card to get the > message and notify the host that it has something to read. You need h/w monitoring. > > Am I going to have to put in hardware interrupts to time these events or > are such tools already available? You need to expose the pci bus and use an analyzer for much of this. Sam