Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E8758C43381 for ; Wed, 27 Mar 2019 18:55:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B0E22205C9 for ; Wed, 27 Mar 2019 18:55:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="pJqWiJf6" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390255AbfC0SzS (ORCPT ); Wed, 27 Mar 2019 14:55:18 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:38335 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389048AbfC0SzR (ORCPT ); Wed, 27 Mar 2019 14:55:17 -0400 Received: by mail-wm1-f67.google.com with SMTP id w15so1221568wmc.3 for ; Wed, 27 Mar 2019 11:55:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=da8S3FnVqMfOsLzwefTVzjnE3RimIS1llLaRHtA2wA8=; b=pJqWiJf6VFJ++VBCxoqKLD+f6WJmBT4oFfDyCYhLhy8H6s8dUbwc314oVJfgS+vRIz fDQGuUVMgFNYRHYzmrPjHO23ixBKOCZOcm/1eeIjDh0/C80I7qpr/3vAGLXhGKfhKC4e txob1/4jsBht+F5OsrNSZKnBMcfS1FI2WylEL7097MKyn9GwrZ25yoIBbCTX/3zp9glC d4LQ1sTcYGbl2LmQgNReRWuNwJUiVi3tjWux6hzY4rIUtDE8NWj6guifikdMpNK0HHJZ 9LRA9dLbjN1Suli0DE14jh1CQKpPribTLAWw6VYvV1vICp5MLqNF2DjHfTTaYtSaRTBj Nu8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=da8S3FnVqMfOsLzwefTVzjnE3RimIS1llLaRHtA2wA8=; b=cXRxgdV92Kk1L/03yTbqurGqLC0+jkVfgtJAZIYMUndFAsLM2aMWPokK6HPFkIRvyl KDZcMAaYesoJpAr7Fq0EZ2Qx4MFvuW38hTdUMfUwrCva0GN+TAyk1Xg/RZjgjc0QVt1f lhxoen34YmJWGpavYfwRfN4dpnMpAAc4HiBvVC/s2AfRSFyz97UHv96LDtfrcStx6qg3 DoZ6bBCzC1yFOek7Bsq1mE+QLM4VXvQi5FUHN7hxGp8f3rVwTzrBb2mFbJTW3z83IVqE eSFQWGjtI+63m82/Q60N8wXmeRfGqDbpTDvsLrn0iRgbO2bF1i+oTF/66mX80QpyP6V6 CBkQ== X-Gm-Message-State: APjAAAUk0LoQ7nL7f/mTintSndK7SoUYW3bAPphC8mNkF2IZmS7hL2vE Ash3xFV3cdiner0hiB2Hlv4iwsUI X-Google-Smtp-Source: APXvYqy4JiFTXZYf7EeYnOCDSy19KvXtT3s0YRV/VVMMYJltVyJmGq0rdETmPacuiyteUSsEUu2F8Q== X-Received: by 2002:a1c:7519:: with SMTP id o25mr3003986wmc.24.1553712914705; Wed, 27 Mar 2019 11:55:14 -0700 (PDT) Received: from ?IPv6:2003:ea:8bc4:dc00:ccf1:55bc:aa83:b190? (p200300EA8BC4DC00CCF155BCAA83B190.dip0.t-ipconnect.de. [2003:ea:8bc4:dc00:ccf1:55bc:aa83:b190]) by smtp.googlemail.com with ESMTPSA id w11sm14594890wre.15.2019.03.27.11.55.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 27 Mar 2019 11:55:14 -0700 (PDT) Subject: Re: netif_receive_skb_list and interrupts enabled/disabled To: Jesper Dangaard Brouer Cc: Edward Cree , "netdev@vger.kernel.org" References: <5c170def-4c09-8da2-e0cd-6fc29881031f@gmail.com> <20190327092011.0fded74d@carbon> From: Heiner Kallweit Message-ID: Date: Wed, 27 Mar 2019 19:55:04 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190327092011.0fded74d@carbon> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 27.03.2019 09:20, Jesper Dangaard Brouer wrote: > On Tue, 26 Mar 2019 21:04:09 +0100 > Heiner Kallweit wrote: > >> A question inspired by 0a25d92c6f4f ("dpaa2-eth: use netif_receive_skb_list"): >> kerneldoc of netif_receive_skb_list states that interrupts should be >> enabled. > > Do notice that the exact same comment (and rule) applies to > netif_receive_skb() which also have below comment: > > /* [...] > * This function may only be called from softirq context and interrupts > * should be enabled. > */ > >> When used from NAPI context irqs typically are disabled. >> And if the NAPI budget is fully consumed then interrupts don't get enabled >> in the same NAPI poll loop. How is this supposed to play together? > > You have misunderstood that is means that interrupts should be > enabled. It is talking about local_irq_disable/enable and > local_irq_save/restore. This is different from disabling the IRQs on a > given NIC RX-queue. > Uh, you're right of course, my bad. One more question because this part of the network stack was beyond my horizon so far. The referenced patch replaces a number of calls to napi_gro_receive() with a call to netif_receive_skb_list(). In a follow-up to this mail thread there was a remark "We should likely add a similar napi_gro_receive_list() function." For my understanding: When is it safe to replace a number of napi_gro_receive() calls with netif_receive_skb_list() and when would we need the new napi_gro_receive_list()?