From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Fainelli Subject: __dev_kfree_skb_any() and use of dev_kfree_skb() Date: Tue, 2 Oct 2018 13:07:26 -0700 Message-ID: <32568fab-02d4-0484-3237-5d8dc09e273d@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: davem@davemloft.net To: netdev , edumazet@google.com, nhorman@tuxdriver.com Return-path: Received: from mail-ed1-f46.google.com ([209.85.208.46]:38561 "EHLO mail-ed1-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726194AbeJCCwn (ORCPT ); Tue, 2 Oct 2018 22:52:43 -0400 Received: by mail-ed1-f46.google.com with SMTP id c1-v6so3250702ede.5 for ; Tue, 02 Oct 2018 13:07:38 -0700 (PDT) Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: Hi Eric, Neil, Should not __dev_kfree_skb_any() call kfree_skb() instead of dev_kfree_skb() which is aliased to consumes_skb() and therefore does not flag the skb with SKB_REASON_DROPPED? If we take the in_irq() || irqs_disabled() branch, we will be calling __dev_kfree_skb_irq() which takes care of setting the skb_free_reason frmo the caller. Is there an implied semantic with dev_kfree_skb() that it means it was freed by the network device and therefore this equals to a consumption (not a drop)? The comment above dev_kfree_skb_any() seems to imply this should be a context unaware replacement for kfree_skb(). Thanks! -- Florian