Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4059932pxk; Tue, 8 Sep 2020 09:38:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyF8QCVA+CNpZ0ekxf5cS48BiPkD5/EXH1t58At/HcQ+IFCw3vs1QGGbXoEg5jgPxnp7dV4 X-Received: by 2002:a50:cf0b:: with SMTP id c11mr11939876edk.87.1599583100954; Tue, 08 Sep 2020 09:38:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599583100; cv=none; d=google.com; s=arc-20160816; b=s4zD7+2JzQUhbSgL7ugFFUIYtNtqj4KFkacL8+RDYf1MIXCizNyVAb97x1j+OpAXC1 aHXwHXdqPcc/zn1hkcXXPW8dpIYyPjTmCZbpmKH4JWrP9mWz/UckDsHlYXIN1G9iz4Ul VvjSGvxFqkLow1hZt8yLEDKZv2vgkYELVekrRsVnEuETZ8B+VI0XoYz3bSSzfdC+NuJE GWeHi5GSm8JdzhcMlc+ztXgoZv0S1gShzGv+YZOMERbChEonw+hXGhD8KPfG5WqZQIrL QGSllzH6+OKdUKAbw8jPvBPB4zvW8KkYG9ug9sXuDBuWoe6fqbg4WlHWDsjfHHPZs1Sv 9o7A== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=RWpKptDRUy7QEz+yk93XSXVLRWqkIzmC5G3Lk3G8rGs=; b=FbNMa13zeHlwwr5riauw9vPV8xuYCYGuIUIpJHd0FOCn4ffrB8iJaJ6Kmk5HvxWUf8 UiChX4JLkXYt2ucpbAHx1WnhejFZUenqqbSARiUafRi5D0VajapzNyeNOSrs1upNGch5 bZQSbjhgm1HtPguabi8VC8ODgs2mmnwmQFLAw1UihurYruKO+w7ZS2LsjVVh/p8ZHRlL 03vxgP8mjXtUTR5h5/+QNmKvp0wK9jAW8/qbpCxxPoXLNmTSTPmP9N5lJw1VAw5n98P2 GOg9fzlRRDN7SZoqagGtpAhxRb2egVNEUXOGwIhLf624nAFyWIfIpD4YTtjSa/Jam6GV 3wXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=Anp89Ys2; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b21si13734446ejz.77.2020.09.08.09.37.53; Tue, 08 Sep 2020 09:38:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=Anp89Ys2; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732053AbgIHQhS (ORCPT + 99 others); Tue, 8 Sep 2020 12:37:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732027AbgIHQhO (ORCPT ); Tue, 8 Sep 2020 12:37:14 -0400 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 869D9C06137F for ; Tue, 8 Sep 2020 05:55:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=RWpKptDRUy7QEz+yk93XSXVLRWqkIzmC5G3Lk3G8rGs=; b=Anp89Ys2Z8TKaHr16AJd60Q5wY 6jj6mi3HhugTJNcNlDgGcv6OryEj2JokunU4MuqWEBP3MDaZnpBr6dnVMeyXHyg0XRazGLB4FBDDP thRSdlNYtuoUlcIkbiD5dXfPvdNalOzMyiTA9nH05M0saiJAiewc0MBPMg0vsrXLmyok=; Received: from p4ff13fcb.dip0.t-ipconnect.de ([79.241.63.203] helo=localhost.localdomain) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.89) (envelope-from ) id 1kFcry-00050i-Ku; Tue, 08 Sep 2020 14:37:06 +0200 From: Felix Fietkau To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net Subject: [PATCH v4 11/14] mac80211: support using ieee80211_tx_status_ext to free skbs without status info Date: Tue, 8 Sep 2020 14:36:59 +0200 Message-Id: <20200908123702.88454-12-nbd@nbd.name> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200908123702.88454-1-nbd@nbd.name> References: <20200908123702.88454-1-nbd@nbd.name> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org For encap-offloaded packets, ieee80211_free_txskb cannot be used, since it does not have the vif pointer. Using ieee80211_tx_status_ext for this purpose has the advantage of being able avoid an extra station lookup for AQL Signed-off-by: Felix Fietkau --- net/mac80211/status.c | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/net/mac80211/status.c b/net/mac80211/status.c index ac4d988556b0..a3543c3dbd3d 100644 --- a/net/mac80211/status.c +++ b/net/mac80211/status.c @@ -1087,6 +1087,24 @@ void ieee80211_tx_status_ext(struct ieee80211_hw *hw, bool acked, noack_success; u16 tx_time_est; + if (pubsta) + sta = container_of(pubsta, struct sta_info, sta); + + if (skb && (tx_time_est = + ieee80211_info_get_tx_time_est(IEEE80211_SKB_CB(skb))) > 0) { + /* Do this here to avoid the expensive lookup of the sta + * in ieee80211_report_used_skb(). + */ + ieee80211_sta_update_pending_airtime(local, sta, + skb_get_queue_mapping(skb), + tx_time_est, + true); + ieee80211_info_set_tx_time_est(IEEE80211_SKB_CB(skb), 0); + } + + if (!status->info) + goto free; + rates_idx = ieee80211_tx_get_rates(hw, info, &retry_count); sband = hw->wiphy->bands[info->band]; @@ -1095,8 +1113,6 @@ void ieee80211_tx_status_ext(struct ieee80211_hw *hw, noack_success = !!(info->flags & IEEE80211_TX_STAT_NOACK_TRANSMITTED); if (pubsta) { - sta = container_of(pubsta, struct sta_info, sta); - if (!acked && !noack_success) sta->status_stats.retry_failed++; sta->status_stats.retry_count += retry_count; @@ -1132,17 +1148,6 @@ void ieee80211_tx_status_ext(struct ieee80211_hw *hw, ieee80211s_update_metric(local, sta, status); } - if (skb && (tx_time_est = ieee80211_info_get_tx_time_est(info)) > 0) { - /* Do this here to avoid the expensive lookup of the sta - * in ieee80211_report_used_skb(). - */ - ieee80211_sta_update_pending_airtime(local, sta, - skb_get_queue_mapping(skb), - tx_time_est, - true); - ieee80211_info_set_tx_time_est(info, 0); - } - if (skb && !(info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP)) return __ieee80211_tx_status(hw, status, rates_idx, retry_count); @@ -1159,6 +1164,7 @@ void ieee80211_tx_status_ext(struct ieee80211_hw *hw, I802_DEBUG_INC(local->dot11FailedCount); } +free: if (!skb) return; -- 2.28.0