Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2511448pxk; Sun, 27 Sep 2020 10:19:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz88kkzV7V3xYDTCEqKqF5u2VHlNNEw4puhOPrkD5bbyJdcMjcJlseqYkL+m6dtSlds9o9k X-Received: by 2002:a17:906:b24e:: with SMTP id ce14mr12005690ejb.494.1601227198516; Sun, 27 Sep 2020 10:19:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601227198; cv=none; d=google.com; s=arc-20160816; b=x0t9w8oKJAvRH722ECN01HctifLy3+qqsKzo6hnpV8VBa/yfstBseiaC2maw5XrABb coJ1a6cB/sEYh7YBRVCtHHBhHS/yxkcqXjkh15ZQtIV3Gu6a2Nm04fABt8lPzrvNI7QP bTIV7yHquh+NyCpYKy+hCBswhYkboKqZqq2Kd/NeaTuvH5B4bh/qmhTSkEttTv0MM8pp ckPsmmzCX/3TUTY1IJ1ILjFE+8Z7hSkpd87jbUCUwZ/KspCjn8ZxkxnQKqBZ9ZaNSOuK VhBkE3wvQLGMkX1FPhJCaf7MROjf1tdTh9DM5cspljE5Wjn8JqJhQCcGg0Nct1RssMRI 1PpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=rpHo8xelTuKWnoFo2hboJNry9e/+lqJ+2CCIMk77fUg=; b=J+x7ewTys091CTW0x/rC53c4g0Ne83CmidY9M8fkvKkLWrCp2+Xt1Kem6kynZI3KN3 Sxf+T5ujiiD3/onWc9lRPCzuvykxIajef5J4gryd3ous9Ckk66bBBeXW5cRJY/vkXWS+ 0x4yl6Ww0TZQXmmFI6Di1TU2uP+K2dPlWaLgo9AtE1jz/ImLdCumKYTJpdMvXl02tk/H b2CLifRrmHF3Xo4prP+yKyauzU+BShIyPBFLeospzIBinskmwfMAi13DNLucpbW4+pXa kEbERrZ3I4UuNTOhsUWLWA4sa/Cb77XMJLTw8dP1YTWsWXlk+PRe4LPiUd4LIBtOG7og YRoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=hOej4OoF; 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 lc19si5949264ejb.192.2020.09.27.10.19.34; Sun, 27 Sep 2020 10:19:58 -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=hOej4OoF; 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 S1726315AbgI0RSz (ORCPT + 99 others); Sun, 27 Sep 2020 13:18:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726280AbgI0RSz (ORCPT ); Sun, 27 Sep 2020 13:18:55 -0400 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EEF5C0613D4 for ; Sun, 27 Sep 2020 10:18:55 -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:To:From:Sender:Reply-To:Cc: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=rpHo8xelTuKWnoFo2hboJNry9e/+lqJ+2CCIMk77fUg=; b=hOej4OoFZW2V3TRs6R8xGaCl1g 3y98HRrIOBSRqpvh7upt6yx8mc0gB9Ua29s8Hluu/Zu28KFNXAGTbfYR8L2IWPmS9MxdyjeM3hpwe L6HEKD/5El5DDxr268N7DcG4vJtsLBho36YDcBBu8YfY/JYuxpy4Md4RdJeO9TUZvYxM=; Received: from p4ff134da.dip0.t-ipconnect.de ([79.241.52.218] helo=localhost.localdomain) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.89) (envelope-from ) id 1kMaK5-0002oU-SP for linux-wireless@vger.kernel.org; Sun, 27 Sep 2020 19:18:53 +0200 From: Felix Fietkau To: linux-wireless@vger.kernel.org Subject: [PATCH 3/8] mt76: use ieee80211_rx_list to pass frames to the network stack as a batch Date: Sun, 27 Sep 2020 19:18:47 +0200 Message-Id: <20200927171852.48669-3-nbd@nbd.name> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200927171852.48669-1-nbd@nbd.name> References: <20200927171852.48669-1-nbd@nbd.name> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Improves icache footprint Signed-off-by: Felix Fietkau --- drivers/net/wireless/mediatek/mt76/mac80211.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mac80211.c b/drivers/net/wireless/mediatek/mt76/mac80211.c index 4befe7f937a9..4e0ed9c79d50 100644 --- a/drivers/net/wireless/mediatek/mt76/mac80211.c +++ b/drivers/net/wireless/mediatek/mt76/mac80211.c @@ -932,7 +932,8 @@ void mt76_rx_complete(struct mt76_dev *dev, struct sk_buff_head *frames, { struct ieee80211_sta *sta; struct ieee80211_hw *hw; - struct sk_buff *skb; + struct sk_buff *skb, *tmp; + LIST_HEAD(list); spin_lock(&dev->rx_lock); while ((skb = __skb_dequeue(frames)) != NULL) { @@ -942,9 +943,19 @@ void mt76_rx_complete(struct mt76_dev *dev, struct sk_buff_head *frames, } mt76_rx_convert(dev, skb, &hw, &sta); - ieee80211_rx_napi(hw, sta, skb, napi); + ieee80211_rx_list(hw, sta, skb, &list); } spin_unlock(&dev->rx_lock); + + if (!napi) { + netif_receive_skb_list(&list); + return; + } + + list_for_each_entry_safe(skb, tmp, &list, list) { + skb_list_del_init(skb); + napi_gro_receive(napi, skb); + } } void mt76_rx_poll_complete(struct mt76_dev *dev, enum mt76_rxq_id q, -- 2.28.0