From owner-svn-src-all@freebsd.org Sun Jan 22 07:05:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 217FCCBCAA0; Sun, 22 Jan 2017 07:05:43 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB006AF7; Sun, 22 Jan 2017 07:05:42 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v0M75fqT077820; Sun, 22 Jan 2017 07:05:41 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v0M75foW077819; Sun, 22 Jan 2017 07:05:41 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201701220705.v0M75foW077819@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 22 Jan 2017 07:05:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r312618 - head/tools/tools/ath/athalq X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jan 2017 07:05:43 -0000 Author: adrian Date: Sun Jan 22 07:05:41 2017 New Revision: 312618 URL: https://svnweb.freebsd.org/changeset/base/312618 Log: [athalq] fix rxtimestamp wrapping; print out per-packet timestamp deltas. The delta here is just between the current TX/RX copmletion and the previous TX/RX completion. The metadata needed to link TX descriptor timestamps to their /completion/ timestamp isn't there yet. Modified: head/tools/tools/ath/athalq/ar9300_ds.c Modified: head/tools/tools/ath/athalq/ar9300_ds.c ============================================================================== --- head/tools/tools/ath/athalq/ar9300_ds.c Sun Jan 22 06:30:55 2017 (r312617) +++ head/tools/tools/ath/athalq/ar9300_ds.c Sun Jan 22 07:05:41 2017 (r312618) @@ -38,6 +38,8 @@ __FBSDID("$FreeBSD$"); #define MS(_v, _f) ( ((_v) & (_f)) >> _f##_S ) #define MF(_v, _f) ( !! ((_v) & (_f))) +static uint32_t last_ts = 0; + void ath_alq_print_edma_tx_fifo_push(struct if_ath_alq_payload *a) { @@ -62,15 +64,18 @@ ar9300_decode_txstatus(struct if_ath_alq /* XXX assumes txs is smaller than PAYLOAD_LEN! */ memcpy(&txs, &a->payload, sizeof(struct ar9300_txs)); - printf("[%u.%06u] [%llu] TXSTATUS TxTimestamp=%u, DescId=0x%04x, QCU=%d\n", + printf("[%u.%06u] [%llu] TXSTATUS TxTimestamp=%u (%u), DescId=0x%04x, QCU=%d\n", (unsigned int) be32toh(a->hdr.tstamp_sec), (unsigned int) be32toh(a->hdr.tstamp_usec), (unsigned long long) be64toh(a->hdr.threadid), txs.status4, + txs.status4 - last_ts, (unsigned int) MS(txs.status1, AR_tx_desc_id), (unsigned int) MS(txs.ds_info, AR_tx_qcu_num)); printf(" DescId=0x%08x\n", txs.status1); + last_ts = txs.status4; + printf(" DescLen=%d, TxQcuNum=%d, CtrlStat=%d, DescId=0x%04x\n", txs.ds_info & 0xff, MS(txs.ds_info, AR_tx_qcu_num), @@ -333,10 +338,12 @@ ar9300_decode_rxstatus(struct if_ath_alq /* XXX assumes rxs is smaller than PAYLOAD_LEN! */ memcpy(&rxs, &a->payload, sizeof(struct ar9300_rxs)); - printf("[%u.%06u] [%llu] RXSTATUS\n", + printf("[%u.%06u] [%llu] RXSTATUS RxTimestamp: %u (%d)\n", (unsigned int) be32toh(a->hdr.tstamp_sec), (unsigned int) be32toh(a->hdr.tstamp_usec), - (unsigned long long) be64toh(a->hdr.threadid)); + (unsigned long long) be64toh(a->hdr.threadid), + rxs.status3, + rxs.status3 - last_ts); /* status1 */ /* .. and status5 */ @@ -358,7 +365,8 @@ ar9300_decode_rxstatus(struct if_ath_alq MS(rxs.status2, AR_hw_upload_data)); /* status3 */ - printf(" RX timestamp: %d\n", rxs.status3); + printf(" RX timestamp: %u\n", rxs.status3); + last_ts = rxs.status3; /* status4 */ printf(" GI: %d, 2040: %d, parallel40: %d, stbc=%d\n",