Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp3138661ybh; Sat, 25 Jul 2020 12:15:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxTZKoDa4gULCEvduJ4E8a+bfC/RhtgUXm8vanCL9qgT1tbvUD9YUSNCc5SrSpZ60EOqljn X-Received: by 2002:a50:cd1a:: with SMTP id z26mr14866740edi.120.1595704509674; Sat, 25 Jul 2020 12:15:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595704509; cv=none; d=google.com; s=arc-20160816; b=JTXCZLn+M6XmCl4GMJAlP51kiouLuxLb9JyQ9Vje/yyXHQfAh1Qb51ELbER2CBB0iH oJQ7fvphQKPOOIdFQlRuOX1yRKJ1lInL4AqLlP7weQBcW73wyovEQyzZEuMMnvOzAFC+ iSCCIp2WAJpYEIuCxSNlmTn1nTs0TaDbTcbYNKBwpRuDqPenrEwoYv9/lVFEtoKiWkju U7YVnHuWE00ukeZRGTpRk5zL0VbTXA/gh1vZg9V8y5OPC5uAtzpt+PiMCQhn3qCvGtYS JUpQ1bHcZr61SSkiP3UdIxlOKOAGr6DFnN6JXLtoj0naoGlSSvxXFouHsDBBtSIxhtFt n5Jw== 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:date:to:from:subject:message-id; bh=a1sqC6Ci/vaH6xIttKynz+Bzx/Qpbk+ZCmD+OjbdYDU=; b=uPoEB6nG84WU7xfM10gNr7nvnBuUeFTPxNGohvXkEJnxMcw15kuL/3FpwOvOdF7QU/ o3tngX3g6yZhydqMSynuUBW4m0DE71ROTS9vCHPmQ/dXUmPeepR1rCvMgyhsupf8G/RB vQ9PBRbbIxqXWKmpPRdL1KVxVYCAdVeKtHC8Z9vaRFN9Ej/7rj7Miri5oLoiuOoUUpUb fDR1I6QyyFsbqXJl8JiuhiopcIsFHeSPiMQ9MUy/duZRKC/F7tBqRn1inrWN6WXW7Pfl s9B4sKLSWmQDAgL3BQZ6PD8NcgAzMlH5px+subOm56n1b+ZmByfprtY6+/gOvkKR7uN/ gVVw== ARC-Authentication-Results: i=1; mx.google.com; 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 dr16si3452412ejc.502.2020.07.25.12.14.40; Sat, 25 Jul 2020 12:15:09 -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; 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 S1726638AbgGYTOj (ORCPT + 99 others); Sat, 25 Jul 2020 15:14:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726381AbgGYTOj (ORCPT ); Sat, 25 Jul 2020 15:14:39 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC565C08C5C0 for ; Sat, 25 Jul 2020 12:14:38 -0700 (PDT) Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.93) (envelope-from ) id 1jzPcy-00AoHr-16; Sat, 25 Jul 2020 21:14:36 +0200 Message-ID: Subject: Re: [RFC] mac80211: add a function for running rx without passing skbs to the stack From: Johannes Berg To: Felix Fietkau , linux-wireless@vger.kernel.org Date: Sat, 25 Jul 2020 21:14:19 +0200 In-Reply-To: <20200725185554.17346-1-nbd@nbd.name> References: <20200725185554.17346-1-nbd@nbd.name> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.4 (3.36.4-1.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org > +void ieee80211_rx_napi(struct ieee80211_hw *hw, struct ieee80211_sta *pubsta, > + struct sk_buff *skb, struct napi_struct *napi) > +{ > + struct sk_buff_head list; > + > + __skb_queue_head_init(&list); > + > + /* > + * key references and virtual interfaces are protected using RCU > + * and this requires that we are in a read-side RCU section during > + * receive processing > + */ > + rcu_read_lock(); > + ieee80211_rx_list(hw, pubsta, skb, &list); > + rcu_read_unlock(); > + > + while ((skb = __skb_dequeue(&list)) != NULL) I'd drop the != NULL, but no strong feelings :) > + if (napi) > + napi_gro_receive(napi, skb); > + else > + netif_receive_skb(skb); Nit: I'd prefer braces on the loop, just makes it nicer to read IMHO. OTOH, the !napi case should use netif_receive_skb_list(), no? Given the discussion, it also seems a bit odd to add more work for NAPI poll where we process one by one ... But I see why you did that, and I guess it's not actually that much more work. johannes