From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753876AbdGJLwu (ORCPT ); Mon, 10 Jul 2017 07:52:50 -0400 Received: from frisell.zx2c4.com ([192.95.5.64]:48667 "EHLO frisell.zx2c4.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753497AbdGJLwt (ORCPT ); Mon, 10 Jul 2017 07:52:49 -0400 MIME-Version: 1.0 In-Reply-To: <20170710.090407.1592129544725682024.davem@davemloft.net> References: <20150612.142058.1085284048217032168.davem@davemloft.net> <20170710031959.7496-1-Jason@zx2c4.com> <20170710.090407.1592129544725682024.davem@davemloft.net> From: "Jason A. Donenfeld" Date: Mon, 10 Jul 2017 13:52:45 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/2] netdevice: add netdev_pub helper function To: David Miller Cc: Netdev , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 10, 2017 at 10:04 AM, David Miller wrote: > I disagree. Assuming one can go from the driver private to the netdev > object trivially is a worse assumption than the other way around, and > locks us into the current implementation of how the netdev and driver > private memory is allocated. > > If you want to style your driver such that the private is passed > around instead of the netdev, put a pointer back to the netdev object > in your private data structure. I'm surprised you're okay with the memory waste of that, but you bring up the ability to change the interface later, which is a great point. I'll submit a patch for that random driver, and I'll also refactor WireGuard to do the same. Thanks for the guidance. Jason