From patchwork Wed Dec 23 08:45:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: You-Sheng Yang X-Patchwork-Id: 1419676 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4D16R04Yd7z9sW0; Wed, 23 Dec 2020 19:52:28 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1krzsf-0004Ce-9c; Wed, 23 Dec 2020 08:52:25 +0000 Received: from mail-pl1-f177.google.com ([209.85.214.177]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1krzsa-00046t-GC for kernel-team@lists.ubuntu.com; Wed, 23 Dec 2020 08:52:20 +0000 Received: by mail-pl1-f177.google.com with SMTP id t6so8815578plq.1 for ; Wed, 23 Dec 2020 00:52:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+o5+9MFXJgUjBE7Tj1uxMiGfICDpZ/48GvaCjxxS7zg=; b=XN4gpt8UXILCeyg35N2BLtq2jMS8Ngo2CvfvF0i370+XC/4u+YUmmql4qk2u3tG5Qu 5b+x0ZGgwzosWHSdTL7gIBDaImulJuZdddQV4OtDWfGng/ivD41GjQev/Cfzs2aFOOny ecx9FH/lat1/03WQWxXWnKOUqIXyAk92V5/aMnWpo34og86OszpXVJo0ckwgomjEgYy6 MKoC4LOdHOIpfU5DeAWQkBGGe1ZyiE33Gazuk1hOdw6VdmkkmeoIIi9+S5CuZ8MkWqwc gK1kJqJhhUkwicg1I1S3oGmG19Zm0QcFWsNARa1hjVRu0pL+n0jkBNLWVtGeOLs+yFqe Qn9w== X-Gm-Message-State: AOAM530jE4wZRYJCG2LOIgdW9Lrxy6hR87iMLRcW8DtYyKjJrsTs+49m Bjq5l4P6NGWDHahwzFlcSYYLwvwoF0FPTQZ5 X-Google-Smtp-Source: ABdhPJwGjsJl4Mlm158mlFDGo3MB7h/cY4+3YFjEb0FKa/OHNJhGfp+vSf07mBBaRX/8keKNKn6KUA== X-Received: by 2002:a17:90b:11d7:: with SMTP id gv23mr25752758pjb.2.1608713537099; Wed, 23 Dec 2020 00:52:17 -0800 (PST) Received: from localhost (61-220-137-37.HINET-IP.hinet.net. [61.220.137.37]) by smtp.gmail.com with ESMTPSA id v19sm20601054pjg.50.2020.12.23.00.52.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Dec 2020 00:52:16 -0800 (PST) From: You-Sheng Yang To: kernel-team@lists.ubuntu.com Subject: [PATCH 008/379][SRU][OEM-5.6] mac80211: fix tx status for no ack cases Date: Wed, 23 Dec 2020 16:45:41 +0800 Message-Id: <20201223085152.554896-9-vicamo.yang@canonical.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201223085152.554896-1-vicamo.yang@canonical.com> References: <20201223085152.554896-1-vicamo.yang@canonical.com> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.214.177; envelope-from=vicamo@gmail.com; helo=mail-pl1-f177.google.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Markus Theil BugLink: https://bugs.launchpad.net/bugs/1879633 Before this patch, frames which where successfully transmitted without requiring acks where accounted as lost frames. Signed-off-by: Markus Theil Link: https://lore.kernel.org/r/20191218142736.15843-1-markus.theil@tu-ilmenau.de Signed-off-by: Johannes Berg (cherry picked from commit 5972fa15b923df6ccd02ae6e7095a6b08b5fca52) Signed-off-by: You-Sheng Yang --- net/mac80211/status.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/net/mac80211/status.c b/net/mac80211/status.c index f05c829d02d3..22512805eafb 100644 --- a/net/mac80211/status.c +++ b/net/mac80211/status.c @@ -887,6 +887,7 @@ static void __ieee80211_tx_status(struct ieee80211_hw *hw, int rates_idx; bool send_to_cooked; bool acked; + bool noack_success; struct ieee80211_bar *bar; int shift = 0; int tid = IEEE80211_NUM_TIDS; @@ -905,6 +906,8 @@ static void __ieee80211_tx_status(struct ieee80211_hw *hw, clear_sta_flag(sta, WLAN_STA_SP); acked = !!(info->flags & IEEE80211_TX_STAT_ACK); + noack_success = !!(info->flags & + IEEE80211_TX_STAT_NOACK_TRANSMITTED); /* mesh Peer Service Period support */ if (ieee80211_vif_is_mesh(&sta->sdata->vif) && @@ -969,12 +972,12 @@ static void __ieee80211_tx_status(struct ieee80211_hw *hw, ieee80211_handle_filtered_frame(local, sta, skb); return; } else { - if (!acked) + if (!acked && !noack_success) sta->status_stats.retry_failed++; sta->status_stats.retry_count += retry_count; if (ieee80211_is_data_present(fc)) { - if (!acked) + if (!acked && !noack_success) sta->status_stats.msdu_failed[tid]++; sta->status_stats.msdu_retries[tid] += @@ -1012,7 +1015,7 @@ static void __ieee80211_tx_status(struct ieee80211_hw *hw, } if (ieee80211_hw_check(&local->hw, REPORTS_TX_ACK_STATUS)) { - if (info->flags & IEEE80211_TX_STAT_ACK) { + if (acked) { if (sta->status_stats.lost_packets) sta->status_stats.lost_packets = 0; @@ -1020,6 +1023,8 @@ static void __ieee80211_tx_status(struct ieee80211_hw *hw, if (test_sta_flag(sta, WLAN_STA_TDLS_PEER_AUTH)) sta->status_stats.last_tdls_pkt_time = jiffies; + } else if (noack_success) { + /* nothing to do here, do not account as lost */ } else { ieee80211_lost_packet(sta, info); } @@ -1140,7 +1145,7 @@ void ieee80211_tx_status_ext(struct ieee80211_hw *hw, sta = container_of(pubsta, struct sta_info, sta); - if (!acked) + if (!acked && !noack_success) sta->status_stats.retry_failed++; sta->status_stats.retry_count += retry_count; @@ -1155,6 +1160,8 @@ void ieee80211_tx_status_ext(struct ieee80211_hw *hw, sta->status_stats.last_tdls_pkt_time = jiffies; } else if (test_sta_flag(sta, WLAN_STA_PS_STA)) { return; + } else if (noack_success) { + /* nothing to do here, do not account as lost */ } else { ieee80211_lost_packet(sta, info); }