From owner-freebsd-net@FreeBSD.ORG Sat Dec 1 22:08:20 2012 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C0AE3DF4 for ; Sat, 1 Dec 2012 22:08:20 +0000 (UTC) (envelope-from ksramanujan@gmail.com) Received: from mail-ob0-f182.google.com (mail-ob0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 6F4F28FC0C for ; Sat, 1 Dec 2012 22:08:20 +0000 (UTC) Received: by mail-ob0-f182.google.com with SMTP id 16so1838862obc.13 for ; Sat, 01 Dec 2012 14:08:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=b7ojTWmfk9nJgQZPk/ZKijPBxx9LHyZxL/sR9J+09Zc=; b=b39IIp9d8nBsmj719bDVHWISrfZwz/yJGia4dsSvI73Ge+I2ih1ethN6SoHnxjF11D 7r0/DlRnzfZ6L9c+mKPZGbLEa69Z3xKNveiArVTItxFuf6LPbTMmO+XZ5YYEKNEYA6bp 184W3BuCopGI8MwJIIbl6+HcBrgXjBLgADO8mKI+5jcRTOpdEALrjrX3X0gvXlCnlThj GAtwUffk7b9lPDjJBbm5JNJUheiXpS+/81qjjLg31VfUYNZ+w0PR2/p8ykRX4hSaa+9D 1V+udEdYMUw2fzrtK+/bW62u2hO66mPv3Bqeh7IeIBAv9KoGZ8p8Ojbls3F4gasAh6/6 NaNg== MIME-Version: 1.0 Received: by 10.60.169.171 with SMTP id af11mr4652747oec.92.1354399699567; Sat, 01 Dec 2012 14:08:19 -0800 (PST) Received: by 10.60.80.104 with HTTP; Sat, 1 Dec 2012 14:08:19 -0800 (PST) In-Reply-To: References: Date: Sat, 1 Dec 2012 17:08:19 -0500 Message-ID: Subject: Re: Ralink RT2860 Driver Code From: Ramanujan Seshadri To: PseudoCylon Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: freebsd-net@freebsd.org X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Dec 2012 22:08:20 -0000 Hello, Thanks for the explanation. In fact when i saw the code i also thought the same, but when i tried to print out the transmitted A-MPDU's i found something different. For example, The Counter AggSize15Count should print the the numbers in the multiples of 15, but sometimes it doesn't. So, my understanding is that, the MPDU's are written into these registers, and then an ampdu is formed only when there are enough number of MPDU;s. For example, AggSize15Count sometimes show the counter as 54, so there would be only (54/15) == 3 ampdu's ( 9 remainder). But, then i am not sure what will happen to the remaining 9 MPDU's. Does the register wait for 6 more MPDU's so that it can aggregate 15 MPDU's to form 1 ampdu or does it write to a different registry like AggSize9Count where these 9 MPDU's can get aggregated to an ampdu. Can you please explain ? -Ram On Thu, Nov 29, 2012 at 3:35 AM, PseudoCylon wrote: > On Wed, Nov 28, 2012 at 9:35 PM, Ramanujan Seshadri > wrote: > > Hello, > > > > Thanks for the reply. I just had one more doubt. > > > > In the counters to update the transmitted A-MPDU counter (Function Name: > > NICUpdateRawCounters), i saw these lines of codes > > > > pRalinkCounters->TransmittedAMPDUCount.u.LowPart += > > TxAggCnt0.field.AggSize1Count; > > pRalinkCounters->TransmittedAMPDUCount.u.LowPart += > > (TxAggCnt0.field.AggSize2Count >> 1); > > pRalinkCounters->TransmittedAMPDUCount.u.LowPart += > > (TxAggCnt0.field.AggSize3Count /3); > > . > > . > > . > > . > > pRalinkCounters->TransmittedAMPDUCount.u.LowPart += > > (TxAggCnt0.field.AggSize15Count/ 15); > > pRalinkCounters->TransmittedAMPDUCount.u.LowPart += > > (TxAggCnt0.field.AggSize16Count >> 4); > > > > Can you please explain the reason why the 'i'th counter is being divided > by > > i, for example .TxAggCnt0.field.AggSize15Count is being divided by 15. > > [NB] For people who haven't seen Ralink's code, the above codes are theirs. > > I guess I didn't explain well. Those counters show number of mpdu > packets, i.e. AggSize15Count == 30 means 30 mpdu or 2 (30/15) ampdu > packets. (Because I don't have any datasheet, that how I interpret > Ralink's code.) > > > > > Also if these were little endian counters then i could not understand the > > reason why the four counters "TxAggCnt0.field.AggSize2Count, > > TxAggCnt0.field.AggSize4Count, TxAggCnt0.field.AggSize8Count > > and TxAggCnt0.field.AggSize16Count " are shifted right by some bits, > which > > means that they are multiplying them (since it is little endian > registers) > > and why they are dividing the others. > > RTMP_IO_READ32() does byte swapping. The values should be saved into > AggSizeNCount with host's byte order. So, right sifting means dividing > regardless of the byte order. > >>1 == /2 > ... > >>4 == /16 > They are playing nice to CPUs, I think. > > > AK > > > > > Thanks for the help. > > > > -ram > > > > > > On Tue, Nov 27, 2012 at 6:07 PM, PseudoCylon > > wrote: > >> > >> On Tue, Nov 27, 2012 at 1:23 PM, Ramanujan Seshadri > >> wrote: > >> > I want to know how many MPDU's are aggregated in each AMPDU > >> > transmission. > >> > >> You could use following statistic counters > >> RT2860_TX_AGG_CNT0 to 7 > >> > >> > https://gitorious.org/run/run/blobs/11n_rc3/dev/usb/wlan/if_runreg.h#line186 > >> Each 32-bit little-endian read-on-clear register contains 2 16-bit > >> counters (total 16 16-bit counters). > >> counter at offset 0x1720 MPDU count 1 > >> counter at offset 0x1722 MPDU count 2 > >> ... > >> counter at offset 0x173c MPDU count 15 > >> counter at offset 0x173e MPDU count >= 16 > >> > >> These regs are identical on RT2800 and RT2700 (pci/usb). > >> > >> Example (see #if 0 part) > >> > https://gitorious.org/run/run/blobs/11n_rc3/dev/usb/wlan/if_run.c#line2493 > >> > >> You can only find out statistical numbers (total Tx counts past X > >> sec). You cannot find out an MPDU count in a particular packet, i.e. > >> an aggregated packet just Tx'd, unless you read the counters on each > >> Tx. > >> > >> > >> AK > >> > >> > > >> > -ram > >> > > >> > > >> > On Tue, Nov 27, 2012 at 2:11 PM, PseudoCylon > > >> > wrote: > >> >> > >> >> > ------------------------------ > >> >> > > >> >> > Message: 12 > >> >> > Date: Tue, 27 Nov 2012 04:33:37 -0500 > >> >> > From: Ramanujan Seshadri > >> >> > To: freebsd-net@freebsd.org > >> >> > Subject: Ralink RT2860 Driver Code > >> >> > Message-ID: > >> >> > > >> >> > C58L7YAp+YGk3PZ2VJG9toaKWcBHHi7xsaxth6-KYf0d6xg@mail.gmail.com> > >> >> > Content-Type: text/plain; charset=ISO-8859-1 > >> >> > > >> >> > Hello, > >> >> > Can i know how to get the MPDU's aggregated in each AMPDU in a > >> >> > ralink > >> >> > driver code for RT2860. I saw the existing counters of ralink and > >> >> > tried > >> >> > to > >> >> > get some info, but was not very useful. > >> >> > Any help is greatly appreciated. > >> >> > > >> >> > >> >> https://gitorious.org/run/run/trees/11n_rc3/dev/usb/wlan > >> >> > >> >> What info are you trying to get? > >> >> > >> >> > >> >> AK > >> >> > >> >> > Thanks > >> >> > ram > >> >> > > >> >> > > >> >> > ------------------------------ > >> >> > > >> >> > _______________________________________________ > >> >> > freebsd-net@freebsd.org mailing list > >> >> > http://lists.freebsd.org/mailman/listinfo/freebsd-net > >> >> > To unsubscribe, send any mail to > >> >> > "freebsd-net-unsubscribe@freebsd.org" > >> >> > > >> >> > End of freebsd-net Digest, Vol 504, Issue 2 > >> >> > ******************************************* > >> > > >> > > > > > >