Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2473983imd; Fri, 2 Nov 2018 12:02:49 -0700 (PDT) X-Google-Smtp-Source: AJdET5cWAUtedIm2MnTHOQnFduOI2sTgnGRn/U/Y05VHuXytKCY866iuQX5mpmJOSs1+KBZSp/f3 X-Received: by 2002:a63:c508:: with SMTP id f8-v6mr12048224pgd.412.1541185369631; Fri, 02 Nov 2018 12:02:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541185369; cv=none; d=google.com; s=arc-20160816; b=IF1Ypk4mcm5y+TuFlcjThfTCvzIVb9gD33HTaljOd8iIUCEWAb9O68Uq73GfXI+fen gXeFELMFiehW64ORzdGMUQS0AkEEFX4FtOc911KMK63e9saaP2CBkp2/MFwuVfqLotZ/ 4imhvKy/WiRUc7Qnqgi103IqsXu6bqHxmr0Dq+HVcSW3edKfNbSCo1FpJ2qX4vcRMCfm FLD3cDvQOJj5T1fWRMqWL64jka3T/yF93QJ/xKFO0risp9uca0YRoXEjH+SK7tQ2w8aM Dgswula+T28BB6zI6fCb/VK42XIDx7q0Rznd/AR/mOTgmDSiF7wSyGIPlxnNrEm1UGnG bW7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=dUyUi2q6sVJ2KMrqF52DegpC5OWjueNwChE/u4SUnNI=; b=wCAhDfmZmlvC/F23F6oo5emgvbxunrKw/UUOJc/3lmpkhUpqkeUngzsjSZiapVcCNz OBH2HOj+xKNKCXVKDRdTKC2hfMXN2Ug+2lTV4jUsGJqWPhxEIMF4fWsBxqrVgrWcR894 n4p3ZP/mOc/Vk0YmZyqrm/L7ZIoUVWlGtCs4quO/LH6EWYq2YSDLKugumceE5jilUY3+ OJOPrVMPjEgsUck6Kp1XD9YgPp9EqHq2QZ5ysGDcfhkFWrUMdjGWSa/h/I5qZxueO5PJ 79PBOXnhSfGrYDgSKgEZ0utyEH0/lIAeiK45UY0ry+z4USHnTZ0VLFMz+tixEg9B7wIW eQZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DATldi0L; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m123-v6si20365600pfd.112.2018.11.02.12.02.33; Fri, 02 Nov 2018 12:02:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DATldi0L; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730660AbeKCD5e (ORCPT + 99 others); Fri, 2 Nov 2018 23:57:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:53204 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728280AbeKCD5d (ORCPT ); Fri, 2 Nov 2018 23:57:33 -0400 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7267F2082D; Fri, 2 Nov 2018 18:49:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541184558; bh=ujgi1ECldlnmrwLDeBOxPxqTKqxD8Q5CfI4m40osHrY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DATldi0LvVt/7dG2uteiysTJNIHTU84SDoHct4TmnBIKWiTyuw+KxW67Uaw5GXdf6 /Y/1d9PEJsY3m1JlVrSXPIMpRmUO6aU6I7n+SZkrW36pzTv9apFq5lFGL02vtWY+Jq VqOVQz6D/nizxZ8XFil7gZIAKoqOCr+p8SMkxXV8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yuan-Chi Pang , Johannes Berg , Sasha Levin Subject: [PATCH 4.14 010/143] mac80211: fix TX status reporting for ieee80211s Date: Fri, 2 Nov 2018 19:33:15 +0100 Message-Id: <20181102182857.901460452@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181102182857.064326086@linuxfoundation.org> References: <20181102182857.064326086@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit c42055105785580563535e6d3143cad95c7ac7ee ] TX status reporting to ieee80211s is through ieee80211s_update_metric. There are two problems about ieee80211s_update_metric: 1. The purpose is to estimate the fail probability to a specific link. No need to restrict to data frame. 2. Current implementation does not work if wireless driver does not pass tx_status with skb. Fix this by removing ieee80211_is_data condition, passing ieee80211_tx_status directly to ieee80211s_update_metric, and putting it in both __ieee80211_tx_status and ieee80211_tx_status_ext. Signed-off-by: Yuan-Chi Pang Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/mac80211/mesh.h | 3 ++- net/mac80211/mesh_hwmp.c | 9 +++------ net/mac80211/status.c | 4 +++- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/net/mac80211/mesh.h b/net/mac80211/mesh.h index 7e5f271e3c30..4f1c61637ce3 100644 --- a/net/mac80211/mesh.h +++ b/net/mac80211/mesh.h @@ -217,7 +217,8 @@ void mesh_rmc_free(struct ieee80211_sub_if_data *sdata); int mesh_rmc_init(struct ieee80211_sub_if_data *sdata); void ieee80211s_init(void); void ieee80211s_update_metric(struct ieee80211_local *local, - struct sta_info *sta, struct sk_buff *skb); + struct sta_info *sta, + struct ieee80211_tx_status *st); void ieee80211_mesh_init_sdata(struct ieee80211_sub_if_data *sdata); void ieee80211_mesh_teardown_sdata(struct ieee80211_sub_if_data *sdata); int ieee80211_start_mesh(struct ieee80211_sub_if_data *sdata); diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c index 055ea36ff27b..fab0764c315f 100644 --- a/net/mac80211/mesh_hwmp.c +++ b/net/mac80211/mesh_hwmp.c @@ -295,15 +295,12 @@ int mesh_path_error_tx(struct ieee80211_sub_if_data *sdata, } void ieee80211s_update_metric(struct ieee80211_local *local, - struct sta_info *sta, struct sk_buff *skb) + struct sta_info *sta, + struct ieee80211_tx_status *st) { - struct ieee80211_tx_info *txinfo = IEEE80211_SKB_CB(skb); - struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; + struct ieee80211_tx_info *txinfo = st->info; int failed; - if (!ieee80211_is_data(hdr->frame_control)) - return; - failed = !(txinfo->flags & IEEE80211_TX_STAT_ACK); /* moving average, scaled to 100. diff --git a/net/mac80211/status.c b/net/mac80211/status.c index ccac205e5853..bdf131ed5ce8 100644 --- a/net/mac80211/status.c +++ b/net/mac80211/status.c @@ -797,7 +797,7 @@ static void __ieee80211_tx_status(struct ieee80211_hw *hw, rate_control_tx_status(local, sband, status); if (ieee80211_vif_is_mesh(&sta->sdata->vif)) - ieee80211s_update_metric(local, sta, skb); + ieee80211s_update_metric(local, sta, status); if (!(info->flags & IEEE80211_TX_CTL_INJECTED) && acked) ieee80211_frame_acked(sta, skb); @@ -958,6 +958,8 @@ void ieee80211_tx_status_ext(struct ieee80211_hw *hw, } rate_control_tx_status(local, sband, status); + if (ieee80211_vif_is_mesh(&sta->sdata->vif)) + ieee80211s_update_metric(local, sta, status); } if (acked || noack_success) { -- 2.17.1