From owner-svn-src-head@freebsd.org Sat May 16 21:59:42 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4ECF12FEFD1; Sat, 16 May 2020 21:59:42 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49PfML1LPbz45Dp; Sat, 16 May 2020 21:59:42 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 295241CB16; Sat, 16 May 2020 21:59: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 04GLxgQ9033461; Sat, 16 May 2020 21:59:42 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04GLxgto033460; Sat, 16 May 2020 21:59:42 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202005162159.04GLxgto033460@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 16 May 2020 21:59:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361118 - head/sys/dev/ath/ath_rate/sample X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/dev/ath/ath_rate/sample X-SVN-Commit-Revision: 361118 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 May 2020 21:59:42 -0000 Author: adrian Date: Sat May 16 21:59:41 2020 New Revision: 361118 URL: https://svnweb.freebsd.org/changeset/base/361118 Log: [ath_rate_sample] Fix correct status when completing frames with short failures. My preivous logic was a bit wrong. This caused transmissions that failed due to a mix of short and long retries to count intermediate rates as OK if the LONG retry count indicated some retries had made it to this intermediate rate, but the SHORT retry count was the one that caused the whole transmit to fail. Now status is passed in again - and this is the status for the whole transmission - and then update_stats() does some quick math to see if the current transmission series hit its long retry count or not before updating things as a success or failure. Modified: head/sys/dev/ath/ath_rate/sample/sample.c Modified: head/sys/dev/ath/ath_rate/sample/sample.c ============================================================================== --- head/sys/dev/ath/ath_rate/sample/sample.c Sat May 16 19:38:58 2020 (r361117) +++ head/sys/dev/ath/ath_rate/sample/sample.c Sat May 16 21:59:41 2020 (r361118) @@ -933,6 +933,18 @@ ath_rate_setupxtxdesc(struct ath_softc *sc, struct ath s3code, sched->t3); /* series 3 */ } +/* + * Update the current statistics. + * + * Note that status is for the FINAL transmit status, not this + * particular attempt. So, check if tries > tries0 and if so + * assume this status failed. + * + * This is important because some failures are due to both + * short AND long retries; if the final issue was a short + * retry failure then we still want to account for the + * bad long retry attempts. + */ static void update_stats(struct ath_softc *sc, struct ath_node *an, int frame_size, @@ -947,7 +959,7 @@ update_stats(struct ath_softc *sc, struct ath_node *an #endif const int size_bin = size_to_bin(frame_size); const int size = bin_to_size(size_bin); - int tt, tries_so_far; + int tt; int is_ht40 = (an->an_node.ni_chw == 40); int pct; @@ -955,6 +967,15 @@ update_stats(struct ath_softc *sc, struct ath_node *an return; /* + * Treat long retries as us exceeding retries, even + * if the eventual attempt at some other MRR schedule + * succeeded. + */ + if (tries > tries0) { + status = HAL_TXERR_XRETRY; + } + + /* * If status is FAIL then we treat all frames as bad. * This better accurately tracks EWMA and average TX time * because even if the eventual transmission succeeded, @@ -971,7 +992,6 @@ update_stats(struct ath_softc *sc, struct ath_node *an */ tt = calc_usecs_unicast_packet(sc, size, rix0, 0 /* short_tries */, MIN(tries0, tries) - 1, is_ht40); - tries_so_far = tries0; if (sn->stats[size_bin][rix0].total_packets < ssc->smoothing_minpackets) { /* just average the first few packets */ @@ -1194,7 +1214,7 @@ ath_rate_tx_complete(struct ath_softc *sc, struct ath_ update_stats(sc, an, frame_size, rc[0].rix, rc[0].tries, short_tries, long_tries, - long_tries > rc[0].tries, + status, nframes, nbad); long_tries -= rc[0].tries; } @@ -1203,7 +1223,7 @@ ath_rate_tx_complete(struct ath_softc *sc, struct ath_ update_stats(sc, an, frame_size, rc[1].rix, rc[1].tries, short_tries, long_tries, - long_tries > rc[1].tries, + status, nframes, nbad); long_tries -= rc[1].tries; } @@ -1212,7 +1232,7 @@ ath_rate_tx_complete(struct ath_softc *sc, struct ath_ update_stats(sc, an, frame_size, rc[2].rix, rc[2].tries, short_tries, long_tries, - long_tries > rc[2].tries, + status, nframes, nbad); long_tries -= rc[2].tries; } @@ -1221,7 +1241,7 @@ ath_rate_tx_complete(struct ath_softc *sc, struct ath_ update_stats(sc, an, frame_size, rc[3].rix, rc[3].tries, short_tries, long_tries, - long_tries > rc[3].tries, + status, nframes, nbad); } }