From: Jiri Pirko <jiri@resnulli.us>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: Johannes Berg <johannes@sipsolutions.net>,
netdev <netdev@vger.kernel.org>, amwang <amwang@redhat.com>,
Stephen Hemminger <stephen@networkplumber.org>,
kaber <kaber@trash.net>, David Miller <davem@davemloft.net>,
vyasevic <vyasevic@redhat.com>,
Eric Dumazet <eric.dumazet@gmail.com>
Subject: Re: [PATCH 1/3] net: add a new NETDEV_CHANGEROOM event type
Date: Tue, 20 Aug 2013 18:10:12 +0200 [thread overview]
Message-ID: <20130820161012.GC1593@minipsycho.brq.redhat.com> (raw)
In-Reply-To: <CAGVrzcahRhYJM-1KcNDOoekKCetSZCN67hHQ0fgjndehZ=9EUw@mail.gmail.com>
Tue, Aug 20, 2013 at 05:30:48PM CEST, f.fainelli@gmail.com wrote:
>2013/8/20 Johannes Berg <johannes@sipsolutions.net>:
>> On Tue, 2013-08-20 at 13:45 +0100, Florian Fainelli wrote:
>>
>>> /**
>>> + * dev_set_headroom - Change device needed headroom
>>> + * @dev: device
>>> + * @new_headroom: new headroom size
>>> + *
>>> + * Change the network device headroom space.
>>> + */
>>> +int dev_set_headroom(struct net_device *dev, unsigned short new_headroom)
>>
>> It seems that you need to invoke these under RTNL, might be worth
>> documenting that.
>
>Good point, yes.
>
>>
>> Also, maybe it would be worth doing it in one call? If you need to
>> change both, then you'd end up calling the notifier twice, which is less
>> efficient?
>
>I have mixed feelings about this. I do not expect changing the
>headroom/tailroom to be in a hot-path, and we would need to have a
>name such as dev_set_head_and_tailroom() or something that clearly
>states that it operates on both quantities. Looking at the subsystems
>and drivers, there are quite a lot of users which only set one or the
>other, occasionaly both before registration.
>
>> I suppose you could make them 'int' arguments and reserve -1
Ugh, -1, I don't like this. I think that they should be set separate. Not
real need to do it in one function.
>> for no changes, or just require both new values to be given (if doing
>> this at all.)
>
>What I like about keeping them separate is that we can use the
>"native" storage type that is used in struct net_device, and have
>compile-time checking of this.
>--
>Florian
next prev parent reply other threads:[~2013-08-20 16:10 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-20 12:45 [PATCH 0/3] net: propagate dynamic needed_headroom/tailroom changes Florian Fainelli
2013-08-20 12:45 ` [PATCH 1/3] net: add a new NETDEV_CHANGEROOM event type Florian Fainelli
2013-08-20 15:16 ` Johannes Berg
2013-08-20 15:30 ` Florian Fainelli
2013-08-20 16:10 ` Jiri Pirko [this message]
2013-08-20 16:35 ` Johannes Berg
2013-08-20 17:30 ` Florian Fainelli
2013-08-20 12:45 ` [PATCH 2/3] net: vlan: handle NETDEV_CHANGEROOM events Florian Fainelli
2013-08-20 12:45 ` [PATCH 3/3] net: bridge: handle NETDEV_CHANGEROOM event Florian Fainelli
2013-08-20 13:29 ` [PATCH 0/3] net: propagate dynamic needed_headroom/tailroom changes Jiri Pirko
2013-08-20 14:24 ` Florian Fainelli
2013-08-20 14:27 ` Jiri Pirko
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=20130820161012.GC1593@minipsycho.brq.redhat.com \
--to=jiri@resnulli.us \
--cc=amwang@redhat.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=f.fainelli@gmail.com \
--cc=johannes@sipsolutions.net \
--cc=kaber@trash.net \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
--cc=vyasevic@redhat.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).