From: Hannes Frederic Sowa <hannes@stressinduktion.org>
To: Jesse Gross <jesse@kernel.org>
Cc: Linux Kernel Network Developers <netdev@vger.kernel.org>
Subject: Re: [PATCH net-next 2/2] geneve: break dependency to network drivers
Date: Wed, 6 Jan 2016 19:48:40 +0100 [thread overview]
Message-ID: <568D6188.4090705@stressinduktion.org> (raw)
In-Reply-To: <CAEh+42j2w6t7+WNN9y0k6M5Ld+14B2txCkfLw6zwrR04+i8Xqw@mail.gmail.com>
On 06.01.2016 19:00, Jesse Gross wrote:
> On Wed, Jan 6, 2016 at 7:41 AM, Hannes Frederic Sowa
> <hannes@stressinduktion.org> wrote:
>> diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c
>> index 24b077a32c1c9c..548925d1571cb1 100644
>> --- a/drivers/net/geneve.c
>> +++ b/drivers/net/geneve.c
>> +static int geneve_notifier(struct notifier_block *unused,
>> + unsigned long event, void *ptr)
>> +{
>> + struct net_device *dev = netdev_notifier_info_to_dev(ptr);
>> +
>> + switch (event) {
>> + case NETDEV_REFRESH_OFFLOAD_VXLAN:
>> + geneve_notify_refresh_netdev(dev);
>
> Presumably this should be NETDEV_REFRESH_OFFLOAD_GENEVE, not VXLAN.
> However, rather than having a notifier for each protocol, it seems
> like it might be cleaner to just have a single one that triggers for
> all protocols and drivers that don't have the corresponding NDO
> wouldn't get called, similar to what happens when the port gets added
> in the first place.
Ah, thanks for noticing the typo.
The reason why I went with several types is that I didn't want to change
the behavior and wasn't sure if driver tested with reoccurring offload
refreshes to the driver. What you described was my first patch but
because I couldn't see if that works for all drivers I went this way.
>> diff --git a/include/net/geneve.h b/include/net/geneve.h
>> index e6c23dc765f7ec..36245115143652 100644
>> --- a/include/net/geneve.h
>> +++ b/include/net/geneve.h
> [...]
>> static inline void geneve_get_rx_port(struct net_device *netdev)
>> {
>> + call_netdevice_notifiers(NETDEV_REFRESH_OFFLOAD_GENEVE, netdev);
>> }
>
> Unfortunately, I don't think that we can assume that RTNL is held
> here. It actually is for the drivers that implement Geneve at this
> point but not in all cases for VXLAN. For example, ixgbe refreshes the
> offloads in a service task in addition to when it is opened. There's
> only a couple instances of things like this, so I guess it's probably
> not too hard to through and make sure that we hold RTNL in those
> cases.
Hmm, I am tempted to switch over to the netevent atomic notifier chain
and install those events there. It does not need rtnl lock at all, so we
can preserve the current semantics. What do you think?
Thanks,
Hannes
next prev parent reply other threads:[~2016-01-06 18:48 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-06 15:41 [PATCH net-next 0/2] net: break dependency of drivers on geneve and vxlan Hannes Frederic Sowa
2016-01-06 15:41 ` [PATCH net-next 1/2] vxlan: break dependency to network drivers Hannes Frederic Sowa
2016-01-06 15:41 ` [PATCH net-next 2/2] geneve: " Hannes Frederic Sowa
2016-01-06 18:00 ` Jesse Gross
2016-01-06 18:48 ` Hannes Frederic Sowa [this message]
2016-01-06 19:52 ` Jesse Gross
2016-01-06 20:25 ` Hannes Frederic Sowa
2016-01-06 21:01 ` Jesse Gross
2016-01-06 21:18 ` Hannes Frederic Sowa
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=568D6188.4090705@stressinduktion.org \
--to=hannes@stressinduktion.org \
--cc=jesse@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 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).