All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: David Miller <davem@davemloft.net>
Cc: Netdev <netdev@vger.kernel.org>, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] netdevice: add netdev_pub helper function
Date: Mon, 10 Jul 2017 13:52:45 +0200	[thread overview]
Message-ID: <CAHmME9rMQdukz-Nw_9uDqLYg5od5QFHK8K_boC0gRkvxz0jjqw@mail.gmail.com> (raw)
In-Reply-To: <20170710.090407.1592129544725682024.davem@davemloft.net>

On Mon, Jul 10, 2017 at 10:04 AM, David Miller <davem@davemloft.net> 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

  reply	other threads:[~2017-07-10 11:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-12 13:30 [PATCH] netdevice: add netdev_pub helper function Jason A. Donenfeld
2015-06-12 21:20 ` David Miller
2017-07-10  3:19   ` [PATCH 1/2] " Jason A. Donenfeld
2017-07-10  3:19     ` [PATCH 2/2] ioc3-eth: use netdev_pub instead of handrolling alignment Jason A. Donenfeld
2017-07-10  8:04     ` [PATCH 1/2] netdevice: add netdev_pub helper function David Miller
2017-07-10 11:52       ` Jason A. Donenfeld [this message]
2016-10-05  0:52 ` [PATCH] " Jason A. Donenfeld

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHmME9rMQdukz-Nw_9uDqLYg5od5QFHK8K_boC0gRkvxz0jjqw@mail.gmail.com \
    --to=jason@zx2c4.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.