Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4063970pxk; Tue, 8 Sep 2020 09:45:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyxojq5wyNsQNULA/yXPNZM+ZKnbpX+tdtRpSk9wiJPnODutZxd7jVykjr+eiupeaWgLGUd X-Received: by 2002:a17:906:1542:: with SMTP id c2mr28299474ejd.533.1599583517113; Tue, 08 Sep 2020 09:45:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599583517; cv=none; d=google.com; s=arc-20160816; b=eAnEJZqhbxJ8G6tBlyb6aUf7eMF7hGXuRXRtYixYhvn0nc7TfvZwS0P9r9Pm8qb8a3 QhDOlZtPdDa0pB7i9C2/0JPCIRv3PNXo39WoDWN70Mneir63YNAw7rGWrZzCQD3RH010 vgOcsjYPF0qXr1hbt3wuOEtwiaYCyOI/G0lucUwpmywJ7PugL37WcyZbmk6eDPrE+h4I GAw3f7IKutaq5pzBzxoDf6cR7wZZJErhDH3PYr9fq9TteULsqoLkpirstrhUE3j3vdif 7BInqnuvbXgw57CFOZfHqDa5x5FxQN+b+A88FWMiGTmgBTKSMa356MvXZkJHT0vnSuMM T3Ow== 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=i/bTcAuFipdUZSCF5HstaUvxcCCN1hadYDv3oD7j7Sg=; b=ZE4VV21GuYoHEuqbBmDPVid5D6WKmPaENcQsW/cjUSno7xe4fcLJUwRYQbi7H6BCiR FWy+Dc43eHo0d1SDNIR8vKcbvF5sysETanTnNygusl8gC8QF3lW4JUIkdYqxJi9eGwRV jyMllIEuB6+wTswD3hKYbErps4Z2d0pJ4lkUdFqUCS/eiFP1F10Z7aGtIbU2Iye25RNS bFdjmtl4uRuJwtp5tMKK1MZhDcu1nHeqOxSzLOEx4x8OA9ZQFQodethWHsVAuTjBCnjq iD8C6cBgGeTfEqKFlONR5h7yNKsJwodxkBW32KjjoUPfCo+qXknzWomtsTxEPFcaGpHl QI6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=Ml7etjZH; 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 cd7si3408412ejb.433.2020.09.08.09.44.52; Tue, 08 Sep 2020 09:45:17 -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=Ml7etjZH; 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 S1732121AbgIHQmY (ORCPT + 99 others); Tue, 8 Sep 2020 12:42:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732055AbgIHQmS (ORCPT ); Tue, 8 Sep 2020 12:42:18 -0400 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE681C0612EC for ; Tue, 8 Sep 2020 05:55:20 -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=i/bTcAuFipdUZSCF5HstaUvxcCCN1hadYDv3oD7j7Sg=; b=Ml7etjZHy4HUui4+kwiJ0AZTyp O7WncQ/dtMX0f6YXr6iUoy+iTLNA0BJp6QSeLNmKZwtkndK5iaUOBSRwcMAXQZRTuXrHZ798pdXLd MPzZA2GRviPaVHIwbEEJNIh6SLIKLEftUEgy8Ii3LKVxXq/rtOfIWmlQDJHnXgKiLu2U=; 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-SG; Tue, 08 Sep 2020 14:37:06 +0200 From: Felix Fietkau To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net Subject: [PATCH v4 12/14] mac80211: extend ieee80211_tx_status_ext to support bulk free Date: Tue, 8 Sep 2020 14:37:00 +0200 Message-Id: <20200908123702.88454-13-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 Store processed skbs ready to be freed in a list so the driver bulk free them Signed-off-by: Felix Fietkau --- include/net/mac80211.h | 2 ++ net/mac80211/status.c | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include/net/mac80211.h b/include/net/mac80211.h index fc31976323e6..1d1290aca870 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -1095,12 +1095,14 @@ ieee80211_info_get_tx_time_est(struct ieee80211_tx_info *info) * @info: Basic tx status information * @skb: Packet skb (can be NULL if not provided by the driver) * @rate: The TX rate that was used when sending the packet + * @free_list: list where processed skbs are stored to be free'd by the driver */ struct ieee80211_tx_status { struct ieee80211_sta *sta; struct ieee80211_tx_info *info; struct sk_buff *skb; struct rate_info *rate; + struct list_head *free_list; }; /** diff --git a/net/mac80211/status.c b/net/mac80211/status.c index a3543c3dbd3d..a0dd926dceb3 100644 --- a/net/mac80211/status.c +++ b/net/mac80211/status.c @@ -1044,7 +1044,10 @@ static void __ieee80211_tx_status(struct ieee80211_hw *hw, * with this test... */ if (!local->monitors && (!send_to_cooked || !local->cooked_mntrs)) { - dev_kfree_skb(skb); + if (status->free_list) + list_add_tail(&skb->list, status->free_list); + else + dev_kfree_skb(skb); return; } @@ -1169,7 +1172,10 @@ void ieee80211_tx_status_ext(struct ieee80211_hw *hw, return; ieee80211_report_used_skb(local, skb, false); - dev_kfree_skb(skb); + if (status->free_list) + list_add_tail(&skb->list, status->free_list); + else + dev_kfree_skb(skb); } EXPORT_SYMBOL(ieee80211_tx_status_ext); -- 2.28.0