From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751135AbdE3PhO (ORCPT ); Tue, 30 May 2017 11:37:14 -0400 Received: from vps0.lunn.ch ([178.209.37.122]:58350 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750871AbdE3PhM (ORCPT ); Tue, 30 May 2017 11:37:12 -0400 Date: Tue, 30 May 2017 17:37:08 +0200 From: Andrew Lunn To: Vivien Didelot Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@savoirfairelinux.com, "David S. Miller" , Florian Fainelli Subject: Re: [PATCH net-next 7/7] net: dsa: factor skb freeing on xmit Message-ID: <20170530153708.GI22758@lunn.ch> References: <20170530142131.23568-1-vivien.didelot@savoirfairelinux.com> <20170530142131.23568-8-vivien.didelot@savoirfairelinux.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170530142131.23568-8-vivien.didelot@savoirfairelinux.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 30, 2017 at 10:21:31AM -0400, Vivien Didelot wrote: > The taggers are currently responsible to free the original SKB if they > made a copy of it, or in case of error. > > This patch simplifies this by freeing the original SKB in the > dsa_slave_xmit caller if it differs from the return SKB (copy or NULL.) So we have two different things here: 1) The tagger needs to drop the frame, because there is an error of some sort. 2) The tagger allocates a new skb for the frame. I think on error, the core code can drop the frame. If the tagger allocates a new skb, i think the tagger should be responsible for freeing to original. Andrew